electripper/electripper-system/src/main/resources/mapper/system/EtCapitalFlowMapper.xml
2024-05-24 14:45:28 +08:00

112 lines
6.0 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.ruoyi.system.mapper.EtCapitalFlowMapper">
<resultMap type="EtCapitalFlow" id="EtCapitalFlowResult">
<result property="flowId" column="flow_id" />
<result property="areaId" column="area_id" />
<result property="orderNo" column="order_no" />
<result property="outTradeNo" column="out_trade_no" />
<result property="type" column="type" />
<result property="busType" column="bus_type" />
<result property="amount" column="amount" />
<result property="handlingCharge" column="handling_charge" />
<result property="operatorDividend" column="operator_dividend" />
<result property="operatorBalance" column="operator_balance" />
<result property="partnerDividend" column="partner_dividend" />
<result property="payType" column="pay_type" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectEtCapitalFlowVo">
select flow_id, area_id, order_no, out_trade_no, type, bus_type, amount, handling_charge, operator_dividend, operator_balance, partner_dividend, pay_type, create_time from et_capital_flow
</sql>
<select id="selectEtCapitalFlowList" parameterType="EtCapitalFlow" resultMap="EtCapitalFlowResult">
<include refid="selectEtCapitalFlowVo"/>
<where>
<if test="areaId != null "> and area_id = #{areaId}</if>
<if test="orderNo != null and orderNo != ''"> and order_no = #{orderNo}</if>
<if test="outTradeNo != null and outTradeNo != ''"> and out_trade_no = #{outTradeNo}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="busType != null and busType != ''"> and bus_type = #{busType}</if>
<if test="amount != null "> and amount = #{amount}</if>
<if test="handlingCharge != null "> and handling_charge = #{handlingCharge}</if>
<if test="operatorDividend != null "> and operator_dividend = #{operatorDividend}</if>
<if test="operatorBalance != null "> and operator_balance = #{operatorBalance}</if>
<if test="partnerDividend != null "> and partner_dividend = #{partnerDividend}</if>
<if test="payType != null and payType != ''"> and pay_type = #{payType}</if>
</where>
</select>
<select id="selectEtCapitalFlowByFlowId" parameterType="Long" resultMap="EtCapitalFlowResult">
<include refid="selectEtCapitalFlowVo"/>
where flow_id = #{flowId}
</select>
<insert id="insertEtCapitalFlow" parameterType="EtCapitalFlow">
insert into et_capital_flow
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="flowId != null">flow_id,</if>
<if test="areaId != null">area_id,</if>
<if test="orderNo != null">order_no,</if>
<if test="outTradeNo != null">out_trade_no,</if>
<if test="type != null">type,</if>
<if test="busType != null">bus_type,</if>
<if test="amount != null">amount,</if>
<if test="handlingCharge != null">handling_charge,</if>
<if test="operatorDividend != null">operator_dividend,</if>
<if test="operatorBalance != null">operator_balance,</if>
<if test="partnerDividend != null">partner_dividend,</if>
<if test="payType != null">pay_type,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="flowId != null">#{flowId},</if>
<if test="areaId != null">#{areaId},</if>
<if test="orderNo != null">#{orderNo},</if>
<if test="outTradeNo != null">#{outTradeNo},</if>
<if test="type != null">#{type},</if>
<if test="busType != null">#{busType},</if>
<if test="amount != null">#{amount},</if>
<if test="handlingCharge != null">#{handlingCharge},</if>
<if test="operatorDividend != null">#{operatorDividend},</if>
<if test="operatorBalance != null">#{operatorBalance},</if>
<if test="partnerDividend != null">#{partnerDividend},</if>
<if test="payType != null">#{payType},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateEtCapitalFlow" parameterType="EtCapitalFlow">
update et_capital_flow
<trim prefix="SET" suffixOverrides=",">
<if test="areaId != null">area_id = #{areaId},</if>
<if test="orderNo != null">order_no = #{orderNo},</if>
<if test="outTradeNo != null">out_trade_no = #{outTradeNo},</if>
<if test="type != null">type = #{type},</if>
<if test="busType != null">bus_type = #{busType},</if>
<if test="amount != null">amount = #{amount},</if>
<if test="handlingCharge != null">handling_charge = #{handlingCharge},</if>
<if test="operatorDividend != null">operator_dividend = #{operatorDividend},</if>
<if test="operatorBalance != null">operator_balance = #{operatorBalance},</if>
<if test="partnerDividend != null">partner_dividend = #{partnerDividend},</if>
<if test="payType != null">pay_type = #{payType},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where flow_id = #{flowId}
</update>
<delete id="deleteEtCapitalFlowByFlowId" parameterType="Long">
delete from et_capital_flow where flow_id = #{flowId}
</delete>
<delete id="deleteEtCapitalFlowByFlowIds" parameterType="String">
delete from et_capital_flow where flow_id in
<foreach item="flowId" collection="array" open="(" separator="," close=")">
#{flowId}
</foreach>
</delete>
</mapper>