|
@@ -0,0 +1,129 @@
|
|
|
+<?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.songhua.system.mapper.PzRawDataMapper">
|
|
|
+
|
|
|
+ <resultMap type="PzRawData" id="PzRawDataResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="number" column="number" />
|
|
|
+ <result property="money" column="money" />
|
|
|
+ <result property="payType" column="pay_type" />
|
|
|
+ <result property="ticketId" column="ticket_id" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <resultMap type="PzRawDataVo" id="PzRawDataVoResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="ticketName" column="ticket_name" />
|
|
|
+ <result property="number" column="number" />
|
|
|
+ <result property="money" column="money" />
|
|
|
+ <result property="payType" column="pay_type" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="ticketId" column="ticket_id" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectPzRawDataVo">
|
|
|
+ select id, number, money, pay_type, create_time,ticket_id from pz_raw_data
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectPzRawDataList" parameterType="PzRawDataVo" resultMap="PzRawDataVoResult">
|
|
|
+ SELECT
|
|
|
+ a.id,
|
|
|
+ a.number,
|
|
|
+ a.money,
|
|
|
+ a.pay_type,
|
|
|
+ a.create_time,
|
|
|
+ a.ticket_id,
|
|
|
+ b.ticket_name
|
|
|
+ FROM
|
|
|
+ pz_raw_data a
|
|
|
+ LEFT JOIN pz_ticket_type_management b ON a.ticket_id = b.id
|
|
|
+ <where>
|
|
|
+ <if test="number != null "> and number = #{number}</if>
|
|
|
+ <if test="money != null and money != ''"> and money = #{money}</if>
|
|
|
+ <if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectPzRawDataById" parameterType="Long" resultMap="PzRawDataResult">
|
|
|
+ <include refid="selectPzRawDataVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertPzRawData" parameterType="PzRawData" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into pz_raw_data
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="number != null">number,</if>
|
|
|
+ <if test="money != null">money,</if>
|
|
|
+ <if test="payType != null">pay_type,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="number != null">#{number},</if>
|
|
|
+ <if test="money != null">#{money},</if>
|
|
|
+ <if test="payType != null">#{payType},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertPzRawDataVo" parameterType="PzRawDataVo" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into pz_raw_data
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="number != null">number,</if>
|
|
|
+ <if test="ticketId != null">ticket_id,</if>
|
|
|
+ <if test="money != null">money,</if>
|
|
|
+ <if test="payType != null">pay_type,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="number != null">#{number},</if>
|
|
|
+ <if test="ticketId != null">#{ticketId},</if>
|
|
|
+ <if test="money != null">#{money},</if>
|
|
|
+ <if test="payType != null">#{payType},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updatePzRawData" parameterType="PzRawData">
|
|
|
+ update pz_raw_data
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="number != null">number = #{number},</if>
|
|
|
+ <if test="money != null">money = #{money},</if>
|
|
|
+ <if test="payType != null">pay_type = #{payType},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="updatePzRawDataVo" parameterType="PzRawDataVo">
|
|
|
+ update pz_raw_data
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="number != null">number = #{number},</if>
|
|
|
+ <if test="ticketId != null">ticket_id = #{ticketId},</if>
|
|
|
+ <if test="money != null">money = #{money},</if>
|
|
|
+ <if test="payType != null">pay_type = #{payType},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deletePzRawDataById" parameterType="Long">
|
|
|
+ delete from pz_raw_data where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deletePzRawDataByIds" parameterType="String">
|
|
|
+ delete from pz_raw_data where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <select id="checkIfDataExists" parameterType="PzRawDataVo" resultMap="PzRawDataVoResult">
|
|
|
+ SELECT
|
|
|
+ id
|
|
|
+ FROM
|
|
|
+ pz_ticket_type_management where ticket_name = #{ticketName}
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|