2021与蓝度共同重构项目,服务端
liuhaonan
2022-10-21 0a30812acaa26ebe654340f7e749a6801b63b194
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
<?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.sandu.ximon.dao.mapper.AdminMapper">
 
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.Admin">
        <id property="id" column="id" jdbcType="BIGINT"/>
        <result property="username" column="username" jdbcType="VARCHAR"/>
        <result property="password" column="password" jdbcType="VARCHAR"/>
        <result property="icon" column="icon" jdbcType="VARCHAR"/>
        <result property="email" column="email" jdbcType="VARCHAR"/>
        <result property="mobile" column="mobile" jdbcType="VARCHAR"/>
        <result property="nickName" column="nick_name" jdbcType="VARCHAR"/>
        <result property="note" column="note" jdbcType="VARCHAR"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="loginTime" column="login_time" jdbcType="TIMESTAMP"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
        <result property="status" column="status" jdbcType="INTEGER"/>
    </resultMap>
 
    <sql id="Base_Column_List">
        id,username,password,
        icon,email,mobile,
        nick_name,note,create_time,
        login_time,update_time,status
    </sql>
    <select id="listAdmin" resultType="com.sandu.ximon.dao.bo.AdminBo">
        SELECT
        t1.*,
        t2.role_id
        FROM
        admin t1
        LEFT JOIN admin_role_relation t2 ON t1.id = t2.admin_id
        <where>
            <if test="keyword != null and keyword != ''">
                AND t1.username LIKE CONCAT('%', #{keyword},'%')
            </if>
        </where>
    </select>
</mapper>