wujianwei
5 天以前 849648e82e5dec96f9f30fcc9c9bd799268b1f4c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?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>