zxl
9 天以前 8f2e8522daf081ad4da027c39a776fdd9483b97e
ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
@@ -414,9 +414,24 @@
            <if test="deptTag!=null">
                and p.dept_tag = #{deptTag}
            </if>
            <if test="address != null">
                and p.dept_id = #{address}
            </if>
            ${params.dataScope}
        </where>
    </select>
    <select id="getAllVideo" resultType="java.lang.Long">
        SELECT
               IFNULL(SUM(IF((m.camera_fun_type like '%1%'), 1, 0)), 0) AS video
        FROM t_monitor m
                 left join t_yw_point p on m.serial_number = p.serial_number
    </select>
    <select id="getIdListVideo" resultType="java.lang.String">
        select m.serial_number
        FROM t_monitor m where m.camera_fun_type like '%1%'
    </select>
    <select id="assetManagementCount" resultType="java.util.Map">
        SELECT count(*) AS total,
        IFNULL(SUM(IF((m.camera_fun_type like '%1%'), 1, 0)), 0) AS video,
@@ -500,7 +515,7 @@
<!--        LEFT JOIN t_yw_unit u ON p.unit_id = u.id-->
<!--        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">-->
<!--       <if test="dateRange != null and dateRange.size > 0">-->
<!--            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-->
@@ -513,17 +528,18 @@
        u.unit_name AS name,
        CONCAT(MONTH(w.create_time), '月') AS months
        from
        (select count(m.id) as num from  t_monitor m where m.serial_number IN (SELECT p.serial_number from  t_yw_unit u,t_yw_point p where p.unit_id = u.id and u.id = 21 AND p.examine_status = 1)
        (select count(m.id) as num from  t_monitor m where m.serial_number IN (SELECT p.serial_number from  t_yw_unit u,t_yw_point p where p.unit_id = u.id and u.id = #{unitId} AND p.examine_status = 1)
        ) as a
        join
        t_work_order w
        JOIN t_yw_unit u ON u.id = w.unit_id
        where w.unit_id=#{unitId}
        <if test="dateRange != null and dateRange.size > 0">
          AND DATE_FORMAT(w.create_time, '%Y-%m') BETWEEN DATE_FORMAT(#{dateRange[0], '%Y-%m') AND DATE_FORMAT(#{dateRange[1], '%Y-%m')
            AND DATE_FORMAT(w.create_time, '%Y-%m') BETWEEN DATE_FORMAT(#{dateRange[0]}, '%Y-%m') AND DATE_FORMAT(#{dateRange[1]}, '%Y-%m')
        </if>
          AND w.deleted = 1
        AND w.deleted = 1
        GROUP BY months
        ORDER BY months
</select>
    <select id="monitorTotal" resultType="com.ycl.platform.domain.vo.screen.MonitorTotalVO">
        SELECT
@@ -693,9 +709,9 @@
        from t_monitor m
            left join t_yw_point p on m.serial_number = p.serial_number
            left join sys_dept d on p.dept_id = d.dept_id
        where p.online != 0 and p.examine_status = 1
        where  p.examine_status = 1
    </select>
<!--上方修改了  p.online != 0 and-->
    <update id="updateOnlineFromUyOrHk">
        <foreach collection="onlineList" item="online" separator=";">
            UPDATE