ludc
2023-03-22 e0652e168a1ad4a831d59d54363d3fa5582903d2
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
<?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.UserPwdstrategyMapper">
 
    <resultMap type="org.springblade.system.entity.UserPwdstrategy" id="UserPwdstrategyMap">
        <result property="id" column="ID" jdbcType="INTEGER"/>
        <result property="userId" column="USER_ID" jdbcType="INTEGER"/>
        <result property="pwdstrategyId" column="PWDSTRATEGY_ID" jdbcType="INTEGER"/>
    </resultMap>
 
    <!--查询单个-->
    <select id="queryById" resultMap="UserPwdstrategyMap">
        select ID,
               USER_ID,
               PWDSTRATEGY_ID
        from PL_SYS_USER_PWDSTRATEGY
        where ID = #{id}
    </select>
 
    <!--统计总行数-->
    <select id="count" resultType="java.lang.Long">
        select count(1)
        from PL_SYS_USER_PWDSTRATEGY
        <where>
            <if test="id != null">
                and ID = #{id}
            </if>
            <if test="userId != null">
                and USER_ID = #{userId}
            </if>
            <if test="pwdstrategyId != null">
                and PWDSTRATEGY_ID = #{pwdstrategyId}
            </if>
        </where>
    </select>
 
    <!--通过主键修改数据-->
    <update id="update">
        update PL_SYS_USER_PWDSTRATEGY
        <set>
            <if test="userId != null">
                USER_ID = #{userId},
            </if>
            <if test="pwdstrategyId != null">
                PWDSTRATEGY_ID = #{pwdstrategyId},
            </if>
        </set>
        where ID = #{id}
    </update>
 
    <!--通过主键删除-->
    <delete id="deleteById">
        delete
        from PL_SYS_USER_PWDSTRATEGY
        where ID = #{id}
    </delete>
 
</mapper>