教育训练处考试制证系统后端
“djh”
2025-02-25 70dcf4e610a0ec5fd6ca2c3daf9edf4957b30529
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
<?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.gkhy.exam.pay.mapper.NonCoalPayCategoryMapper">
 
    <resultMap type="NonCoalPayCategory" id="NonCoalPayCategoryResult">
        <result property="id" column="id"/>
        <result property="nonCoalPayId" column="non_coal_pay_id"/>
        <result property="categoryId" column="category_id"/>
        <result property="categoryType" column="category_type"/>
        <result property="categoryAmount" column="category_amount"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="delFlag" column="del_flag"/>
    </resultMap>
 
    <sql id="selectNonCoalPayCategoryVo">
        select id,
               non_coal_pay_id,
               category_id,
               category_type,
               category_amount,
               update_by,
               update_time,
               create_by,
               create_time,
               del_flag
        from non_coal_pay_category
    </sql>
 
    <select id="selectNonCoalPayCategoryList" parameterType="NonCoalPayCategory" resultMap="NonCoalPayCategoryResult">
        <include refid="selectNonCoalPayCategoryVo"/>
        <where>
            <if test="nonCoalPayId != null ">and non_coal_pay_id = #{nonCoalPayId}</if>
            <if test="categoryId != null ">and category_id = #{categoryId}</if>
            <if test="categoryType != null ">and category_type = #{categoryType}</if>
        </where>
    </select>
 
    <select id="selectNonCoalPayCategoryById" parameterType="Long" resultMap="NonCoalPayCategoryResult">
        <include refid="selectNonCoalPayCategoryVo"/>
        where id = #{id}
    </select>
 
    <insert id="insertNonCoalPayCategory" parameterType="NonCoalPayCategory">
        insert into non_coal_pay_category
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="nonCoalPayId != null">non_coal_pay_id,</if>
            <if test="categoryId != null">category_id,</if>
            <if test="categoryType != null">category_type,</if>
            <if test="categoryAmount != null">category_amount,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="delFlag != null">del_flag,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="nonCoalPayId != null">#{nonCoalPayId},</if>
            <if test="categoryId != null">#{categoryId},</if>
            <if test="categoryType != null">#{categoryType},</if>
            <if test="categoryAmount != null">#{categoryAmount},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="delFlag != null">#{delFlag},</if>
        </trim>
    </insert>
 
    <update id="updateNonCoalPayCategory" parameterType="NonCoalPayCategory">
        update non_coal_pay_category
        <trim prefix="SET" suffixOverrides=",">
            <if test="nonCoalPayId != null">non_coal_pay_id = #{nonCoalPayId},</if>
            <if test="categoryId != null">category_id = #{categoryId},</if>
            <if test="categoryType != null">category_type = #{categoryType},</if>
            <if test="categoryAmount != null">category_amount = #{categoryAmount},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
        </trim>
        where id = #{id}
    </update>
 
    <update id="deleteNonCoalPayCategoryById" parameterType="Long">
        update non_coal_pay_category
        set del_flag = 2
        where non_coal_pay_id = #{id}
    </update>
 
    <delete id="deleteNonCoalPayCategoryByIds" parameterType="String">
        delete from non_coal_pay_category where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>