<?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.cwgl.mapper.PayableFeeDetailMapper">
|
|
<resultMap type="com.ruoyi.cwgl.domain.PayableFeeDetail" id="PayableFeeDetailResult">
|
<result property="id" column="id" />
|
<result property="payableFeeId" column="payable_fee_id" />
|
<result property="feeType" column="fee_type" />
|
<result property="feeName" column="fee_name" />
|
<result property="billingUnit" column="billing_unit" />
|
<result property="unitPrice" column="unit_price" />
|
<result property="billingQuantity" column="billing_quantity" />
|
<result property="billingAmount" column="billing_amount" />
|
<result property="actualAmount" column="actual_amount" />
|
<result property="currency" column="currency" />
|
<result property="feeRegTime" column="fee_reg_time" />
|
<result property="remark" column="remark" />
|
<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="deleted" column="deleted" />
|
</resultMap>
|
|
<sql id="selectPayableFeeDetailVo">
|
select thisTab.id, thisTab.payable_fee_id, thisTab.fee_type, thisTab.fee_name, thisTab.billing_unit, thisTab.unit_price, thisTab.billing_quantity, thisTab.billing_amount, thisTab.actual_amount, thisTab.currency, thisTab.fee_reg_time, thisTab.remark, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.deleted from payable_fee_detail AS thisTab
|
</sql>
|
<sql id="selectPayableFeeDetailVoCount">
|
select count(0) from payable_fee_detail as thisTab
|
</sql>
|
|
<sql id="whereCondition">
|
<if test="payableFeeId != null "> and thisTab.payable_fee_id = #{payableFeeId}</if>
|
<if test="feeType != null and feeType != ''"> and thisTab.fee_type = #{feeType}</if>
|
<if test="feeName != null and feeName != ''"> and thisTab.fee_name like concat('%', #{feeName}, '%')</if>
|
<if test="billingUnit != null and billingUnit != ''"> and thisTab.billing_unit = #{billingUnit}</if>
|
<if test="unitPrice != null "> and thisTab.unit_price = #{unitPrice}</if>
|
<if test="billingQuantity != null "> and thisTab.billing_quantity = #{billingQuantity}</if>
|
<if test="billingAmount != null "> and thisTab.billing_amount = #{billingAmount}</if>
|
<if test="actualAmount != null "> and thisTab.actual_amount = #{actualAmount}</if>
|
<if test="currency != null and currency != ''"> and thisTab.currency = #{currency}</if>
|
<if test="feeRegTime != null "> and thisTab.fee_reg_time = #{feeRegTime}</if>
|
<if test="deleted != null "> and thisTab.deleted = #{deleted}</if>
|
</sql>
|
|
<!--查询-->
|
<select id="selectPayableFeeDetailById" parameterType="Integer" resultMap="PayableFeeDetailResult">
|
<include refid="selectPayableFeeDetailVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectPayableFeeDetailCount" parameterType="com.ruoyi.cwgl.domain.PayableFeeDetail" resultType="int">
|
<include refid="selectPayableFeeDetailVoCount"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
</select>
|
|
<select id="selectPayableFeeDetailList" parameterType="com.ruoyi.cwgl.domain.PayableFeeDetail" resultMap="PayableFeeDetailResult">
|
<include refid="selectPayableFeeDetailVo"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
order by thisTab.id desc
|
</select>
|
|
<!-- 新增 -->
|
<insert id="insertPayableFeeDetail" parameterType="com.ruoyi.cwgl.domain.PayableFeeDetail" useGeneratedKeys="true" keyProperty="id">
|
insert into payable_fee_detail
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="payableFeeId != null">payable_fee_id,</if>
|
<if test="feeType != null and feeType != ''">fee_type,</if>
|
<if test="feeName != null and feeName != ''">fee_name,</if>
|
<if test="billingUnit != null">billing_unit,</if>
|
<if test="unitPrice != null">unit_price,</if>
|
<if test="billingQuantity != null">billing_quantity,</if>
|
<if test="billingAmount != null">billing_amount,</if>
|
<if test="actualAmount != null">actual_amount,</if>
|
<if test="currency != null">currency,</if>
|
<if test="feeRegTime != null">fee_reg_time,</if>
|
<if test="remark != null">remark,</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="deleted != null">deleted,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="payableFeeId != null">#{payableFeeId},</if>
|
<if test="feeType != null and feeType != ''">#{feeType},</if>
|
<if test="feeName != null and feeName != ''">#{feeName},</if>
|
<if test="billingUnit != null">#{billingUnit},</if>
|
<if test="unitPrice != null">#{unitPrice},</if>
|
<if test="billingQuantity != null">#{billingQuantity},</if>
|
<if test="billingAmount != null">#{billingAmount},</if>
|
<if test="actualAmount != null">#{actualAmount},</if>
|
<if test="currency != null">#{currency},</if>
|
<if test="feeRegTime != null">#{feeRegTime},</if>
|
<if test="remark != null">#{remark},</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="deleted != null">#{deleted},</if>
|
</trim>
|
</insert>
|
|
<insert id="insertPayableFeeDetailBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
insert into payable_fee_detail
|
<trim prefix="(" suffix=") values" suffixOverrides=",">
|
payable_fee_id,fee_type,fee_name,billing_unit,unit_price,billing_quantity,billing_amount,actual_amount,currency,fee_reg_time,remark,create_by,create_time,update_by,update_time,deleted,
|
</trim>
|
<foreach item="item" index="index" collection="list" separator=",">
|
<trim prefix="(" suffix=") " suffixOverrides=",">
|
#{item.payableFeeId},#{item.feeType},#{item.feeName},#{item.billingUnit},#{item.unitPrice},#{item.billingQuantity},#{item.billingAmount},#{item.actualAmount},#{item.currency},#{item.feeRegTime},#{item.remark},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.deleted},
|
</trim>
|
</foreach>
|
</insert>
|
|
<!-- 修改 -->
|
<update id="updatePayableFeeDetail" parameterType="com.ruoyi.cwgl.domain.PayableFeeDetail">
|
update payable_fee_detail
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="payableFeeId != null">payable_fee_id = #{payableFeeId},</if>
|
<if test="feeType != null and feeType != ''">fee_type = #{feeType},</if>
|
<if test="feeName != null and feeName != ''">fee_name = #{feeName},</if>
|
<if test="billingUnit != null">billing_unit = #{billingUnit},</if>
|
<if test="unitPrice != null">unit_price = #{unitPrice},</if>
|
<if test="billingQuantity != null">billing_quantity = #{billingQuantity},</if>
|
<if test="billingAmount != null">billing_amount = #{billingAmount},</if>
|
<if test="actualAmount != null">actual_amount = #{actualAmount},</if>
|
<if test="currency != null">currency = #{currency},</if>
|
<if test="feeRegTime != null">fee_reg_time = #{feeRegTime},</if>
|
<if test="remark != null">remark = #{remark},</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="deleted != null">deleted = #{deleted},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
<!-- 修改 -->
|
<update id="updatePayableFeeDetailBatch" parameterType="java.util.List">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update payable_fee_detail
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="item.payableFeeId != null">payable_fee_id = #{item.payableFeeId},</if>
|
<if test="item.feeType != null and item.feeType != ''">fee_type = #{item.feeType},</if>
|
<if test="item.feeName != null and item.feeName != ''">fee_name = #{item.feeName},</if>
|
<if test="item.billingUnit != null">billing_unit = #{item.billingUnit},</if>
|
<if test="item.unitPrice != null">unit_price = #{item.unitPrice},</if>
|
<if test="item.billingQuantity != null">billing_quantity = #{item.billingQuantity},</if>
|
<if test="item.billingAmount != null">billing_amount = #{item.billingAmount},</if>
|
<if test="item.actualAmount != null">actual_amount = #{item.actualAmount},</if>
|
<if test="item.currency != null">currency = #{item.currency},</if>
|
<if test="item.feeRegTime != null">fee_reg_time = #{item.feeRegTime},</if>
|
<if test="item.remark != null">remark = #{item.remark},</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.deleted != null">deleted = #{item.deleted},</if>
|
</trim>
|
where id = #{item.id}
|
</foreach>
|
</update>
|
|
<!--删除-->
|
<delete id="deletePayableFeeDetailById" parameterType="Integer">
|
delete from payable_fee_detail where id = #{id}
|
</delete>
|
<!--根据应付费用ID删除明细-->
|
<delete id="deletePayableFeeDetailByPayableFeeId" parameterType="Integer">
|
delete from payable_fee_detail where payable_fee_id = #{payableFeeId}
|
</delete>
|
<delete id="deletePayableFeeDetailByIds" parameterType="Integer">
|
delete from payable_fee_detail where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
<!--查询-->
|
<select id="selectPayableFeeDetailByPayableFeeIds" parameterType="Integer" resultMap="PayableFeeDetailResult">
|
<include refid="selectPayableFeeDetailVo"/>
|
where payable_fee_id in
|
<foreach item="feeId" collection="array" open="(" separator="," close=")">
|
#{feeId}
|
</foreach>
|
order by payable_fee_id, id
|
</select>
|
|
</mapper>
|