ludc
2023-03-21 b3a866dc85a061d11efd6593770a0d88ba063f5a
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
<?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.StrategyMapper">
 
    <resultMap type="org.springblade.system.entity.Strategy" id="StrategyMap">
        <result property="id" column="ID" jdbcType="VARCHAR"/>
        <result property="strategyName" column="STRATEGY_NAME" jdbcType="VARCHAR"/>
        <result property="minPwdLen" column="MIN_PWD_LEN" jdbcType="VARCHAR"/>
        <result property="maxPwdLen" column="MAX_PWD_LEN" jdbcType="VARCHAR"/>
        <result property="combinationIds" column="COMBINATION " jdbcType="VARCHAR"/>
        <result property="requiredType" column="REQUIRED_TYPE" jdbcType="VARCHAR"/>
        <result property="expirationTime" column="EXPIRATION_TIME" jdbcType="TIMESTAMP"/>
        <result property="reminderTime" column="REMINDER_TIME" jdbcType="TIMESTAMP"/>
        <result property="lockingNum" column="LOCKING_NUM" jdbcType="VARCHAR"/>
        <result property="lockingTime" column="LOCKING_TIME" jdbcType="TIMESTAMP"/>
        <result property="desc" column="DESC" jdbcType="VARCHAR"/>
        <result property="isDefault" column="IS_DEFAULT" jdbcType="VARCHAR"/>
        <result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
        <result property="createUser" column="CREATE_USER" jdbcType="TIMESTAMP"/>
        <result property="updateTime" column="UPDATE_TIME" jdbcType="TIMESTAMP"/>
        <result property="updateUser" column="UPDATE_USER" jdbcType="TIMESTAMP"/>
        <result property="combinationNames" column="COMBINATIONNAMES"/>
    </resultMap>
 
    <!--查询单个-->
    <select id="queryById" resultMap="StrategyMap">
        select
          ID, STRATEGY_NAME, MIN_PWD_LEN, MAX_PWD_LEN, COMBINATION , REQUIRED_TYPE, EXPIRATION_TIME, REMINDER_TIME, LOCKING_NUM, LOCKING_TIME, DESC, IS_DEFAULT, CREATE_DATE, CREATE_USER, UPDATE_DATE, UPDATE_USER
        from PL_SYS_STRATEGY
        where ID = #{id}
    </select>
 
    <!--查询指定行数据-->
    <select id="queryAllByPage" resultMap="StrategyMap">
        select pss.*,
               (select WM_CONCAT(psc.NAME)
                from PL_SYS_COMBINATION psc
                where instr(pss.COMBINATION_IDS,psc.ID) > 0) COMBINATIONNAMES
        from PL_SYS_STRATEGY pss
    </select>
 
    <!--统计总行数-->
    <select id="count" resultType="java.lang.Long">
        select count(1)
        from PL_SYS_STRATEGY
        <where>
            <if test="id != null and id != ''">
                and ID = #{id}
            </if>
            <if test="strategyName != null and strategyName != ''">
                and STRATEGY_NAME = #{strategyName}
            </if>
            <if test="minPwdLen != null and minPwdLen != ''">
                and MIN_PWD_LEN = #{minPwdLen}
            </if>
            <if test="maxPwdLen != null and maxPwdLen != ''">
                and MAX_PWD_LEN = #{maxPwdLen}
            </if>
            <if test="combination  != null and combination  != ''">
                and COMBINATION  = #{combination }
            </if>
            <if test="requiredType != null and requiredType != ''">
                and REQUIRED_TYPE = #{requiredType}
            </if>
            <if test="expirationTime != null">
                and EXPIRATION_TIME = #{expirationTime}
            </if>
            <if test="reminderTime != null">
                and REMINDER_TIME = #{reminderTime}
            </if>
            <if test="lockingNum != null and lockingNum != ''">
                and LOCKING_NUM = #{lockingNum}
            </if>
            <if test="lockingTime != null">
                and LOCKING_TIME = #{lockingTime}
            </if>
            <if test="desc != null and desc != ''">
                and DESC = #{desc}
            </if>
            <if test="isDefault != null and isDefault != ''">
                and IS_DEFAULT = #{isDefault}
            </if>
            <if test="createDate != null">
                and CREATE_DATE = #{createDate}
            </if>
            <if test="createUser != null">
                and CREATE_USER = #{createUser}
            </if>
            <if test="updateDate != null">
                and UPDATE_DATE = #{updateDate}
            </if>
            <if test="updateUser != null">
                and UPDATE_USER = #{updateUser}
            </if>
        </where>
    </select>
 
    <!--通过主键修改数据-->
    <!--<update id="update">
        update PL_SYS_STRATEGY
        <set>
            <if test="strategyName != null and strategyName != ''">
                STRATEGY_NAME = #{strategyName},
            </if>
            <if test="minPwdLen != null and minPwdLen != ''">
                MIN_PWD_LEN = #{minPwdLen},
            </if>
            <if test="maxPwdLen != null and maxPwdLen != ''">
                MAX_PWD_LEN = #{maxPwdLen},
            </if>
            <if test="combination  != null and combination  != ''">
                COMBINATION  = #{combination },
            </if>
            <if test="requiredType != null and requiredType != ''">
                REQUIRED_TYPE = #{requiredType},
            </if>
            <if test="expirationTime != null">
                EXPIRATION_TIME = #{expirationTime},
            </if>
            <if test="reminderTime != null">
                REMINDER_TIME = #{reminderTime},
            </if>
            <if test="lockingNum != null and lockingNum != ''">
                LOCKING_NUM = #{lockingNum},
            </if>
            <if test="lockingTime != null">
                LOCKING_TIME = #{lockingTime},
            </if>
            <if test="desc != null and desc != ''">
                DESC = #{desc},
            </if>
            <if test="isDefault != null and isDefault != ''">
                IS_DEFAULT = #{isDefault},
            </if>
            <if test="createDate != null">
                CREATE_DATE = #{createDate},
            </if>
            <if test="createUser != null">
                CREATE_USER = #{createUser},
            </if>
            <if test="updateDate != null">
                UPDATE_DATE = #{updateDate},
            </if>
            <if test="updateUser != null">
                UPDATE_USER = #{updateUser},
            </if>
        </set>
        where ID = #{id}
    </update>
 
    &lt;!&ndash;通过主键删除&ndash;&gt;
    <delete id="deleteById">
        delete from PL_SYS_STRATEGY where ID = #{id}
    </delete>-->
 
</mapper>