lohir
2024-10-23 da426ecaf4fd047c6cb43cd9a0c1288e39c4e91d
ycl-server/src/main/resources/mapper/zgyw/TMonitorMapper.xml
@@ -369,7 +369,8 @@
        IFNULL(SUM(IF(p.online = 1, 1, 0)), 0) AS totalMembers,
        IFNULL(SUM(IF(p.online = -1, 1, 0)), 0) AS postsPercentage,
        IFNULL(SUM(IF(p.online = 0, 1, 0)), 0) AS unknownNumbers,
        IFNULL(ROUND(SUM(IF(p.online = 1 , 1, 0)) / count(*) * 100, 2), 0) as viewsPercentage FROM t_monitor m
        IFNULL(ROUND(SUM(IF(p.online = 1 , 1, 0)) / count(*) * 100, 2), 0) as viewsPercentage
        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 and d.del_flag = 0
        <where>
@@ -385,12 +386,13 @@
    </select>
    <select id="recoveryException" resultType="java.util.Map">
        SELECT count(*)                                                          AS totalPosts,
               IFNULL(SUM(IF(p.online = 1, 1, 0)), 0)                            AS totalMembers,
               IFNULL(SUM(IF(p.online = 0, 1, 0)), 0)                            AS postsPercentage,
               IFNULL(ROUND(SUM(IF(p.online = 1, 1, 0)) / count(*) * 100, 2), 0) as viewsPercentage
        FROM t_monitor t
        LEFT JOIN t_yw_point p ON t.serial_number = p.serial_number
        SELECT count(*) AS totalPosts,
        IFNULL(SUM(IF(p.online = 1, 1, 0)), 0) AS totalMembers,
        IFNULL(SUM(IF(p.online = -1, 1, 0)), 0) AS postsPercentage,
        IFNULL(SUM(IF(p.online = 0, 1, 0)), 0) AS unknownNumbers,
        IFNULL(ROUND(SUM(IF(p.online = 1 , 1, 0)) / count(*) * 100, 2), 0) as viewsPercentage
        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 and d.del_flag = 0
        <where>
            p.examine_status = 1
@@ -398,6 +400,9 @@
             <if test="provinceTag!=null">
                and p.province_tag = #{provinceTag}
             </if>
            <if test="deptTag!=null">
                and p.dept_tag = #{deptTag}
            </if>
        ${params.dataScope}
        </where>
    </select>
@@ -560,53 +565,51 @@
    </select>
<!--    <select id="assetManagement" resultMap="dyMap">-->
<!--        SELECT-->
<!--            tm.id,-->
<!--            tm.serial_number,-->
<!--               tm.name,-->
<!--               tm.site_type,-->
<!--               tm.mac_addr,-->
<!--               tm.ip,-->
<!--               tm.camera_fun_type,-->
<!--               tm.longitude,-->
<!--               tm.latitude,-->
<!--               tm.camera_capture_area,-->
<!--               tm.on_state,-->
<!--               tm.civil_code,-->
<!--               tm.integrated_device,-->
<!--               tm.camera_brand,-->
<!--               tm.address,-->
<!--               tm.net_working,-->
<!--               tm.public_security,-->
<!--               tm.installed_time,-->
<!--               tm.management_unit,-->
<!--               tm.mu_contact_info,-->
<!--               tm.storage_days,-->
<!--               tm.monitor_azimuth,-->
<!--               tm.scene_photo_addr,-->
<!--               tm.model,-->
<!--               tm.site_vulgo,-->
<!--               tm.camera_type,-->
<!--               tm.camera_light_type,-->
<!--               tm.encoded_format,-->
<!--               tm.camera_dept,-->
<!--               tm.hybm,-->
<!--               tm.lxbm,-->
<!--               't_monitor' as tableName,-->
<!--               #{query.keyword} as keyword-->
<!--        FROM-->
<!--            t_monitor tm-->
<!--                INNER JOIN t_yw_point yp ON yp.serial_number = tm.serial_number-->
<!--        <where>-->
<!--            <if test="query.keyword != null and query.keyword != ''">-->
<!--                AND tm.name like concat('%', #{query.keyword}, '%')-->
<!--            </if>-->
<!--            <if test="query.startTIme != null and query.endTime != null">-->
<!--                AND yp.create_time between #{query.startTime} and #{query.endTime}-->
<!--            </if>-->
<!--        </where>-->
<!--    </select>-->
    <select id="assetManagement" resultType="com.ycl.platform.domain.vo.TMonitorVO">
        SELECT
            tm.id,
            tm.serial_number,
               tm.name,
               tm.site_type,
               tm.mac_addr,
               tm.ip,
               tm.camera_fun_type,
               tm.longitude,
               tm.latitude,
               tm.camera_capture_area,
               tm.on_state,
               tm.civil_code,
               tm.integrated_device,
               tm.camera_brand,
               tm.address,
               tm.net_working,
               tm.public_security,
               tm.installed_time,
               tm.management_unit,
               tm.mu_contact_info,
               tm.storage_days,
               tm.monitor_azimuth,
               tm.scene_photo_addr,
               tm.model,
               tm.site_vulgo,
               tm.camera_type,
               tm.camera_light_type,
               tm.encoded_format,
               tm.camera_dept,
               tm.hybm,
               tm.lxbm
        FROM
            t_monitor tm
                INNER JOIN t_yw_point yp ON yp.serial_number = tm.serial_number
        <where>
            <if test="query.keyword != null and query.keyword != ''">
                AND tm.name like concat('%', #{query.keyword}, '%')
            </if>
            <if test="query.startTIme != null and query.endTime != null">
                AND yp.create_time between #{query.startTime} and #{query.endTime}
            </if>
        </where>
    </select>
<!--    <select id="getDyColumns" resultMap="dynamicColumnMap">-->
<!--        SELECT-->