63 lines
2.4 KiB
XML
63 lines
2.4 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.sales.point.mapper.ZdySalesPointTicketMachineMapper">
|
||
|
|
||
|
<resultMap type="ZdySalesPointTicketMachine" id="ZdySalesPointTicketMachineResult">
|
||
|
<result property="salesPointId" column="sales_point_id"/>
|
||
|
<result property="ticketMachineId" column="ticket_machine_id"/>
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="selectZdySalesPointTicketMachineVo">
|
||
|
select sales_point_id, ticket_machine_id
|
||
|
from zdy_sales_point_ticket_machine
|
||
|
</sql>
|
||
|
|
||
|
<select id="listTicketMachineIdsBySalesPointId" parameterType="Long" resultType="Long">
|
||
|
select ticket_machine_id
|
||
|
from zdy_sales_point_ticket_machine
|
||
|
where sales_point_id = #{salesPointId}
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertZdySalesPointTicketMachine" parameterType="ZdySalesPointTicketMachine">
|
||
|
insert into zdy_sales_point_ticket_machine
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="salesPointId != null">sales_point_id,
|
||
|
</if>
|
||
|
<if test="ticketMachineId != null">ticket_machine_id,
|
||
|
</if>
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="salesPointId != null">#{salesPointId},
|
||
|
</if>
|
||
|
<if test="ticketMachineId != null">#{ticketMachineId},
|
||
|
</if>
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<delete id="deleteBySalesPointIdAndTicketMachineIds">
|
||
|
delete from zdy_sales_point_ticket_machine where sales_point_id = #{salesPointId} and ticket_machine_id in
|
||
|
<foreach item="ticketMachineId" collection="ticketMachineIds" open="(" separator="," close=")">
|
||
|
#{ticketMachineId}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteBySalesPointIds">
|
||
|
delete from zdy_sales_point_ticket_machine
|
||
|
where
|
||
|
sales_point_id in
|
||
|
<foreach item="salesPointId" collection="array" open="(" separator="," close=")">
|
||
|
#{salesPointId}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
|
||
|
<select id="listTicketMachineIdsExcludingSalesPoint" parameterType="Long" resultType="Long">
|
||
|
select ticket_machine_id
|
||
|
from zdy_sales_point_ticket_machine
|
||
|
<where>
|
||
|
<if test="salesPointId != null">sales_point_id != #{salesPointId}</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
</mapper>
|