| | |
| | | DATE_FORMAT( a.gmt_create, '%Y' ) |
| | | </select> |
| | | |
| | | <select id="selectByDayAndDept" resultMap="emergencyDrillExecuteCountChart"> |
| | | SELECT |
| | | count( 0 ) AS num, |
| | | DATE_FORMAT( a.gmt_create, '%Y-%m-%d' ) AS `name` |
| | | FROM |
| | | `emergency_drill_execute` a |
| | | LEFT JOIN emergency_drill_plan b ON a.drill_plan_id = b.id |
| | | WHERE |
| | | a.del_flag = 0 |
| | | AND a.gmt_create <![CDATA[ >= ]]> #{startTime} |
| | | AND a.gmt_create <![CDATA[ <= ]]> #{endTime} |
| | | <if test="deptIds != null " > |
| | | and b.department_id in |
| | | <foreach item="id" collection="deptIds" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | GROUP BY |
| | | DATE_FORMAT( a.gmt_create, '%Y-%m-%d' ) |
| | | </select> |
| | | |
| | | |
| | | <select id="selectEmergencyDrillExecuteIntervalTimeByDeptId" resultType="java.lang.String"> |
| | | SELECT |
| | | DATE_FORMAT( max( a.gmt_create ), '%Y-%m-%d' ) AS lastTime |
| | | DATE_FORMAT( max( a.gmt_create ), '%Y-%m-%d %H:%i:%s' ) AS lastTime |
| | | FROM |
| | | `emergency_drill_execute` a |
| | | INNER JOIN emergency_drill_plan b ON a.drill_plan_id = b.id |