193 lines
7.2 KiB
XML
193 lines
7.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.zhwl.device.ticket_machine.mapper.DeviceTicketMachineLogMapper">
|
||
|
|
||
|
<resultMap type="DeviceTicketMachineLog" id="DeviceTicketMachineLogResult">
|
||
|
<result property="id" column="id"/>
|
||
|
<result property="name" column="name"/>
|
||
|
<result property="serialNo" column="serial_no"/>
|
||
|
<result property="ticketType" column="ticket_type"/>
|
||
|
<result property="ticketNum" column="ticket_num"/>
|
||
|
<result property="orderCode" column="order_code"/>
|
||
|
<result property="outNum" column="out_num"/>
|
||
|
<result property="verificationCode" column="verification_code"/>
|
||
|
<result property="createTime" column="create_time"/>
|
||
|
<result property="scenicId" column="scenic_id"/>
|
||
|
<result property="scenicName" column="scenic_name"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="selectDeviceTicketMachineLogVo">
|
||
|
select zdtml.id,
|
||
|
zdtml.name,
|
||
|
zdtml.serial_no,
|
||
|
zdtml.ticket_type,
|
||
|
zdtml.ticket_num,
|
||
|
zdtml.order_code,
|
||
|
zdtml.out_num,
|
||
|
zdtml.verification_code,
|
||
|
zdtml.create_time,
|
||
|
zdtml.scenic_id,
|
||
|
zs.scenic_name
|
||
|
from zdy_device_ticket_machine_log zdtml
|
||
|
left join zdy_scenic zs on zs.id = zdtml.scenic_id
|
||
|
</sql>
|
||
|
|
||
|
<select id="selectDeviceTicketMachineLogList" parameterType="DeviceTicketMachineLog" resultMap="DeviceTicketMachineLogResult">
|
||
|
<include refid="selectDeviceTicketMachineLogVo"/>
|
||
|
<where>
|
||
|
<if test="name != null and name != ''">
|
||
|
and zdtml.name like concat('%', #{name}, '%')
|
||
|
</if>
|
||
|
<if test="serialNo != null and serialNo != ''">
|
||
|
and zdtml.serial_no like concat('%', #{serialNo}, '%')
|
||
|
</if>
|
||
|
<if test="ticketType != null and ticketType != ''">
|
||
|
and zdtml.ticket_type = #{ticketType}
|
||
|
</if>
|
||
|
<if test="ticketNum != null ">
|
||
|
and zdtml.ticket_num = #{ticketNum}
|
||
|
</if>
|
||
|
<if test="orderCode != null and orderCode != ''">
|
||
|
and zdtml.order_code = #{orderCode}
|
||
|
</if>
|
||
|
<if test="outNum != null ">
|
||
|
and zdtml.out_num = #{outNum}
|
||
|
</if>
|
||
|
<if test="verificationCode != null and verificationCode != ''">
|
||
|
and zdtml.verification_code = #{verificationCode}
|
||
|
</if>
|
||
|
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
|
||
|
and zdtml.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
||
|
</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="selectDeviceTicketMachineLogById" parameterType="Long"
|
||
|
resultMap="DeviceTicketMachineLogResult">
|
||
|
<include refid="selectDeviceTicketMachineLogVo"/>
|
||
|
where zdtml.id = #{id}
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertDeviceTicketMachineLog" parameterType="DeviceTicketMachineLog" useGeneratedKeys="true"
|
||
|
keyProperty="id">
|
||
|
insert into zdy_device_ticket_machine_log
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="name != null">name,
|
||
|
</if>
|
||
|
<if test="serialNo != null">serial_no,
|
||
|
</if>
|
||
|
<if test="ticketType != null">ticket_type,
|
||
|
</if>
|
||
|
<if test="ticketNum != null">ticket_num,
|
||
|
</if>
|
||
|
<if test="orderCode != null">order_code,
|
||
|
</if>
|
||
|
<if test="outNum != null">out_num,
|
||
|
</if>
|
||
|
<if test="verificationCode != null">verification_code,
|
||
|
</if>
|
||
|
<if test="createTime != null">create_time,
|
||
|
</if>
|
||
|
<if test="scenicId != null">scenic_id,
|
||
|
</if>
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="name != null">#{name},
|
||
|
</if>
|
||
|
<if test="serialNo != null">#{serialNo},
|
||
|
</if>
|
||
|
<if test="ticketType != null">#{ticketType},
|
||
|
</if>
|
||
|
<if test="ticketNum != null">#{ticketNum},
|
||
|
</if>
|
||
|
<if test="orderCode != null">#{orderCode},
|
||
|
</if>
|
||
|
<if test="outNum != null">#{outNum},
|
||
|
</if>
|
||
|
<if test="verificationCode != null">#{verificationCode},
|
||
|
</if>
|
||
|
<if test="createTime != null">#{createTime},
|
||
|
</if>
|
||
|
<if test="scenicId != null">#{scenicId},
|
||
|
</if>
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<update id="updateDeviceTicketMachineLog" parameterType="DeviceTicketMachineLog">
|
||
|
update zdy_device_ticket_machine_log
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="name != null">name =
|
||
|
#{name},
|
||
|
</if>
|
||
|
<if test="serialNo != null">serial_no =
|
||
|
#{serialNo},
|
||
|
</if>
|
||
|
<if test="ticketType != null">ticket_type =
|
||
|
#{ticketType},
|
||
|
</if>
|
||
|
<if test="ticketNum != null">ticket_num =
|
||
|
#{ticketNum},
|
||
|
</if>
|
||
|
<if test="orderCode != null">order_code =
|
||
|
#{orderCode},
|
||
|
</if>
|
||
|
<if test="outNum != null">out_num =
|
||
|
#{outNum},
|
||
|
</if>
|
||
|
<if test="verificationCode != null">verification_code =
|
||
|
#{verificationCode},
|
||
|
</if>
|
||
|
<if test="createTime != null">create_time =
|
||
|
#{createTime},
|
||
|
</if>
|
||
|
<if test="scenicId != null">scenic_id =
|
||
|
#{scenicId},
|
||
|
</if>
|
||
|
</trim>
|
||
|
where id = #{id}
|
||
|
</update>
|
||
|
<update id="updateNameBySerialNo">
|
||
|
update zdy_device_ticket_machine_log
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="name != null">name =
|
||
|
#{name},
|
||
|
</if>
|
||
|
<if test="ticketType != null">ticket_type =
|
||
|
#{ticketType},
|
||
|
</if>
|
||
|
<if test="ticketNum != null">ticket_num =
|
||
|
#{ticketNum},
|
||
|
</if>
|
||
|
<if test="orderCode != null">order_code =
|
||
|
#{orderCode},
|
||
|
</if>
|
||
|
<if test="outNum != null">out_num =
|
||
|
#{outNum},
|
||
|
</if>
|
||
|
<if test="verificationCode != null">verification_code =
|
||
|
#{verificationCode},
|
||
|
</if>
|
||
|
<if test="createTime != null">create_time =
|
||
|
#{createTime},
|
||
|
</if>
|
||
|
<if test="scenicId != null">scenic_id =
|
||
|
#{scenicId},
|
||
|
</if>
|
||
|
</trim>
|
||
|
where serial_no = #{serialNo}
|
||
|
</update>
|
||
|
|
||
|
<delete id="deleteDeviceTicketMachineLogById" parameterType="Long">
|
||
|
delete from zdy_device_ticket_machine_log where id = #{id}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteDeviceTicketMachineLogByIds" parameterType="String">
|
||
|
delete from zdy_device_ticket_machine_log where id in
|
||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||
|
#{id}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
</mapper>
|