82 lines
3.6 KiB
XML
Raw Normal View History

2024-02-25 11:18:52 +08:00
<?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.ics.admin.mapper.meeting.CustomerTicketMapper">
<resultMap type="com.ics.admin.domain.meeting.CustomerTicket" id="CustomerTicketResult">
<result property="id" column="id" />
<result property="customerId" column="customer_id" />
<result property="ticketId" column="ticket_id" />
2024-03-08 08:33:31 +08:00
<result property="staffId" column="staff_id" />
2024-02-25 11:18:52 +08:00
<result property="num" column="num" />
2024-03-08 08:33:31 +08:00
<result property="type" column="type" />
2024-02-25 11:18:52 +08:00
<result property="isVerification" column="is_verification" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectCustomerTicketVo">
2024-03-08 08:33:31 +08:00
SELECT id, customer_id, ticket_id, num, is_verification, create_time,staff_id,type FROM tb_customer_ticket
2024-02-25 11:18:52 +08:00
</sql>
<select id="selectCustomerTicketList" parameterType="CustomerTicket" resultMap="CustomerTicketResult">
<include refid="selectCustomerTicketVo"/>
<where>
</where>
</select>
<select id="selectCustomerTicketById" parameterType="Long" resultMap="CustomerTicketResult">
<include refid="selectCustomerTicketVo"/>
WHERE id = #{id}
</select>
<insert id="insertCustomerTicket" parameterType="CustomerTicket">
INSERT INTO tb_customer_ticket
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null ">id,</if>
<if test="customerId != null ">customer_id,</if>
<if test="ticketId != null ">ticket_id,</if>
<if test="num != null ">num,</if>
<if test="isVerification != null ">is_verification,</if>
<if test="createTime != null ">create_time,</if>
2024-03-08 08:33:31 +08:00
<if test="staffId != null ">staff_id,</if>
<if test="type != null ">type,</if>
2024-02-25 11:18:52 +08:00
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null ">#{id},</if>
<if test="customerId != null ">#{customerId},</if>
<if test="ticketId != null ">#{ticketId},</if>
<if test="num != null ">#{num},</if>
<if test="isVerification != null ">#{isVerification},</if>
<if test="createTime != null ">#{createTime},</if>
2024-03-08 08:33:31 +08:00
<if test="staffId != null ">#{staffId},</if>
<if test="type != null ">#{type},</if>
2024-02-25 11:18:52 +08:00
</trim>
</insert>
<update id="updateCustomerTicket" parameterType="CustomerTicket">
UPDATE tb_customer_ticket
<trim prefix="SET" suffixOverrides=",">
<if test="customerId != null ">customer_id = #{customerId},</if>
<if test="ticketId != null ">ticket_id = #{ticketId},</if>
<if test="num != null ">num = #{num},</if>
<if test="isVerification != null ">is_verification = #{isVerification},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
2024-03-08 08:33:31 +08:00
<if test="staffId != null ">staff_id = #{staffId},</if>
<if test="type != null ">staff_id = #{type},</if>
2024-02-25 11:18:52 +08:00
</trim>
WHERE id = #{id}
</update>
<delete id="deleteCustomerTicketById" parameterType="Long">
DELETE FROM tb_customer_ticket WHERE id = #{id}
</delete>
<delete id="deleteCustomerTicketByIds" parameterType="String">
DELETE FROM tb_customer_ticket where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>