electripper/electripper-system/src/main/resources/mapper/system/EtCapitalFlowMapper.xml
18650502300 e1df5bacc9 1.提现功能改造
2.换车
3.无订单且非管理员控制情况下关锁
4.增加命令的操作人
5.增加gps、最后定位时间
6.一键出仓、一键入仓
2024-07-17 09:34:09 +08:00

172 lines
8.8 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="owner" column="owner" />
<result property="ownerId" column="owner_id" />
<result property="ownerType" column="owner_type" />
<result property="areaName" column="area_name" />
<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="status" column="status" />
<result property="amount" column="amount" />
<result property="handlingCharge" column="handling_charge" />
<result property="platformServiceFee" column="platform_service_fee" />
<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, owner, owner_id, owner_type, order_no, out_trade_no, type, bus_type, status, amount, handling_charge, platform_service_fee, operator_dividend, operator_balance, partner_dividend, pay_type, create_time from et_capital_flow
</sql>
<select id="selectEtCapitalFlowList" parameterType="EtCapitalFlow" resultMap="EtCapitalFlowResult">
SELECT
cf.flow_id,
cf.area_id,
cf.owner,
cf.owner_id,
cf.owner_type,
cf.order_no,
cf.out_trade_no,
cf.type,
cf.bus_type,
cf.status,
cf.amount,
cf.handling_charge,
cf.platform_service_fee,
cf.operator_dividend,
cf.operator_balance,
cf.partner_dividend,
cf.pay_type,
cf.create_time,
a.area_name
FROM
et_capital_flow cf
LEFT JOIN et_operating_area a ON a.area_id = cf.area_id
LEFT JOIN et_area_dept ad ON ad.area_id = cf.area_id
LEFT JOIN sys_dept d ON d.dept_id = ad.dept_id
WHERE
1 = 1
<if test="areaId != null "> and cf.area_id = #{areaId}</if>
<if test="orderNo != null and orderNo != ''"> and cf.order_no = #{orderNo}</if>
<if test="outTradeNo != null and outTradeNo != ''"> and cf.out_trade_no = #{outTradeNo}</if>
<if test="type != null and type != ''"> and cf.type = #{type}</if>
<if test="busType != null and busType != ''"> and cf.bus_type = #{busType}</if>
<if test="status != null and status != ''"> and cf.status = #{status}</if>
<if test="amount != null "> and cf.amount = #{amount}</if>
<if test="handlingCharge != null "> and cf.handling_charge = #{handlingCharge}</if>
<if test="operatorDividend != null "> and cf.operator_dividend = #{operatorDividend}</if>
<if test="operatorBalance != null "> and cf.operator_balance = #{operatorBalance}</if>
<if test="partnerDividend != null "> and cf.partner_dividend = #{partnerDividend}</if>
<if test="payType != null and payType != ''"> and cf.pay_type = #{payType}</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND cf.create_time &gt;= #{params.beginTime}
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND cf.create_time &lt;= #{params.endTime}
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
order by cf.create_time desc
</select>
<select id="selectEtCapitalFlowByFlowId" parameterType="Long" resultMap="EtCapitalFlowResult">
<include refid="selectEtCapitalFlowVo"/>
where flow_id = #{flowId}
</select>
<select id="selectEtCapitalFlowByOutTradeNo" resultType="com.ruoyi.system.domain.EtCapitalFlow">
<include refid="selectEtCapitalFlowVo"/>
where out_trade_no = #{outTradeNo}
</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="owner != null">owner,</if>
<if test="ownerId != null">owner_id,</if>
<if test="ownerType != null">owner_type,</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="status != null">status,</if>
<if test="amount != null">amount,</if>
<if test="handlingCharge != null">handling_charge,</if>
<if test="platformServiceFee != null">platform_service_fee,</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="owner != null">#{owner},</if>
<if test="ownerId != null">#{ownerId},</if>
<if test="ownerType != null">#{ownerType},</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="status != null">#{status},</if>
<if test="amount != null">#{amount},</if>
<if test="handlingCharge != null">#{handlingCharge},</if>
<if test="platformServiceFee != null">#{platformServiceFee},</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="owner != null">owner = #{owner},</if>
<if test="ownerId != null">owner_id = #{ownerId},</if>
<if test="ownerType != null">owner_type = #{ownerType},</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="status != null">status = #{status},</if>
<if test="amount != null">amount = #{amount},</if>
<if test="handlingCharge != null">handling_charge = #{handlingCharge},</if>
<if test="platformServiceFee != null">platform_service_fee = #{platformServiceFee},</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>