You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.0 KiB
34 lines
1.0 KiB
|
5 years ago
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||
|
|
<mapper namespace="com.ccsens.wisdomcar.persist.dao.StatisticsDao">
|
||
|
|
|
||
|
|
<select id="selResult" resultType="com.ccsens.wisdomcar.bean.vo.StatisticsVo$UseNumVo" parameterType="com.ccsens.wisdomcar.bean.dto.StatisticsDto$UseNum">
|
||
|
|
select tsm.`name`,if(tfa.num is NULL,0,tfa.num) as num FROM
|
||
|
|
(SELECT
|
||
|
|
concat( #{param.year}, `name` ) AS `name`
|
||
|
|
FROM
|
||
|
|
t_statistics_month ) tsm
|
||
|
|
LEFT JOIN (
|
||
|
|
SELECT
|
||
|
|
tfa.da,
|
||
|
|
count( tfa.da ) AS num
|
||
|
|
FROM
|
||
|
|
(
|
||
|
|
SELECT
|
||
|
|
*,
|
||
|
|
FROM_UNIXTIME( begin_time / 1000, '%Y-%m' ) AS da
|
||
|
|
FROM
|
||
|
|
`t_first_aid`
|
||
|
|
WHERE
|
||
|
|
`t_first_aid`.rec_status = 0
|
||
|
|
AND `t_first_aid`.hospital_id =#{param.hospitalId}
|
||
|
|
AND FROM_UNIXTIME( begin_time / 1000, '%Y-%m' ) LIKE concat(#{param.year},'-%')
|
||
|
|
) tfa
|
||
|
|
GROUP BY
|
||
|
|
tfa.da
|
||
|
|
ORDER BY
|
||
|
|
tfa.da
|
||
|
|
) tfa on tsm.`name`=tfa.`da`
|
||
|
|
</select>
|
||
|
|
|
||
|
|
</mapper>
|