<?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.TmsApBillItemMapper">
|
|
<resultMap type="com.ruoyi.tms.domain.TmsApBillItem" id="TmsApBillItemResult">
|
<result property="id" column="id" />
|
<result property="billId" column="bill_id" />
|
<result property="projectName" column="project_name" />
|
<result property="dispatchNo" column="dispatch_no" />
|
<result property="orderTime" column="order_time" />
|
<result property="estimateAmount" column="estimate_amount" />
|
<result property="currency" column="currency" />
|
<result property="apFeeId" column="ap_fee_id" />
|
<result property="status" column="status" />
|
<result property="createTime" column="create_time" />
|
</resultMap>
|
|
<sql id="selectTmsApBillItemVo">
|
select thisTab.id, thisTab.bill_id, thisTab.project_name, thisTab.dispatch_no, thisTab.order_time, thisTab.estimate_amount, thisTab.currency, thisTab.ap_fee_id, thisTab.status, thisTab.create_time from tms_ap_bill_item AS thisTab
|
</sql>
|
<sql id="selectTmsApBillItemVoCount">
|
select count(0) from tms_ap_bill_item as thisTab
|
</sql>
|
|
<sql id="whereCondition">
|
<if test="billId != null "> and thisTab.bill_id = #{billId}</if>
|
<if test="projectName != null and projectName != ''"> and thisTab.project_name like concat('%', #{projectName}, '%')</if>
|
<if test="dispatchNo != null and dispatchNo != ''"> and thisTab.dispatch_no = #{dispatchNo}</if>
|
<if test="orderTime != null "> and thisTab.order_time = #{orderTime}</if>
|
<if test="estimateAmount != null "> and thisTab.estimate_amount = #{estimateAmount}</if>
|
<if test="currency != null and currency != ''"> and thisTab.currency = #{currency}</if>
|
<if test="apFeeId != null "> and thisTab.ap_fee_id = #{apFeeId}</if>
|
<if test="status != null "> and thisTab.status = #{status}</if>
|
</sql>
|
|
<!--查询-->
|
<select id="selectTmsApBillItemById" parameterType="Integer" resultMap="TmsApBillItemResult">
|
<include refid="selectTmsApBillItemVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectTmsApBillItemCount" parameterType="com.ruoyi.tms.domain.TmsApBillItem" resultType="int">
|
<include refid="selectTmsApBillItemVoCount"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
</select>
|
|
<select id="selectTmsApBillItemList" parameterType="com.ruoyi.tms.domain.TmsApBillItem" resultMap="TmsApBillItemResult">
|
<include refid="selectTmsApBillItemVo"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
order by thisTab.id desc
|
</select>
|
|
<!-- 新增 -->
|
<insert id="insertTmsApBillItem" parameterType="com.ruoyi.tms.domain.TmsApBillItem" useGeneratedKeys="true" keyProperty="id">
|
insert into tms_ap_bill_item
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="billId != null">bill_id,</if>
|
<if test="projectName != null">project_name,</if>
|
<if test="dispatchNo != null">dispatch_no,</if>
|
<if test="orderTime != null">order_time,</if>
|
<if test="estimateAmount != null">estimate_amount,</if>
|
<if test="currency != null">currency,</if>
|
<if test="apFeeId != null">ap_fee_id,</if>
|
<if test="status != null">status,</if>
|
<if test="createTime != null">create_time,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="billId != null">#{billId},</if>
|
<if test="projectName != null">#{projectName},</if>
|
<if test="dispatchNo != null">#{dispatchNo},</if>
|
<if test="orderTime != null">#{orderTime},</if>
|
<if test="estimateAmount != null">#{estimateAmount},</if>
|
<if test="currency != null">#{currency},</if>
|
<if test="apFeeId != null">#{apFeeId},</if>
|
<if test="status != null">#{status},</if>
|
<if test="createTime != null">#{createTime},</if>
|
</trim>
|
</insert>
|
|
<insert id="insertTmsApBillItemBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
insert into tms_ap_bill_item
|
<trim prefix="(" suffix=") values" suffixOverrides=",">
|
id,bill_id,project_name,dispatch_no,order_time,estimate_amount,currency,ap_fee_id,status,create_time,
|
</trim>
|
<foreach item="item" index="index" collection="list" separator=",">
|
<trim prefix="(" suffix=") " suffixOverrides=",">
|
#{item.id},#{item.billId},#{item.projectName},#{item.dispatchNo},#{item.orderTime},#{item.estimateAmount},#{item.currency},#{item.apFeeId},#{item.status},#{item.createTime},
|
</trim>
|
</foreach>
|
</insert>
|
|
<!-- 修改 -->
|
<update id="updateTmsApBillItem" parameterType="com.ruoyi.tms.domain.TmsApBillItem">
|
update tms_ap_bill_item
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="billId != null">bill_id = #{billId},</if>
|
<if test="projectName != null">project_name = #{projectName},</if>
|
<if test="dispatchNo != null">dispatch_no = #{dispatchNo},</if>
|
<if test="orderTime != null">order_time = #{orderTime},</if>
|
<if test="estimateAmount != null">estimate_amount = #{estimateAmount},</if>
|
<if test="currency != null">currency = #{currency},</if>
|
<if test="apFeeId != null">ap_fee_id = #{apFeeId},</if>
|
<if test="status != null">status = #{status},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
<!-- 修改 -->
|
<update id="updateTmsApBillItemBatch" parameterType="java.util.List">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update tms_ap_bill_item
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="item.billId != null">bill_id = #{item.billId},</if>
|
<if test="item.projectName != null">project_name = #{item.projectName},</if>
|
<if test="item.dispatchNo != null">dispatch_no = #{item.dispatchNo},</if>
|
<if test="item.orderTime != null">order_time = #{item.orderTime},</if>
|
<if test="item.estimateAmount != null">estimate_amount = #{item.estimateAmount},</if>
|
<if test="item.currency != null">currency = #{item.currency},</if>
|
<if test="item.apFeeId != null">ap_fee_id = #{item.apFeeId},</if>
|
<if test="item.status != null">status = #{item.status},</if>
|
<if test="item.createTime != null">create_time = #{item.createTime},</if>
|
</trim>
|
where id = #{item.id}
|
</foreach>
|
</update>
|
|
<!--删除-->
|
<delete id="deleteTmsApBillItemById" parameterType="Integer">
|
delete from tms_ap_bill_item where id = #{id}
|
</delete>
|
<delete id="deleteTmsApBillItemByIds" parameterType="Integer">
|
delete from tms_ap_bill_item where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|