290 lines
10 KiB
XML
290 lines
10 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.device.ticket_machine.mapper.DeviceTicketMachineMapper">
|
||
|
|
||
|
<resultMap type="DeviceTicketMachine" id="DeviceTicketMachineResult">
|
||
|
<result property="id" column="id"/>
|
||
|
<result property="name" column="name"/>
|
||
|
<result property="serialNo" column="serial_no"/>
|
||
|
<result property="model" column="model"/>
|
||
|
<result property="ip" column="ip"/>
|
||
|
<result property="mac" column="mac"/>
|
||
|
<result property="version" column="version"/>
|
||
|
<result property="address" column="address"/>
|
||
|
<result property="status" column="status"/>
|
||
|
<result property="printerStatus" column="printer_status"/>
|
||
|
<result property="havePaperNum" column="have_paper_num"/>
|
||
|
<result property="password" column="password"/>
|
||
|
<result property="createBy" column="create_by"/>
|
||
|
<result property="createTime" column="create_time"/>
|
||
|
<result property="statusTime" column="status_time"/>
|
||
|
<result property="printerStatusTime" column="printer_status_time"/>
|
||
|
<result property="deptId" column="dept_id"/>
|
||
|
<result property="scenicId" column="scenic_id"/>
|
||
|
<result property="scenicName" column="scenic_name"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="selectDeviceTicketMachineVo">
|
||
|
select zdtm.id,
|
||
|
zdtm.name,
|
||
|
zdtm.serial_no,
|
||
|
zdtm.model,
|
||
|
zdtm.ip,
|
||
|
zdtm.mac,
|
||
|
zdtm.version,
|
||
|
zdtm.address,
|
||
|
zdtm.status,
|
||
|
zdtm.printer_status,
|
||
|
zdtm.have_paper_num,
|
||
|
zdtm.password,
|
||
|
zdtm.create_by,
|
||
|
zdtm.create_time,
|
||
|
zdtm.status_time,
|
||
|
zdtm.printer_status_time,
|
||
|
zdtm.dept_id,
|
||
|
zdtm.scenic_id,
|
||
|
zs.scenic_name
|
||
|
from zdy_device_ticket_machine zdtm
|
||
|
left join zdy_scenic zs on zs.id = zdtm.scenic_id
|
||
|
</sql>
|
||
|
|
||
|
<select id="selectDeviceTicketMachineList" parameterType="DeviceTicketMachine"
|
||
|
resultMap="DeviceTicketMachineResult">
|
||
|
<include refid="selectDeviceTicketMachineVo"/>
|
||
|
<where>
|
||
|
<if test="name != null and name != ''">
|
||
|
and zdtm.name like concat('%', #{name}, '%')
|
||
|
</if>
|
||
|
<if test="serialNo != null and serialNo != ''">
|
||
|
and zdtm.serial_no like concat('%', #{serialNo}, '%')
|
||
|
</if>
|
||
|
<if test="status != null and status != ''">
|
||
|
and zdtm.status = #{status}
|
||
|
</if>
|
||
|
<if test="deptId != null and deptId != ''">
|
||
|
and zdtm.deptId = #{dept_id}
|
||
|
</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="selectDeviceTicketMachineById" parameterType="Long"
|
||
|
resultMap="DeviceTicketMachineResult">
|
||
|
<include refid="selectDeviceTicketMachineVo"/>
|
||
|
where zdtm.id = #{id}
|
||
|
</select>
|
||
|
<select id="selectDeviceTicketMachineBySerialNo"
|
||
|
resultMap="DeviceTicketMachineResult">
|
||
|
<include refid="selectDeviceTicketMachineVo"/>
|
||
|
where zdtm.serial_no = #{serialNo} limit 1
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertDeviceTicketMachine" parameterType="DeviceTicketMachine" useGeneratedKeys="true"
|
||
|
keyProperty="id">
|
||
|
insert into zdy_device_ticket_machine
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="name != null">name,
|
||
|
</if>
|
||
|
<if test="serialNo != null and serialNo != ''">serial_no,
|
||
|
</if>
|
||
|
<if test="model != null">model,
|
||
|
</if>
|
||
|
<if test="ip != null">ip,
|
||
|
</if>
|
||
|
<if test="mac != null">mac,
|
||
|
</if>
|
||
|
<if test="version != null">version,
|
||
|
</if>
|
||
|
<if test="address != null">address,
|
||
|
</if>
|
||
|
<if test="status != null and status != ''">status,
|
||
|
</if>
|
||
|
<if test="printerStatus != null">printer_status,
|
||
|
</if>
|
||
|
<if test="havePaperNum != null">have_paper_num,
|
||
|
</if>
|
||
|
<if test="password != null and password != ''">password,
|
||
|
</if>
|
||
|
<if test="createBy != null">create_by,
|
||
|
</if>
|
||
|
<if test="createTime != null">create_time,
|
||
|
</if>
|
||
|
<if test="statusTime != null">status_time,
|
||
|
</if>
|
||
|
<if test="printerStatusTime != null">printer_status_time,
|
||
|
</if>
|
||
|
<if test="deptId != null">dept_id,
|
||
|
</if>
|
||
|
<if test="scenicId != null">scenic_id,
|
||
|
</if>
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="name != null">#{name},
|
||
|
</if>
|
||
|
<if test="serialNo != null and serialNo != ''">#{serialNo},
|
||
|
</if>
|
||
|
<if test="model != null">#{model},
|
||
|
</if>
|
||
|
<if test="ip != null">#{ip},
|
||
|
</if>
|
||
|
<if test="mac != null">#{mac},
|
||
|
</if>
|
||
|
<if test="version != null">#{version},
|
||
|
</if>
|
||
|
<if test="address != null">#{address},
|
||
|
</if>
|
||
|
<if test="status != null and status != ''">#{status},
|
||
|
</if>
|
||
|
<if test="printerStatus != null">#{printerStatus},
|
||
|
</if>
|
||
|
<if test="havePaperNum != null">#{havePaperNum},
|
||
|
</if>
|
||
|
<if test="password != null and password != ''">#{password},
|
||
|
</if>
|
||
|
<if test="createBy != null">#{createBy},
|
||
|
</if>
|
||
|
<if test="createTime != null">#{createTime},
|
||
|
</if>
|
||
|
<if test="statusTime != null">#{statusTime},
|
||
|
</if>
|
||
|
<if test="printerStatusTime != null">#{printerStatusTime},
|
||
|
</if>
|
||
|
<if test="deptId != null">#{deptId},
|
||
|
</if>
|
||
|
<if test="scenicId != null">#{scenicId},
|
||
|
</if>
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<update id="updateDeviceTicketMachine" parameterType="DeviceTicketMachine">
|
||
|
update zdy_device_ticket_machine
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="name != null">name =
|
||
|
#{name},
|
||
|
</if>
|
||
|
<if test="serialNo != null and serialNo != ''">serial_no =
|
||
|
#{serialNo},
|
||
|
</if>
|
||
|
<if test="model != null">model =
|
||
|
#{model},
|
||
|
</if>
|
||
|
<if test="ip != null">ip =
|
||
|
#{ip},
|
||
|
</if>
|
||
|
<if test="mac != null">mac =
|
||
|
#{mac},
|
||
|
</if>
|
||
|
<if test="version != null">version =
|
||
|
#{version},
|
||
|
</if>
|
||
|
<if test="address != null">address =
|
||
|
#{address},
|
||
|
</if>
|
||
|
<if test="status != null and status != ''">status =
|
||
|
#{status},
|
||
|
</if>
|
||
|
<if test="printerStatus != null">printer_status =
|
||
|
#{printerStatus},
|
||
|
</if>
|
||
|
<if test="havePaperNum != null">have_paper_num =
|
||
|
#{havePaperNum},
|
||
|
</if>
|
||
|
<if test="password != null and password != ''">password =
|
||
|
#{password},
|
||
|
</if>
|
||
|
<if test="createBy != null">create_by =
|
||
|
#{createBy},
|
||
|
</if>
|
||
|
<if test="createTime != null">create_time =
|
||
|
#{createTime},
|
||
|
</if>
|
||
|
<if test="statusTime != null">status_time =
|
||
|
#{statusTime},
|
||
|
</if>
|
||
|
<if test="printerStatusTime != null">printer_status_time =
|
||
|
#{printerStatusTime},
|
||
|
</if>
|
||
|
<if test="deptId != null">dept_id =
|
||
|
#{deptId},
|
||
|
</if>
|
||
|
<if test="scenicId != null">scenic_id =
|
||
|
#{scenicId},
|
||
|
</if>
|
||
|
</trim>
|
||
|
where id = #{id}
|
||
|
</update>
|
||
|
<update id="updateTicketMachineBySerialNo" parameterType="DeviceTicketMachine">
|
||
|
update zdy_device_ticket_machine
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="name != null">name =
|
||
|
#{name},
|
||
|
</if>
|
||
|
<if test="model != null">model =
|
||
|
#{model},
|
||
|
</if>
|
||
|
<if test="ip != null">ip =
|
||
|
#{ip},
|
||
|
</if>
|
||
|
<if test="mac != null">mac =
|
||
|
#{mac},
|
||
|
</if>
|
||
|
<if test="version != null">version =
|
||
|
#{version},
|
||
|
</if>
|
||
|
<if test="address != null">address =
|
||
|
#{address},
|
||
|
</if>
|
||
|
<if test="status != null and status != ''">status =
|
||
|
#{status},
|
||
|
</if>
|
||
|
<if test="printerStatus != null">printer_status =
|
||
|
#{printerStatus},
|
||
|
</if>
|
||
|
<if test="havePaperNum != null">have_paper_num =
|
||
|
#{havePaperNum},
|
||
|
</if>
|
||
|
<if test="password != null and password != ''">password =
|
||
|
#{password},
|
||
|
</if>
|
||
|
<if test="createBy != null">create_by =
|
||
|
#{createBy},
|
||
|
</if>
|
||
|
<if test="createTime != null">create_time =
|
||
|
#{createTime},
|
||
|
</if>
|
||
|
<if test="statusTime != null">status_time =
|
||
|
#{statusTime},
|
||
|
</if>
|
||
|
<if test="printerStatusTime != null">printer_status_time =
|
||
|
#{printerStatusTime},
|
||
|
</if>
|
||
|
<if test="deptId != null">dept_id =
|
||
|
#{deptId},
|
||
|
</if>
|
||
|
<if test="scenicId != null">scenic_id =
|
||
|
#{scenicId},
|
||
|
</if>
|
||
|
</trim>
|
||
|
where serial_no = #{serialNo}
|
||
|
</update>
|
||
|
<update id="updateHavePaperNum">
|
||
|
update zdy_device_ticket_machine
|
||
|
set have_paper_num = have_paper_num - #{ticketNum}
|
||
|
where serial_no = #{serialNo}
|
||
|
</update>
|
||
|
|
||
|
<delete id="deleteDeviceTicketMachineById" parameterType="Long">
|
||
|
delete
|
||
|
from zdy_device_ticket_machine
|
||
|
where id = #{id}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteDeviceTicketMachineByIds" parameterType="String">
|
||
|
delete from zdy_device_ticket_machine where id in
|
||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
#{id}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
</mapper>
|