<?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.VoucherSubjectFeeMapper">
|
|
<resultMap type="com.ruoyi.cwgl.domain.VoucherSubjectFee" id="VoucherSubjectFeeResult">
|
<result property="id" column="id" />
|
<result property="accountSet" column="account_set" />
|
<result property="subjectCode" column="subject_code" />
|
<result property="subjectName" column="subject_name" />
|
<result property="subjectType" column="subject_type" />
|
<result property="feeType" column="fee_type" />
|
<result property="type" column="type" />
|
<result property="materialType" column="material_type" />
|
<result property="feeName" column="fee_name" />
|
<result property="status" column="status" />
|
<result property="delFlag" column="del_flag" />
|
<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="remark" column="remark" />
|
</resultMap>
|
|
<sql id="selectVoucherSubjectFeeVo">
|
select thisTab.id, thisTab.account_set, thisTab.subject_code, thisTab.subject_name, thisTab.subject_type, thisTab.fee_type, thisTab.type, thisTab.material_type, thisTab.fee_name, thisTab.status, thisTab.del_flag, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark from voucher_subject_fee AS thisTab
|
</sql>
|
<sql id="selectVoucherSubjectFeeVoCount">
|
select count(0) from voucher_subject_fee as thisTab
|
</sql>
|
|
<sql id="whereCondition">
|
<if test="accountSet != null and accountSet != ''"> and thisTab.account_set = #{accountSet}</if>
|
<if test="subjectCode != null and subjectCode != ''"> and thisTab.subject_code = #{subjectCode}</if>
|
<if test="subjectName != null and subjectName != ''"> and thisTab.subject_name like concat('%', #{subjectName}, '%')</if>
|
<if test="subjectType != null and subjectType != ''"> and thisTab.subject_type = #{subjectType}</if>
|
<if test="feeType != null and feeType != ''"> and thisTab.fee_type = #{feeType}</if>
|
<if test="type != null and type != ''"> and thisTab.type = #{type}</if>
|
<if test="materialType != null and materialType != ''"> and thisTab.material_type = #{materialType}</if>
|
<if test="feeName != null and feeName != ''"> and thisTab.fee_name like concat('%', #{feeName}, '%')</if>
|
<if test="status != null and status != ''"> and thisTab.status = #{status}</if>
|
</sql>
|
|
<!--查询-->
|
<select id="selectVoucherSubjectFeeById" parameterType="Integer" resultMap="VoucherSubjectFeeResult">
|
<include refid="selectVoucherSubjectFeeVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectVoucherSubjectFeeCount" parameterType="com.ruoyi.cwgl.domain.VoucherSubjectFee" resultType="int">
|
<include refid="selectVoucherSubjectFeeVoCount"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
</select>
|
|
<select id="selectVoucherSubjectFeeList" parameterType="com.ruoyi.cwgl.domain.VoucherSubjectFee" resultMap="VoucherSubjectFeeResult">
|
<include refid="selectVoucherSubjectFeeVo"/>
|
<where>
|
<include refid="whereCondition"/>
|
</where>
|
order by thisTab.id desc
|
</select>
|
|
<!-- 新增 -->
|
<insert id="insertVoucherSubjectFee" parameterType="com.ruoyi.cwgl.domain.VoucherSubjectFee" useGeneratedKeys="true" keyProperty="id">
|
insert into voucher_subject_fee
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="accountSet != null and accountSet != ''">account_set,</if>
|
<if test="subjectCode != null and subjectCode != ''">subject_code,</if>
|
<if test="subjectName != null and subjectName != ''">subject_name,</if>
|
<if test="subjectType != null and subjectType != ''">subject_type,</if>
|
<if test="feeType != null">fee_type,</if>
|
<if test="type != null and type != ''">type,</if>
|
<if test="materialType != null">material_type,</if>
|
<if test="feeName != null">fee_name,</if>
|
<if test="status != null">status,</if>
|
<if test="delFlag != null">del_flag,</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="remark != null">remark,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="accountSet != null and accountSet != ''">#{accountSet},</if>
|
<if test="subjectCode != null and subjectCode != ''">#{subjectCode},</if>
|
<if test="subjectName != null and subjectName != ''">#{subjectName},</if>
|
<if test="subjectType != null and subjectType != ''">#{subjectType},</if>
|
<if test="feeType != null">#{feeType},</if>
|
<if test="type != null and type != ''">#{type},</if>
|
<if test="materialType != null">#{materialType},</if>
|
<if test="feeName != null">#{feeName},</if>
|
<if test="status != null">#{status},</if>
|
<if test="delFlag != null">#{delFlag},</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="remark != null">#{remark},</if>
|
</trim>
|
</insert>
|
|
<insert id="insertVoucherSubjectFeeBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
insert into voucher_subject_fee
|
<trim prefix="(" suffix=") values" suffixOverrides=",">
|
id,account_set,subject_code,subject_name,subject_type,fee_type,type,material_type,fee_name,status,del_flag,create_by,create_time,update_by,update_time,remark,
|
</trim>
|
<foreach item="item" index="index" collection="list" separator=",">
|
<trim prefix="(" suffix=") " suffixOverrides=",">
|
#{item.id},#{item.accountSet},#{item.subjectCode},#{item.subjectName},#{item.subjectType},#{item.feeType},#{item.type},#{item.materialType},#{item.feeName},#{item.status},#{item.delFlag},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},
|
</trim>
|
</foreach>
|
</insert>
|
|
<!-- 修改 -->
|
<update id="updateVoucherSubjectFee" parameterType="com.ruoyi.cwgl.domain.VoucherSubjectFee">
|
update voucher_subject_fee
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="accountSet != null and accountSet != ''">account_set = #{accountSet},</if>
|
<if test="subjectCode != null and subjectCode != ''">subject_code = #{subjectCode},</if>
|
<if test="subjectName != null and subjectName != ''">subject_name = #{subjectName},</if>
|
<if test="subjectType != null and subjectType != ''">subject_type = #{subjectType},</if>
|
<if test="feeType != null">fee_type = #{feeType},</if>
|
<if test="type != null and type != ''">type = #{type},</if>
|
<if test="materialType != null">material_type = #{materialType},</if>
|
<if test="feeName != null">fee_name = #{feeName},</if>
|
<if test="status != null">status = #{status},</if>
|
<if test="delFlag != null">del_flag = #{delFlag},</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="remark != null">remark = #{remark},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
<!-- 修改 -->
|
<update id="updateVoucherSubjectFeeBatch" parameterType="java.util.List">
|
<foreach collection="list" item="item" index="index" separator=";">
|
update voucher_subject_fee
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="item.accountSet != null and item.accountSet != ''">account_set = #{item.accountSet},</if>
|
<if test="item.subjectCode != null and item.subjectCode != ''">subject_code = #{item.subjectCode},</if>
|
<if test="item.subjectName != null and item.subjectName != ''">subject_name = #{item.subjectName},</if>
|
<if test="item.subjectType != null and item.subjectType != ''">subject_type = #{item.subjectType},</if>
|
<if test="item.feeType != null">fee_type = #{item.feeType},</if>
|
<if test="item.type != null and item.type != ''">type = #{item.type},</if>
|
<if test="item.materialType != null">material_type = #{item.materialType},</if>
|
<if test="item.feeName != null">fee_name = #{item.feeName},</if>
|
<if test="item.status != null">status = #{item.status},</if>
|
<if test="item.delFlag != null">del_flag = #{item.delFlag},</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.remark != null">remark = #{item.remark},</if>
|
</trim>
|
where id = #{item.id}
|
</foreach>
|
</update>
|
|
<!--删除-->
|
<delete id="deleteVoucherSubjectFeeById" parameterType="Integer">
|
delete from voucher_subject_fee where id = #{id}
|
</delete>
|
<delete id="deleteVoucherSubjectFeeByIds" parameterType="Integer">
|
delete from voucher_subject_fee where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
</mapper>
|