Blame view

MemberDictMapper.xml 3.39 KB
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
<?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.laowu.mapper.MemberDictMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.laowu.model.MemberDictDO">
        <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="status" property="status" />
        <result column="telephone" property="telephone" />
        <result column="id_card_type" property="idCardType" />
        <result column="id_card" property="idCard" />
        <result column="province" property="province" />
        <result column="city" property="city" />
        <result column="county" property="county" />
        <result column="address" property="address" />
        <result column="education" property="education" />
        <result column="education_type" property="educationType" />
        <result column="college_id" property="collegeId" />
        <result column="start_date" property="startDate" />
        <result column="end_date" property="endDate" />
        <result column="major_id" property="majorId" />
        <result column="rank" property="rank" />
        <result column="is_poor" property="isPoor" />
        <result column="is_migration" property="isMigration" />
        <result column="is_party" property="isParty" />
        <result column="job_status" property="jobStatus" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        create_date,
        update_date,
        delete_date,
        id, user_name, status, telephone, id_card_type, id_card, province, city, town, address, education, education_type, college_id, start_date, end_date, major_id, rank, is_poor, is_migration, is_party, job_status
    </sql>

    <select id="allMembers" resultType="com.laowu.vo.member.AllMembersVO">
        SELECT
            t.id,
            t.user_name,
            t.STATUS,
            t.telephone,
            t.id_card_type,
            t.id_card,
            t.province,
            t.city,
            t.county,
            t.address
        FROM
            member_dict t
        WHERE
            t.delete_date IS NULL
            <if test="status != null and status != ''">
                AND t.STATUS = #{status}
            </if>
            <if test="province != null and province != ''">
                AND t.province = #{province}
            </if>
            <if test="city != null and city != ''">
                AND t.city = #{city}
            </if>
            <if test="county != null and county != ''">
                AND t.county = #{county}
            </if>
            <if test="userName != null and userName != ''">
                AND t.user_name like concat('%', #{userName}, '%')
            </if>
72
        order by t.create_date
73 74 75 76 77 78 79 80 81 82 83 84 85 86
    </select>

    <select id="members" parameterType="long" resultType="long">
        SELECT
            t.id
        FROM
            member_dict t
            left join member_team_mapping t2 on t.id = t2.member_id
        WHERE
            t.delete_date IS NULL
            and t2.delete_date is null
            AND t2.team_id = #{teamId}
    </select>
</mapper>