jl-jjsp-service/securityControl-modules/securityControl-proteam/target/classes/mapper/dutyTask/ExternalProMapper.xml

82 lines
3.6 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.dutyTask.mapper.ExternalProMapper">
<update id="operData">
<if test="type == 1">
INSERT INTO tb_external_pro
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="proName != null and proName!=''">pro_name,</if>
<if test="workManager != null and workManager!=''">work_manager,</if>
<if test="sgUnit != null and sgUnit!=''">sg_unit,</if>
<if test="ballCode1 != null and ballCode1 != ''">ball_code1,</if>
<if test="ballCode2 != null and ballCode2 != ''">ball_code2,</if>
<if test="ballCode3 != null and ballCode3 != ''">ball_code3,</if>
<if test="ballCode4 != null and ballCode4 != ''">ball_code4,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="proName != null and proName!=''">#{proName},</if>
<if test="workManager != null and workManager!=''">#{workManager},</if>
<if test="sgUnit != null and sgUnit!=''">#{sgUnit},</if>
<if test="ballCode1 != null and ballCode1 != ''">#{ballCode1},</if>
<if test="ballCode2 != null and ballCode2 != ''">#{ballCode2},</if>
<if test="ballCode3 != null and ballCode3 != ''">#{ballCode3},</if>
<if test="ballCode4 != null and ballCode4 != ''">#{ballCode4},</if>
</trim>
</if>
<if test="type == 2">
UPDATE tb_external_pro SET pro_name = #{proName},work_manager = #{workManager},sg_unit = #{sgUnit},
ball_code1 = #{ballCode1},ball_code2 = #{ballCode2},ball_code3 = #{ballCode3},
ball_code4 = #{ballCode4} WHERE id = #{id}
</if>
<if test="type == 3">
DELETE FROM tb_external_pro WHERE id = #{id}
</if>
</update>
<!--系统外工程列表-->
<select id="getExternalPros" resultType="com.sercurityControl.proteam.dutyTask.domain.ExternalProVo">
SELECT id,
pro_name AS proName,
work_manager AS workManager,
sg_unit AS sgUnit,
ball_code1 AS ballCode1,
ball_code2 AS ballCode2,
ball_code3 AS ballCode3,
ball_code4 AS ballCode4
FROM tb_external_pro
<where>
<if test="proName!=null and proName!=''">
AND INSTR(pro_name,#{proName}) > 0
</if>
<if test="workManager!=null and workManager!=''">
AND INSTR(work_manager,#{workManager}) > 0
</if>
<if test="sgUnit!=null and sgUnit!=''">
AND INSTR(sg_unit,#{sgUnit}) > 0
</if>
</where>
ORDER BY create_time DESC
</select>
<!--查询球机状态-->
<select id="getBallStatus" resultType="java.util.Map">
<if test="type == 1">
SELECT td.t_code AS tcode,
td.puid,
td.state AS online
FROM t_device td
WHERE td.t_code = #{code}
AND td.is_flag=0
ORDER BY td.state DESC
</if>
<if test="type == 2">
SELECT td.t_code AS tcode,
td.puid,
td.state AS online
FROM t_device td
WHERE td.mac_id = #{code}
AND td.is_flag=0
ORDER BY td.state DESC
</if>
</select>
</mapper>