47 lines
2.2 KiB
XML
47 lines
2.2 KiB
XML
<?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.sercurityControl.proteam.mapper.DeviceMachineMapper">
|
|
|
|
<select id="getDeviceMachineList" resultType="com.sercurityControl.proteam.domain.DeviceMachineEntity"
|
|
parameterType="com.sercurityControl.proteam.domain.DeviceMachineEntity">
|
|
SELECT ANY_VALUE(td.mac_id) AS mac,
|
|
ANY_VALUE(td.puid) AS puId,
|
|
ANY_VALUE(IF(td.state = '0', '不在线', '在线')) AS state,
|
|
ANY_VALUE(IFNULL(jcm.single_project_name, '')) AS deviceName,
|
|
ANY_VALUE(IFNULL(jcmi.work_manage_num, '')) AS fzrName,
|
|
ANY_VALUE(IFNULL(jcmi.work_manage_phone, '')) AS phone,
|
|
ANY_VALUE(IFNULL(so.city_name, '未分配')) AS org
|
|
FROM t_device td
|
|
LEFT JOIN jj_ball jb on jb.camera_no=td.t_code
|
|
LEFT JOIN jj_class_meetting jcm on jcm.camera_id2=jb.id AND jcm.current_constr_date=current_date()
|
|
left join jj_class_metting_info jcmi on jcmi.class_id=jcm.id
|
|
LEFT JOIN t_ball_type tbt ON tbt.id = td.type_code AND tbt.is_flag = '0' AND tbt.p_id = '1'
|
|
LEFT JOIN sys_org so ON so.org_id = jcm.build_unit_code
|
|
WHERE td.is_flag = '0'
|
|
<if test="org != null and org != ''">
|
|
AND so.org_id IN (
|
|
<foreach collection="orgList" item="item" separator=",">
|
|
#{item}
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="fzrName != null and fzrName != ''">
|
|
AND tc.work_manager LIKE CONCAT('%',#{fzrName},'%')
|
|
</if>
|
|
<if test="deviceName != null and deviceName != ''">
|
|
AND tc.pro_name LIKE CONCAT('%',#{deviceName},'%')
|
|
</if>
|
|
<if test="state != null and state != ''">
|
|
AND td.state LIKE CONCAT('%',#{state},'%')
|
|
</if>
|
|
<if test="mac != null and mac != ''">
|
|
AND td.mac_id LIKE CONCAT('%',#{mac},'%')
|
|
</if>
|
|
<if test="puId != null and puId != ''">
|
|
AND td.puid LIKE CONCAT('%',#{puId},'%')
|
|
</if>
|
|
GROUP BY td.mac_id
|
|
ORDER BY org, fzrName DESC
|
|
|
|
</select>
|
|
</mapper> |