<?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.tms.mapper.TmsApBillMapper">
|
|
<resultMap type="com.ruoyi.tms.domain.TmsApBill" id="TmsApBillResult">
|
<result property="id" column="id" />
|
<result property="systemNo" column="system_no" />
|
<result property="billName" column="bill_name" />
|
<result property="settleAmount" column="settle_amount" />
|
<result property="settleRate" column="settle_rate" />
|
<result property="dispatchCount" column="dispatch_count" />
|
<result property="settledAmount" column="settled_amount" />
|
<result property="invoiceStatus" column="invoice_status" />
|
<result property="status" column="status" />
|
<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="deductionAmount" column="deduction_amount" />
|
<result property="actualSettlementAmount" column="actual_settlement_amount" />
|
<result property="serviceProviderId" column="service_provider_id" />
|
<result property="serviceProviderName" column="service_provider_name" />
|
<result property="serviceProviderType" column="service_provider_type" />
|
<result property="pushStatus" column="push_status" />
|
<result property="pushTime" column="push_time" />
|
<result property="sourceSystemId" column="source_system_id" />
|
</resultMap>
|
|
<sql id="selectTmsApBillVo">
|
select thisTab.id, thisTab.system_no, thisTab.bill_name, thisTab.settle_amount, thisTab.settle_rate, thisTab.dispatch_count, thisTab.settled_amount, thisTab.invoice_status, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.deduction_amount, thisTab.actual_settlement_amount, thisTab.service_provider_id, thisTab.service_provider_name, thisTab.service_provider_type, thisTab.push_status, thisTab.push_time, thisTab.source_system_id from tms_ap_bill AS thisTab
|
</sql>
|
<sql id="selectTmsApBillVoCount">
|
select count(0) from tms_ap_bill as thisTab
|
</sql>
|
|
<sql id="whereCondition">
|
<if test="systemNo != null and systemNo != ''"> and thisTab.system_no = #{systemNo}</if>
|
<if test="serviceProviderType != null and serviceProviderType != ''"> and thisTab.service_provider_type = #{serviceProviderType}</if>
|
<if test="billName != null and billName != ''"> and thisTab.bill_name like concat('%', #{billName}, '%')</if>
|
<if test="serviceProviderName != null and serviceProviderName != ''"> and thisTab.service_provider_name like concat('%', #{serviceProviderName}, '%')</if>
|
<if test="settleAmount != null "> and thisTab.settle_amount = #{settleAmount}</if>
|
<if test="settleRate != null "> and thisTab.settle_rate = #{settleRate}</if>
|
<if test="dispatchCount != null "> and thisTab.dispatch_count = #{dispatchCount}</if>
|
<if test="settledAmount != null "> and thisTab.settled_amount = #{settledAmount}</if>
|
<if test="invoiceStatus != null "> and thisTab.invoice_status = #{invoiceStatus}</if>
|
<if test="status != null "> and thisTab.status = #{status}</if>
|
<if test="serviceProviderId != null "> and thisTab.service_provider_id = #{serviceProviderId}</if>
|
<if test="deductionAmount != null "> and thisTab.deduction_amount = #{deductionAmount}</if>
|
<if test="actualSettlementAmount != null "> and thisTab.actual_settlement_amount = #{actualSettlementAmount}</if>
|
<if test="pushStatus != null "> and thisTab.push_status = #{pushStatus}</if>
|
<if test="sourceSystemId != null "> and thisTab.source_system_id = #{sourceSystemId}</if>
|
</sql>
|
|
<!--查询-->
|
<select id="selectTmsApBillById" parameterType="Integer" resultMap="TmsApBillResult">
|
<include refid="selectTmsApBillVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectTmsApBillCount" parameterType="com.ruoyi.tms.domain.TmsApBill" resultType="int">
|
<include refid="selectTmsApBillVoCount"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
</select>
|
|
<select id="selectTmsApBillList" parameterType="com.ruoyi.tms.domain.TmsApBill" resultMap="TmsApBillResult">
|
<include refid="selectTmsApBillVo"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
order by thisTab.id desc
|
</select>
|
|
<!-- 新增 -->
|
<insert id="insertTmsApBill" parameterType="com.ruoyi.tms.domain.TmsApBill" useGeneratedKeys="true" keyProperty="id">
|
insert into tms_ap_bill
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="systemNo != null and systemNo != ''">system_no,</if>
|
<if test="billName != null and billName != ''">bill_name,</if>
|
<if test="settleAmount != null">settle_amount,</if>
|
<if test="settleRate != null">settle_rate,</if>
|
<if test="dispatchCount != null">dispatch_count,</if>
|
<if test="settledAmount != null">settled_amount,</if>
|
<if test="invoiceStatus != null">invoice_status,</if>
|
<if test="status != null">status,</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>
|
<if test="deductionAmount != null">deduction_amount,</if>
|
<if test="actualSettlementAmount != null">actual_settlement_amount,</if>
|
<if test="serviceProviderId != null">service_provider_id,</if>
|
<if test="serviceProviderName != null and serviceProviderName != ''">service_provider_name,</if>
|
<if test="serviceProviderType != null and serviceProviderType != ''">service_provider_type,</if>
|
<if test="pushStatus != null">push_status,</if>
|
<if test="pushTime != null">push_time,</if>
|
<if test="sourceSystemId != null">source_system_id,</if>
|
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="systemNo != null and systemNo != ''">#{systemNo},</if>
|
<if test="billName != null and billName != ''">#{billName},</if>
|
<if test="settleAmount != null">#{settleAmount},</if>
|
<if test="settleRate != null">#{settleRate},</if>
|
<if test="dispatchCount != null">#{dispatchCount},</if>
|
<if test="settledAmount != null">#{settledAmount},</if>
|
<if test="invoiceStatus != null">#{invoiceStatus},</if>
|
<if test="status != null">#{status},</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>
|
<if test="deductionAmount != null">#{deductionAmount},</if>
|
<if test="actualSettlementAmount != null">#{actualSettlementAmount},</if>
|
<if test="serviceProviderId != null">#{serviceProviderId},</if>
|
<if test="serviceProviderName != null and serviceProviderName != ''">#{serviceProviderName},</if>
|
<if test="serviceProviderType != null and serviceProviderType != ''">#{serviceProviderType},</if>
|
<if test="pushStatus != null">#{pushStatus},</if>
|
<if test="pushTime != null">#{pushTime},</if>
|
<if test="sourceSystemId != null">#{sourceSystemId},</if>
|
|
</trim>
|
</insert>
|
|
<insert id="insertTmsApBillBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
insert into tms_ap_bill
|
<trim prefix="(" suffix=") values" suffixOverrides=",">
|
system_no,bill_name,settle_amount,settle_rate,dispatch_count,settled_amount,invoice_status,status,create_by,create_time,update_by,update_time,deduction_amount,actual_settlement_amount,push_status,push_time,source_system_id,
|
</trim>
|
<foreach item="item" index="index" collection="list" separator=",">
|
<trim prefix="(" suffix=") " suffixOverrides=",">
|
#{item.systemNo},#{item.billName},#{item.settleAmount},#{item.settleRate},#{item.dispatchCount},#{item.settledAmount},#{item.invoiceStatus},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.deductionAmount},#{item.actualSettlementAmount},#{item.pushStatus},#{item.pushTime},#{item.sourceSystemId},
|
</trim>
|
</foreach>
|
</insert>
|
|
<!-- 修改 -->
|
<update id="updateTmsApBill" parameterType="com.ruoyi.tms.domain.TmsApBill">
|
update tms_ap_bill
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="systemNo != null and systemNo != ''">system_no = #{systemNo},</if>
|
<if test="billName != null and billName != ''">bill_name = #{billName},</if>
|
<if test="settleAmount != null">settle_amount = #{settleAmount},</if>
|
<if test="settleRate != null">settle_rate = #{settleRate},</if>
|
<if test="dispatchCount != null">dispatch_count = #{dispatchCount},</if>
|
<if test="settledAmount != null">settled_amount = #{settledAmount},</if>
|
<if test="invoiceStatus != null">invoice_status = #{invoiceStatus},</if>
|
<if test="status != null">status = #{status},</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>
|
<if test="deductionAmount != null">deduction_amount = #{deductionAmount},</if>
|
<if test="actualSettlementAmount != null">actual_settlement_amount = #{actualSettlementAmount},</if>
|
<if test="serviceProviderId != null">service_provider_id = #{serviceProviderId},</if>
|
<if test="serviceProviderName != null and serviceProviderName != ''">service_provider_name = #{serviceProviderName},</if>
|
<if test="serviceProviderType != null and serviceProviderType != ''">service_provider_type = #{serviceProviderType},</if>
|
<if test="pushStatus != null">push_status = #{pushStatus},</if>
|
<if test="pushTime != null">push_time = #{pushTime},</if>
|
<if test="sourceSystemId != null">source_system_id = #{sourceSystemId},</if>
|
|
</trim>
|
where id = #{id}
|
</update>
|
<!-- 修改 -->
|
<update id="updateTmsApBillBatch" parameterType="java.util.List">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update tms_ap_bill
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="item.systemNo != null and item.systemNo != ''">system_no = #{item.systemNo},</if>
|
<if test="item.billName != null and item.billName != ''">bill_name = #{item.billName},</if>
|
<if test="item.settleAmount != null">settle_amount = #{item.settleAmount},</if>
|
<if test="item.settleRate != null">settle_rate = #{item.settleRate},</if>
|
<if test="item.dispatchCount != null">dispatch_count = #{item.dispatchCount},</if>
|
<if test="item.settledAmount != null">settled_amount = #{item.settledAmount},</if>
|
<if test="item.invoiceStatus != null">invoice_status = #{item.invoiceStatus},</if>
|
<if test="item.status != null">status = #{item.status},</if>
|
<if test="item.createBy != null">create_by = #{item.createBy},</if>
|
<if test="item.createTime != null">create_time = #{item.createTime},</if>
|
<if test="item.updateBy != null">update_by = #{item.updateBy},</if>
|
<if test="item.updateTime != null">update_time = #{item.updateTime},</if>
|
<if test="item.deductionAmount != null">deduction_amount = #{item.deductionAmount},</if>
|
<if test="item.actualSettlementAmount != null">actual_settlement_amount = #{item.actualSettlementAmount},</if>
|
<if test="item.serviceProviderId != null">service_provider_id = #{item.serviceProviderId},</if>
|
<if test="item.serviceProviderName != null and item.serviceProviderName != ''">service_provider_name = #{item.serviceProviderName},</if>
|
<if test="item.serviceProviderType != null and item.serviceProviderType != ''">service_provider_type = #{item.serviceProviderType},</if>
|
<if test="item.pushStatus != null">push_status = #{item.pushStatus},</if>
|
<if test="item.pushTime != null">push_time = #{item.pushTime},</if>
|
<if test="item.sourceSystemId != null">source_system_id = #{item.sourceSystemId},</if>
|
|
</trim>
|
where id = #{item.id}
|
</foreach>
|
</update>
|
|
<!--删除-->
|
<delete id="deleteTmsApBillById" parameterType="Integer">
|
delete from tms_ap_bill where id = #{id}
|
</delete>
|
<delete id="deleteTmsApBillByIds" parameterType="Integer">
|
delete from tms_ap_bill where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|