Files
zhwl/zhwl-device/zhwl-device-gate/target/classes/mapper/gate/ZdyDeviceGateConfigMapper.xml
2025-07-01 17:54:58 +08:00

178 lines
7.9 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.zhwl.gate.mapper.ZdyDeviceGateConfigMapper">
<resultMap type="ZdyDeviceGateConfig" id="ZdyDeviceGateConfigResult">
<result property="id" column="id"/>
<result property="ticketCheckInterval" column="ticket_check_interval"/>
<result property="ticketCheckSuccessfulVoice" column="ticket_check_successful_voice"/>
<result property="ticketCheckFailureVoice" column="ticket_check_failure_voice"/>
<result property="ticketCheckAnomalyVoice" column="ticket_check_anomaly_voice"/>
<result property="ticketCheckResult" column="ticket_check_result"/>
<result property="ticketCheckResultNon" column="ticket_check_result_non"/>
<result property="deptId" column="dept_id"/>
<result property="serialNo" column="serial_no"/>
<result property="voiceSex" column="voice_sex"/>
</resultMap>
<sql id="selectZdyDeviceGateConfigVo">
select id, ticket_check_interval, ticket_check_successful_voice, ticket_check_failure_voice, ticket_check_anomaly_voice, ticket_check_result, ticket_check_result_non, remark, dept_id, serial_no, voice_sex
from zdy_device_gate_config
</sql>
<select id="selectZdyDeviceGateConfigList" parameterType="ZdyDeviceGateConfig" resultMap="ZdyDeviceGateConfigResult">
<include refid="selectZdyDeviceGateConfigVo"/>
<where>
<if test="deptId != null">
and dept_id = #{deptId}
</if>
<if test="serialNo != null and serialNo != ''">
and serial_no = #{serialNo}
</if>
</where>
</select>
<select id="selectZdyDeviceGateConfigById" parameterType="Long"
resultMap="ZdyDeviceGateConfigResult">
<include refid="selectZdyDeviceGateConfigVo"/>
where id = #{id}
</select>
<select id="selectZdyDeviceGateConfigBySerialNo" resultMap="ZdyDeviceGateConfigResult">
<include refid="selectZdyDeviceGateConfigVo"/>
where serial_no = #{serialNo}
</select>
<select id="checkSerialNoUnique" resultMap="ZdyDeviceGateConfigResult">
select id, serial_no from zdy_device_gate_config
where serial_no = #{serialNo} limit 1
</select>
<insert id="insertZdyDeviceGateConfig" parameterType="ZdyDeviceGateConfig" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_device_gate_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ticketCheckInterval != null">ticket_check_interval,
</if>
<if test="ticketCheckSuccessfulVoice != null">ticket_check_successful_voice,
</if>
<if test="ticketCheckFailureVoice != null">ticket_check_failure_voice,
</if>
<if test="ticketCheckAnomalyVoice != null">ticket_check_anomaly_voice,
</if>
<if test="ticketCheckResult != null">ticket_check_result,
</if>
<if test="ticketCheckResultNon != null">ticket_check_result_non,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
<if test="remark != null">remark,
</if>
<if test="deptId != null">dept_id,
</if>
<if test="serialNo != null">serial_no,
</if>
<if test="voiceSex != null">voice_sex,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ticketCheckInterval != null">#{ticketCheckInterval},
</if>
<if test="ticketCheckSuccessfulVoice != null">#{ticketCheckSuccessfulVoice},
</if>
<if test="ticketCheckFailureVoice != null">#{ticketCheckFailureVoice},
</if>
<if test="ticketCheckAnomalyVoice != null">#{ticketCheckAnomalyVoice},
</if>
<if test="ticketCheckResult != null">#{ticketCheckResult},
</if>
<if test="ticketCheckResultNon != null">#{ticketCheckResultNon},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="remark != null">#{remark},
</if>
<if test="deptId != null">#{deptId},
</if>
<if test="serialNo != null">#{serialNo},
</if>
<if test="voiceSex != null">#{voiceSex},
</if>
</trim>
</insert>
<update id="updateZdyDeviceGateConfig" parameterType="ZdyDeviceGateConfig">
update zdy_device_gate_config
<trim prefix="SET" suffixOverrides=",">
<if test="ticketCheckInterval != null">ticket_check_interval =
#{ticketCheckInterval},
</if>
<if test="ticketCheckSuccessfulVoice != null">ticket_check_successful_voice =
#{ticketCheckSuccessfulVoice},
</if>
<if test="ticketCheckFailureVoice != null">ticket_check_failure_voice =
#{ticketCheckFailureVoice},
</if>
<if test="ticketCheckAnomalyVoice != null">ticket_check_anomaly_voice =
#{ticketCheckAnomalyVoice},
</if>
<if test="ticketCheckResult != null">ticket_check_result =
#{ticketCheckResult},
</if>
<if test="ticketCheckResultNon != null">ticket_check_result_non =
#{ticketCheckResultNon},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
<if test="remark != null">remark =
#{remark},
</if>
<if test="deptId != null">dept_id =
#{deptId},
</if>
<if test="serialNo != null">serial_no =
#{serialNo},
</if>
<if test="voiceSex != null">voice_sex =
#{voiceSex},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteZdyDeviceGateConfigById" parameterType="Long">
delete from zdy_device_gate_config where id = #{id}
</delete>
<delete id="deleteZdyDeviceGateConfigByIds" parameterType="String">
delete from zdy_device_gate_config where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>