<?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.ReceivableFeeDetailMapper">
|
|
<resultMap type="com.ruoyi.cwgl.domain.ReceivableFeeDetail" id="ReceivableFeeDetailResult">
|
<result property="id" column="id" />
|
<result property="receivableFeeId" column="receivable_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="selectReceivableFeeDetailVo">
|
select thisTab.id, thisTab.receivable_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 receivable_fee_detail AS thisTab
|
</sql>
|
<sql id="selectReceivableFeeDetailVoCount">
|
select count(0) from receivable_fee_detail as thisTab
|
</sql>
|
|
<sql id="whereCondition">
|
<if test="receivableFeeId != null "> and thisTab.receivable_fee_id = #{receivableFeeId}</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="selectReceivableFeeDetailById" parameterType="Integer" resultMap="ReceivableFeeDetailResult">
|
<include refid="selectReceivableFeeDetailVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectReceivableFeeDetailCount" parameterType="com.ruoyi.cwgl.domain.ReceivableFeeDetail" resultType="int">
|
<include refid="selectReceivableFeeDetailVoCount"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
</select>
|
|
<select id="selectReceivableFeeDetailList" parameterType="com.ruoyi.cwgl.domain.ReceivableFeeDetail" resultMap="ReceivableFeeDetailResult">
|
<include refid="selectReceivableFeeDetailVo"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
order by thisTab.id desc
|
</select>
|
|
<!-- 新增 -->
|
<insert id="insertReceivableFeeDetail" parameterType="com.ruoyi.cwgl.domain.ReceivableFeeDetail" useGeneratedKeys="true" keyProperty="id">
|
insert into receivable_fee_detail
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="receivableFeeId != null">receivable_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="receivableFeeId != null">#{receivableFeeId},</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="insertReceivableFeeDetailBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
insert into receivable_fee_detail
|
<trim prefix="(" suffix=") values" suffixOverrides=",">
|
receivable_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.receivableFeeId},#{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="updateReceivableFeeDetail" parameterType="com.ruoyi.cwgl.domain.ReceivableFeeDetail">
|
update receivable_fee_detail
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="receivableFeeId != null">receivable_fee_id = #{receivableFeeId},</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="updateReceivableFeeDetailBatch" parameterType="java.util.List">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update receivable_fee_detail
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="item.receivableFeeId != null">receivable_fee_id = #{item.receivableFeeId},</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="deleteReceivableFeeDetailById" parameterType="Integer">
|
delete from receivable_fee_detail where id = #{id}
|
</delete>
|
<!--根据应收费用ID删除明细-->
|
<delete id="deleteReceivableFeeDetailByReceivableFeeId" parameterType="Integer">
|
delete from receivable_fee_detail where receivable_fee_id = #{receivableFeeId}
|
</delete>
|
<delete id="deleteReceivableFeeDetailByIds" parameterType="Integer">
|
delete from receivable_fee_detail where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
<!--根据应收费用ID数组查询明细-->
|
<select id="selectReceivableFeeDetailByReceivableFeeIds" parameterType="Integer" resultMap="ReceivableFeeDetailResult">
|
<include refid="selectReceivableFeeDetailVo"/>
|
where thisTab.receivable_fee_id in
|
<foreach item="receivableFeeId" collection="array" open="(" separator="," close=")">
|
#{receivableFeeId}
|
</foreach>
|
</select>
|
|
</mapper>
|