|
@@ -0,0 +1,102 @@
|
|
|
|
|
+<?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.company.mapper.RechargeRecordMapper">
|
|
|
|
|
+
|
|
|
|
|
+ <resultMap type="RechargeRecord" id="RechargeRecordResult">
|
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
|
|
+ <result property="userName" column="user_name" />
|
|
|
|
|
+ <result property="totalAmount" column="total_amount" />
|
|
|
|
|
+ <result property="transactionId" column="transaction_id" />
|
|
|
|
|
+ <result property="businessType" column="business_type" />
|
|
|
|
|
+ <result property="companyId" column="company_id" />
|
|
|
|
|
+ <result property="companyName" column="company_name" />
|
|
|
|
|
+ <result property="remark" column="remark" />
|
|
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="selectRechargeRecordVo">
|
|
|
|
|
+ select id, user_id, user_name, total_amount, transaction_id, business_type, company_id, company_name, remark, create_by, create_time, update_by, update_time, del_flag from recharge_record
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectRechargeRecordList" parameterType="RechargeRecord" resultMap="RechargeRecordResult">
|
|
|
|
|
+ <include refid="selectRechargeRecordVo"/>
|
|
|
|
|
+ <where>
|
|
|
|
|
+ and del_flag = '0'
|
|
|
|
|
+ <if test="userId != null "> and user_id = #{userId}</if>
|
|
|
|
|
+ <if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
|
|
|
|
+ <if test="transactionId != null and transactionId != ''"> and transaction_id like concat('%', #{transactionId}, '%')</if>
|
|
|
|
|
+ <if test="businessType != null"> and business_type = #{businessType}</if>
|
|
|
|
|
+ <if test="companyId != null"> and company_id = #{companyId}</if>
|
|
|
|
|
+ <if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ order by create_time desc
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectRechargeRecordById" parameterType="Long" resultMap="RechargeRecordResult">
|
|
|
|
|
+ <include refid="selectRechargeRecordVo"/>
|
|
|
|
|
+ where id = #{id}
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <insert id="insertRechargeRecord" parameterType="RechargeRecord" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
+ insert into recharge_record
|
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
|
|
+ <if test="userName != null and userName != ''">user_name,</if>
|
|
|
|
|
+ <if test="totalAmount != null">total_amount,</if>
|
|
|
|
|
+ <if test="transactionId != null and transactionId != ''">transaction_id,</if>
|
|
|
|
|
+ <if test="businessType != null">business_type,</if>
|
|
|
|
|
+ <if test="companyId != null">company_id,</if>
|
|
|
|
|
+ <if test="companyName != null and companyName != ''">company_name,</if>
|
|
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
|
|
+ create_time
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
|
|
+ <if test="userName != null and userName != ''">#{userName},</if>
|
|
|
|
|
+ <if test="totalAmount != null">#{totalAmount},</if>
|
|
|
|
|
+ <if test="transactionId != null and transactionId != ''">#{transactionId},</if>
|
|
|
|
|
+ <if test="businessType != null">#{businessType},</if>
|
|
|
|
|
+ <if test="companyId != null">#{companyId},</if>
|
|
|
|
|
+ <if test="companyName != null and companyName != ''">#{companyName},</if>
|
|
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
|
|
+ sysdate()
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="updateRechargeRecord" parameterType="RechargeRecord">
|
|
|
|
|
+ update recharge_record
|
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
|
|
+ <if test="userName != null and userName != ''">user_name = #{userName},</if>
|
|
|
|
|
+ <if test="totalAmount != null">total_amount = #{totalAmount},</if>
|
|
|
|
|
+ <if test="transactionId != null and transactionId != ''">transaction_id = #{transactionId},</if>
|
|
|
|
|
+ <if test="businessType != null">business_type = #{businessType},</if>
|
|
|
|
|
+ <if test="companyId != null">company_id = #{companyId},</if>
|
|
|
|
|
+ <if test="companyName != null and companyName != ''">company_name = #{companyName},</if>
|
|
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
|
+ update_time = sysdate()
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ where id = #{id}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteRechargeRecordById" parameterType="Long">
|
|
|
|
|
+ update recharge_record set del_flag = '1' where id = #{id}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteRechargeRecordByIds" parameterType="String">
|
|
|
|
|
+ update recharge_record set del_flag = '1' where id in
|
|
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </delete>
|
|
|
|
|
+</mapper>
|