Blame view

MemberMapper.xml 3.16 KB
涂亚平 committed
1 2 3 4 5 6
<?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.subsidy.mapper.MemberMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.subsidy.model.MemberDO">
涂亚平 committed
7 8 9 10 11 12 13 14 15 16
        <id column="id" property="id"/>
        <result column="create_date" property="createDate"/>
        <result column="update_date" property="updateDate"/>
        <result column="delete_date" property="deleteDate"/>
        <result column="user_name" property="userName"/>
        <result column="telephone" property="telephone"/>
        <result column="password" property="password"/>
        <result column="gender" property="gender"/>
        <result column="image" property="image"/>
        <result column="id_card" property="idCard"/>
涂亚平 committed
17 18 19 20 21 22 23 24 25 26
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        create_date,
        update_date,
        delete_date,
        id, user_name, telephone, password, gender, image, id_card
    </sql>

涂亚平 committed
27 28 29 30 31 32 33
    <select id="passwordLogin" parameterType="com.subsidy.dto.member.PasswordLoginDTO" resultType="com.subsidy.vo.administer.UserRoleVO">
        SELECT
            t.id,
            t.telephone,
            t.user_name,
            t.image,
            t.status,
涂亚平 committed
34 35
            t.first_login,
            t.password
涂亚平 committed
36 37 38 39 40 41 42 43
        FROM
            member t
        WHERE
            t.delete_date IS NULL
            AND t.account_name = #{accountName}
            AND t.company_id =#{companyId}
    </select>

涂亚平 committed
44 45 46 47 48
    <select id="studyPage" parameterType="com.subsidy.model.MemberDO" resultType="com.subsidy.vo.member.StudyPageVO">
        SELECT
            t3.id,
            t2.id as classId,
            t3.course_name,
涂亚平 committed
49 50
            t2.end_date,
            t2.class_name
涂亚平 committed
51 52 53 54 55 56 57
        FROM
            class_member_mapping t
            LEFT JOIN class_dict t2 ON t.class_id = t2.id
            left join course_dict t3 on t2.course_id = t3.id
        WHERE
            t.delete_date IS NULL
            AND t2.delete_date IS NULL
涂亚平 committed
58
            and t3.delete_date is null
涂亚平 committed
59 60 61
            AND t.member_id = #{id}
    </select>

涂亚平 committed
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

    <select id="getDepartments" parameterType="long" resultType="com.subsidy.model.DepartmentDictDO">
        SELECT
            t2.id,
            t2.department_name,
            t2.parent_id
        FROM
            member_department_mapping t
            LEFT JOIN department_dict t2 ON t.department_id = t2.id
        WHERE
            t.delete_date IS NULL
            AND t2.delete_date IS NULL
            AND t.member_id = #{memberId}
    </select>

    <select id="getMembers" resultType="com.subsidy.vo.member.GetAllVO">
        SELECT
        t2.*
        FROM
        member_department_mapping t
        LEFT JOIN member t2 ON t.member_id = t2.id
        WHERE
        t.delete_date IS NULL
        AND t2.delete_date IS NULL
        and t.department_id = #{departmentId}
涂亚平 committed
87
        <if test="userName != null and userName !=''">
涂亚平 committed
88 89 90 91 92 93 94
            and t2.user_name like concat('%',#{userName} ,'%')
        </if>
        <if test="status != null and status !=''">
            and t2.status = #{status}
        </if>
    </select>

涂亚平 committed
95
</mapper>