208 lines
13 KiB
XML
208 lines
13 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.bonus.canteen.core.account.mapper.AccTradeMapper">
|
|
<resultMap type="com.bonus.canteen.core.account.domain.AccTrade" id="AccTradeResult">
|
|
<result property="tradeId" column="trade_id" />
|
|
<result property="tradeTime" column="trade_time" />
|
|
<result property="userId" column="user_id" />
|
|
<result property="deptId" column="dept_id" />
|
|
<result property="tradeType" column="trade_type" />
|
|
<result property="actualAmount" column="actual_amount" />
|
|
<result property="amount" column="amount" />
|
|
<result property="walletBalTotal" column="wallet_bal_total" />
|
|
<result property="accAllBal" column="acc_all_bal" />
|
|
<result property="payChannel" column="pay_channel" />
|
|
<result property="payType" column="pay_type" />
|
|
<result property="payState" column="pay_state" />
|
|
<result property="tradeState" column="trade_state" />
|
|
<result property="thirdTradeNo" column="third_trade_no" />
|
|
<result property="machineSn" column="machine_sn" />
|
|
<result property="batchNum" column="batch_num" />
|
|
<result property="leOrdNo" column="le_ord_no" />
|
|
<result property="originTradeId" column="origin_trade_id" />
|
|
<result property="subTimeRuleId" column="sub_time_rule_id" />
|
|
<result property="manageCost" column="manage_cost" />
|
|
<result property="withdrawSource" column="withdraw_source" />
|
|
<result property="rechargeSource" column="recharge_source" />
|
|
<result property="canteenId" column="canteen_id" />
|
|
<result property="machineType" column="machine_type" />
|
|
<result property="failReason" column="fail_reason" />
|
|
<result property="rechargeOperate" column="recharge_operate" />
|
|
<result property="psnType" column="psn_type" />
|
|
<result property="operateSource" column="operate_source" />
|
|
<result property="batchImportId" column="batch_import_id" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
</resultMap>
|
|
|
|
<sql id="selectAccTradeVo">
|
|
select trade_id, trade_time, user_id, dept_id, trade_type, actual_amount, amount, wallet_bal_total, acc_all_bal, pay_channel, pay_type, pay_state, trade_state, third_trade_no, machine_sn, batch_num, le_ord_no, origin_trade_id, sub_time_rule_id, manage_cost, withdraw_source, recharge_source, canteen_id, machine_type, fail_reason, recharge_operate, psn_type, operate_source, batch_import_id, create_by, create_time, update_by, update_time from acc_trade
|
|
</sql>
|
|
|
|
<select id="selectAccTradeList" parameterType="com.bonus.canteen.core.account.domain.AccTrade" resultMap="AccTradeResult">
|
|
<include refid="selectAccTradeVo"/>
|
|
<where>
|
|
<if test="tradeTime != null "> and trade_time = #{tradeTime}</if>
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
|
<if test="tradeType != null "> and trade_type = #{tradeType}</if>
|
|
<if test="actualAmount != null "> and actual_amount = #{actualAmount}</if>
|
|
<if test="amount != null "> and amount = #{amount}</if>
|
|
<if test="walletBalTotal != null "> and wallet_bal_total = #{walletBalTotal}</if>
|
|
<if test="accAllBal != null "> and acc_all_bal = #{accAllBal}</if>
|
|
<if test="payChannel != null "> and pay_channel = #{payChannel}</if>
|
|
<if test="payType != null "> and pay_type = #{payType}</if>
|
|
<if test="payState != null "> and pay_state = #{payState}</if>
|
|
<if test="tradeState != null "> and trade_state = #{tradeState}</if>
|
|
<if test="thirdTradeNo != null and thirdTradeNo != ''"> and third_trade_no = #{thirdTradeNo}</if>
|
|
<if test="machineSn != null and machineSn != ''"> and machine_sn = #{machineSn}</if>
|
|
<if test="batchNum != null and batchNum != ''"> and batch_num = #{batchNum}</if>
|
|
<if test="leOrdNo != null "> and le_ord_no = #{leOrdNo}</if>
|
|
<if test="originTradeId != null "> and origin_trade_id = #{originTradeId}</if>
|
|
<if test="subTimeRuleId != null "> and sub_time_rule_id = #{subTimeRuleId}</if>
|
|
<if test="manageCost != null "> and manage_cost = #{manageCost}</if>
|
|
<if test="withdrawSource != null "> and withdraw_source = #{withdrawSource}</if>
|
|
<if test="rechargeSource != null "> and recharge_source = #{rechargeSource}</if>
|
|
<if test="canteenId != null "> and canteen_id = #{canteenId}</if>
|
|
<if test="machineType != null "> and machine_type = #{machineType}</if>
|
|
<if test="failReason != null and failReason != ''"> and fail_reason = #{failReason}</if>
|
|
<if test="rechargeOperate != null "> and recharge_operate = #{rechargeOperate}</if>
|
|
<if test="psnType != null "> and psn_type = #{psnType}</if>
|
|
<if test="operateSource != null "> and operate_source = #{operateSource}</if>
|
|
<if test="batchImportId != null "> and batch_import_id = #{batchImportId}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectAccTradeByTradeId" parameterType="Long" resultMap="AccTradeResult">
|
|
<include refid="selectAccTradeVo"/>
|
|
where trade_id = #{tradeId}
|
|
</select>
|
|
|
|
<insert id="insertAccTrade" parameterType="com.bonus.canteen.core.account.domain.AccTrade">
|
|
insert into acc_trade
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="tradeId != null">trade_id,</if>
|
|
<if test="tradeTime != null">trade_time,</if>
|
|
<if test="userId != null">user_id,</if>
|
|
<if test="deptId != null">dept_id,</if>
|
|
<if test="tradeType != null">trade_type,</if>
|
|
<if test="actualAmount != null">actual_amount,</if>
|
|
<if test="amount != null">amount,</if>
|
|
<if test="walletBalTotal != null">wallet_bal_total,</if>
|
|
<if test="accAllBal != null">acc_all_bal,</if>
|
|
<if test="payChannel != null">pay_channel,</if>
|
|
<if test="payType != null">pay_type,</if>
|
|
<if test="payState != null">pay_state,</if>
|
|
<if test="tradeState != null">trade_state,</if>
|
|
<if test="thirdTradeNo != null">third_trade_no,</if>
|
|
<if test="machineSn != null">machine_sn,</if>
|
|
<if test="batchNum != null">batch_num,</if>
|
|
<if test="leOrdNo != null">le_ord_no,</if>
|
|
<if test="originTradeId != null">origin_trade_id,</if>
|
|
<if test="subTimeRuleId != null">sub_time_rule_id,</if>
|
|
<if test="manageCost != null">manage_cost,</if>
|
|
<if test="withdrawSource != null">withdraw_source,</if>
|
|
<if test="rechargeSource != null">recharge_source,</if>
|
|
<if test="canteenId != null">canteen_id,</if>
|
|
<if test="machineType != null">machine_type,</if>
|
|
<if test="failReason != null">fail_reason,</if>
|
|
<if test="rechargeOperate != null">recharge_operate,</if>
|
|
<if test="psnType != null">psn_type,</if>
|
|
<if test="operateSource != null">operate_source,</if>
|
|
<if test="batchImportId != null">batch_import_id,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="tradeId != null">#{tradeId},</if>
|
|
<if test="tradeTime != null">#{tradeTime},</if>
|
|
<if test="userId != null">#{userId},</if>
|
|
<if test="deptId != null">#{deptId},</if>
|
|
<if test="tradeType != null">#{tradeType},</if>
|
|
<if test="actualAmount != null">#{actualAmount},</if>
|
|
<if test="amount != null">#{amount},</if>
|
|
<if test="walletBalTotal != null">#{walletBalTotal},</if>
|
|
<if test="accAllBal != null">#{accAllBal},</if>
|
|
<if test="payChannel != null">#{payChannel},</if>
|
|
<if test="payType != null">#{payType},</if>
|
|
<if test="payState != null">#{payState},</if>
|
|
<if test="tradeState != null">#{tradeState},</if>
|
|
<if test="thirdTradeNo != null">#{thirdTradeNo},</if>
|
|
<if test="machineSn != null">#{machineSn},</if>
|
|
<if test="batchNum != null">#{batchNum},</if>
|
|
<if test="leOrdNo != null">#{leOrdNo},</if>
|
|
<if test="originTradeId != null">#{originTradeId},</if>
|
|
<if test="subTimeRuleId != null">#{subTimeRuleId},</if>
|
|
<if test="manageCost != null">#{manageCost},</if>
|
|
<if test="withdrawSource != null">#{withdrawSource},</if>
|
|
<if test="rechargeSource != null">#{rechargeSource},</if>
|
|
<if test="canteenId != null">#{canteenId},</if>
|
|
<if test="machineType != null">#{machineType},</if>
|
|
<if test="failReason != null">#{failReason},</if>
|
|
<if test="rechargeOperate != null">#{rechargeOperate},</if>
|
|
<if test="psnType != null">#{psnType},</if>
|
|
<if test="operateSource != null">#{operateSource},</if>
|
|
<if test="batchImportId != null">#{batchImportId},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateAccTrade" parameterType="com.bonus.canteen.core.account.domain.AccTrade">
|
|
update acc_trade
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="tradeTime != null">trade_time = #{tradeTime},</if>
|
|
<if test="userId != null">user_id = #{userId},</if>
|
|
<if test="deptId != null">dept_id = #{deptId},</if>
|
|
<if test="tradeType != null">trade_type = #{tradeType},</if>
|
|
<if test="actualAmount != null">actual_amount = #{actualAmount},</if>
|
|
<if test="amount != null">amount = #{amount},</if>
|
|
<if test="walletBalTotal != null">wallet_bal_total = #{walletBalTotal},</if>
|
|
<if test="accAllBal != null">acc_all_bal = #{accAllBal},</if>
|
|
<if test="payChannel != null">pay_channel = #{payChannel},</if>
|
|
<if test="payType != null">pay_type = #{payType},</if>
|
|
<if test="payState != null">pay_state = #{payState},</if>
|
|
<if test="tradeState != null">trade_state = #{tradeState},</if>
|
|
<if test="thirdTradeNo != null">third_trade_no = #{thirdTradeNo},</if>
|
|
<if test="machineSn != null">machine_sn = #{machineSn},</if>
|
|
<if test="batchNum != null">batch_num = #{batchNum},</if>
|
|
<if test="leOrdNo != null">le_ord_no = #{leOrdNo},</if>
|
|
<if test="originTradeId != null">origin_trade_id = #{originTradeId},</if>
|
|
<if test="subTimeRuleId != null">sub_time_rule_id = #{subTimeRuleId},</if>
|
|
<if test="manageCost != null">manage_cost = #{manageCost},</if>
|
|
<if test="withdrawSource != null">withdraw_source = #{withdrawSource},</if>
|
|
<if test="rechargeSource != null">recharge_source = #{rechargeSource},</if>
|
|
<if test="canteenId != null">canteen_id = #{canteenId},</if>
|
|
<if test="machineType != null">machine_type = #{machineType},</if>
|
|
<if test="failReason != null">fail_reason = #{failReason},</if>
|
|
<if test="rechargeOperate != null">recharge_operate = #{rechargeOperate},</if>
|
|
<if test="psnType != null">psn_type = #{psnType},</if>
|
|
<if test="operateSource != null">operate_source = #{operateSource},</if>
|
|
<if test="batchImportId != null">batch_import_id = #{batchImportId},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
</trim>
|
|
where trade_id = #{tradeId}
|
|
</update>
|
|
|
|
<delete id="deleteAccTradeByTradeId" parameterType="Long">
|
|
delete from acc_trade where trade_id = #{tradeId}
|
|
</delete>
|
|
|
|
<delete id="deleteAccTradeByTradeIds" parameterType="String">
|
|
delete from acc_trade where trade_id in
|
|
<foreach item="tradeId" collection="array" open="(" separator="," close=")">
|
|
#{tradeId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |