|
@@ -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.fs.qw.mapper.BindPhoneRedPacketRecordMapper">
|
|
|
|
|
+
|
|
|
|
|
+ <resultMap type="BindPhoneRedPacketRecord" id="BindPhoneRedPacketRecordResult">
|
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
|
|
+ <result property="userName" column="user_name" />
|
|
|
|
|
+ <result property="redPacketId" column="red_packet_id" />
|
|
|
|
|
+ <result property="companyUserId" column="company_user_id" />
|
|
|
|
|
+ <result property="companyId" column="company_id" />
|
|
|
|
|
+ <result property="companyName" column="company_name" />
|
|
|
|
|
+ <result property="amount" column="amount" />
|
|
|
|
|
+ <result property="sendTime" column="send_time" />
|
|
|
|
|
+ <result property="collectTime" column="collect_time" />
|
|
|
|
|
+ <result property="collectType" column="collect_type" />
|
|
|
|
|
+ <result property="sendLink" column="send_link" />
|
|
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
|
|
+ <result property="qwUserId" column="qw_user_id" />
|
|
|
|
|
+ <result property="qwUserName" column="qw_user_name" />
|
|
|
|
|
+ <result property="phone" column="phone" />
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="selectBindPhoneRedPacketRecordVo">
|
|
|
|
|
+ select id, user_id, user_name, red_packet_id, company_user_id, company_id, company_name, amount, send_time, collect_time, collect_type, send_link, update_time, create_time, qw_user_id, qw_user_name, phone from bind_phone_red_packet_record
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectBindPhoneRedPacketRecordList" parameterType="BindPhoneRedPacketRecord" resultMap="BindPhoneRedPacketRecordResult">
|
|
|
|
|
+ <include refid="selectBindPhoneRedPacketRecordVo"/>
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
|
|
+ <if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
|
|
|
|
+ <if test="redPacketId != null "> and red_packet_id = #{redPacketId}</if>
|
|
|
|
|
+ <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
|
|
|
|
|
+ <if test="companyId != null "> and company_id = #{companyId}</if>
|
|
|
|
|
+ <if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
|
|
|
|
|
+ <if test="amount != null "> and amount = #{amount}</if>
|
|
|
|
|
+ <if test="sendTime != null "> and send_time = #{sendTime}</if>
|
|
|
|
|
+ <if test="collectTime != null "> and collect_time = #{collectTime}</if>
|
|
|
|
|
+ <if test="collectType != null and collectType != ''"> and collect_type = #{collectType}</if>
|
|
|
|
|
+ <if test="sendLink != null and sendLink != ''"> and send_link = #{sendLink}</if>
|
|
|
|
|
+ <if test="qwUserId != null and qwUserId != ''"> and qw_user_id = #{qwUserId}</if>
|
|
|
|
|
+ <if test="qwUserName != null and qwUserName != ''"> and qw_user_name like concat('%', #{qwUserName}, '%')</if>
|
|
|
|
|
+ <if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectBindPhoneRedPacketRecordById" parameterType="Long" resultMap="BindPhoneRedPacketRecordResult">
|
|
|
|
|
+ <include refid="selectBindPhoneRedPacketRecordVo"/>
|
|
|
|
|
+ where id = #{id}
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <insert id="insertBindPhoneRedPacketRecord" parameterType="BindPhoneRedPacketRecord" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
+ insert into bind_phone_red_packet_record
|
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
|
|
+ <if test="userName != null">user_name,</if>
|
|
|
|
|
+ <if test="redPacketId != null">red_packet_id,</if>
|
|
|
|
|
+ <if test="companyUserId != null">company_user_id,</if>
|
|
|
|
|
+ <if test="companyId != null">company_id,</if>
|
|
|
|
|
+ <if test="companyName != null">company_name,</if>
|
|
|
|
|
+ <if test="amount != null">amount,</if>
|
|
|
|
|
+ <if test="sendTime != null">send_time,</if>
|
|
|
|
|
+ <if test="collectTime != null">collect_time,</if>
|
|
|
|
|
+ <if test="collectType != null">collect_type,</if>
|
|
|
|
|
+ <if test="sendLink != null">send_link,</if>
|
|
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
|
+ <if test="qwUserId != null">qw_user_id,</if>
|
|
|
|
|
+ <if test="qwUserName != null">qw_user_name,</if>
|
|
|
|
|
+ <if test="phone != null">phone,</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
|
|
+ <if test="userName != null">#{userName},</if>
|
|
|
|
|
+ <if test="redPacketId != null">#{redPacketId},</if>
|
|
|
|
|
+ <if test="companyUserId != null">#{companyUserId},</if>
|
|
|
|
|
+ <if test="companyId != null">#{companyId},</if>
|
|
|
|
|
+ <if test="companyName != null">#{companyName},</if>
|
|
|
|
|
+ <if test="amount != null">#{amount},</if>
|
|
|
|
|
+ <if test="sendTime != null">#{sendTime},</if>
|
|
|
|
|
+ <if test="collectTime != null">#{collectTime},</if>
|
|
|
|
|
+ <if test="collectType != null">#{collectType},</if>
|
|
|
|
|
+ <if test="sendLink != null">#{sendLink},</if>
|
|
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
|
+ <if test="qwUserId != null">#{qwUserId},</if>
|
|
|
|
|
+ <if test="qwUserName != null">#{qwUserName},</if>
|
|
|
|
|
+ <if test="phone != null">#{phone},</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="updateBindPhoneRedPacketRecord" parameterType="BindPhoneRedPacketRecord">
|
|
|
|
|
+ update bind_phone_red_packet_record
|
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
|
|
+ <if test="userName != null">user_name = #{userName},</if>
|
|
|
|
|
+ <if test="redPacketId != null">red_packet_id = #{redPacketId},</if>
|
|
|
|
|
+ <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
|
|
|
|
|
+ <if test="companyId != null">company_id = #{companyId},</if>
|
|
|
|
|
+ <if test="companyName != null">company_name = #{companyName},</if>
|
|
|
|
|
+ <if test="amount != null">amount = #{amount},</if>
|
|
|
|
|
+ <if test="sendTime != null">send_time = #{sendTime},</if>
|
|
|
|
|
+ <if test="collectTime != null">collect_time = #{collectTime},</if>
|
|
|
|
|
+ <if test="collectType != null">collect_type = #{collectType},</if>
|
|
|
|
|
+ <if test="sendLink != null">send_link = #{sendLink},</if>
|
|
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
+ <if test="qwUserId != null">qw_user_id = #{qwUserId},</if>
|
|
|
|
|
+ <if test="qwUserName != null">qw_user_name = #{qwUserName},</if>
|
|
|
|
|
+ <if test="phone != null">phone = #{phone},</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ where id = #{id}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteBindPhoneRedPacketRecordById" parameterType="Long">
|
|
|
|
|
+ delete from bind_phone_red_packet_record where id = #{id}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteBindPhoneRedPacketRecordByIds" parameterType="String">
|
|
|
|
|
+ delete from bind_phone_red_packet_record where id in
|
|
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </delete>
|
|
|
|
|
+</mapper>
|