| | |
| | | <if test="civilCode != null and civilCode != ''">and civil_code = #{civilCode}</if> |
| | | <if test="integratedDevice != null ">and integrated_device = #{integratedDevice}</if> |
| | | <if test="cameraBrand != null ">and camera_brand = #{cameraBrand}</if> |
| | | <if test="address != null and address != ''">and address like concat('%',#{address},'%')</if> |
| | | <if test="address != null and address != ''">and d.dept_id = #{address}</if> |
| | | <if test="netWorking != null ">and net_working = #{netWorking}</if> |
| | | <if test="publicSecurity != null and publicSecurity != ''">and public_security = #{publicSecurity}</if> |
| | | <if test="installedTime != null ">and installed_time = #{installedTime}</if> |
| | |
| | | LEFT JOIN t_work_order w ON w.serial_number = p.serial_number |
| | | WHERE u.id = #{unitId} AND MONTH(w.create_time) IS NOT NULL |
| | | <if test="dateRange != null and dateRange.size > 0"> |
| | | AND DATE_FORMAT(w.create_time, '%Y-%m') BETWEEN #{dateRange[0]} AND #{dateRange[1]} |
| | | AND DATE_FORMAT(w.create_time, '%Y-%m') BETWEEN DATE_FORMAT(#{dateRange[0]}, '%Y-%m') AND DATE_FORMAT(#{dateRange[1]}, '%Y-%m') |
| | | </if> |
| | | GROUP BY months |
| | | ORDER BY months |