田源
2023-03-21 fbe37e2e00bddec409b595a4a6e50c4bb32a008a
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
<?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="org.springblade.system.mapper.CombinationMapper">
 
    <resultMap type="org.springblade.system.entity.Combination" id="CombinationMap">
        <result property="id" column="ID" jdbcType="VARCHAR"/>
        <result property="name" column="NAME" jdbcType="VARCHAR"/>
        <result property="desc" column="DESC" jdbcType="VARCHAR"/>
        <result property="createtime" column="CREATETIME" jdbcType="TIMESTAMP"/>
        <result property="createuser" column="CREATEUSER" jdbcType="VARCHAR"/>
        <result property="updatetime" column="UPDATETIME" jdbcType="TIMESTAMP"/>
        <result property="updateuser" column="UPDATEUSER" jdbcType="VARCHAR"/>
        <result property="licensors" column="LICENSORS" jdbcType="VARCHAR"/>
    </resultMap>
 
    <!--查询单个-->
    <select id="queryById" resultMap="CombinationMap">
        select ID,
               NAME, DESC, CREATETIME, CREATEUSER, UPDATETIME, UPDATEUSER, LICENSORS
        from PL_SYS_COMBINATION
        where ID = #{id}
    </select>
 
    <!--统计总行数-->
    <select id="count" resultType="java.lang.Long">
        select count(1)
        from PL_SYS_COMBINATION
        <where>
            <if test="id != null and id != ''">
                and ID = #{id}
            </if>
            <if test="name != null and name != ''">
                and NAME = #{name}
            </if>
            <if test="desc != null and desc != ''">
                and DESC = #{desc}
            </if>
            <if test="createtime != null">
                and CREATETIME = #{createtime}
            </if>
            <if test="createuser != null and createuser != ''">
                and CREATEUSER = #{createuser}
            </if>
            <if test="updatetime != null">
                and UPDATETIME = #{updatetime}
            </if>
            <if test="updateuser != null and updateuser != ''">
                and UPDATEUSER = #{updateuser}
            </if>
            <if test="licensors != null and licensors != ''">
                and LICENSORS = #{licensors}
            </if>
        </where>
    </select>
 
    <!--分页查询-->
    <select id="selectCombinationPage" resultMap="CombinationMap">
        select
        ID, NAME, DESC, CREATETIME, CREATEUSER, UPDATETIME, UPDATEUSER, LICENSORS
        from PL_SYS_COMBINATION
        <where>
            <if test="id != null and id != ''">
                and ID = #{id}
            </if>
            <if test="name != null and name != ''">
                and NAME = #{name}
            </if>
            <if test="desc != null and desc != ''">
                and DESC = #{desc}
            </if>
            <if test="createtime != null">
                and CREATETIME = #{createtime}
            </if>
            <if test="createuser != null and createuser != ''">
                and CREATEUSER = #{createuser}
            </if>
            <if test="updatetime != null">
                and UPDATETIME = #{updatetime}
            </if>
            <if test="updateuser != null and updateuser != ''">
                and UPDATEUSER = #{updateuser}
            </if>
            <if test="licensors != null and licensors != ''">
                and LICENSORS = #{licensors}
            </if>
        </where>
        limit #{pageable.offset}, #{pageable.pageSize}
    </select>
 
</mapper>