AppUserMapper.xml 2.86 KB
<?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.nafmii.app.user.dao.AppUserMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="org.nafmii.app.user.entity.AppUserPO">
        <id column="ID" property="id" />
        <result column="USER_NAME" property="userName" />
        <result column="LOGIN_PWD" property="loginPwd" />
        <result column="REAL_NAME" property="realName" />
        <result column="PHONE" property="phone" />
        <result column="BIRTHDAY" property="birthday" />
        <result column="EMAIL" property="email" />
        <result column="HEAD_PICTURE" property="headPicture" />
        <result column="NATIONALITY" property="nationality" />
        <result column="UNIT_NAME" property="unitName" />
        <result column="OPEN_ID" property="openId" />
        <result column="FIGERPRINT_FALG" property="figerprintFalg" />
        <result column="FACEID_FALG" property="faceidFalg" />
        <result column="CREATE_TIME" property="createTime" />
        <result column="UPDATE_TIME" property="updateTime" />
        <result column="IS_ENABLE" property="isEnable" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        ID, USER_NAME, LOGIN_PWD, REAL_NAME, PHONE, BIRTHDAY, EMAIL, HEAD_PICTURE, NATIONALITY, UNIT_NAME, OPEN_ID, FIGERPRINT_FALG, FACEID_FALG, CREATE_TIME, UPDATE_TIME, IS_ENABLE
    </sql>

    <select id="selectByPassword" parameterType="org.nafmii.app.user.dto.LoginDto" resultType="org.nafmii.app.user.vo.UserVO">
        select ID as id,
        USER_NAME as userName, LOGIN_PWD as loginPwd, REAL_NAME as realName, PHONE as phone, BIRTHDAY as birthday, EMAIL as email, HEAD_PICTURE as headPicture, NATIONALITY as nationality,
        UNIT_NAME as unitName, OPEN_ID as openId, FIGERPRINT_FALG as figerprintFalg, FACEID_FALG as faceidFalg, CREATE_TIME as createTime, UPDATE_TIME as updateTime, IS_ENABLE as isEnable
        from APP_USER where IS_ENABLE = 0
        <if test="phone !=null">
            and PHONE !=#{phone}
        </if>
        <if test="loginPwd !=null">
            and LOGIN_PWD !=#{loginPwd}
        </if>
    </select>
    <select id="selectByPhone" parameterType="map" resultType="org.nafmii.app.user.vo.UserVO">
        select ID as id,
        USER_NAME as userName, LOGIN_PWD as loginPwd, REAL_NAME as realName, PHONE as phone, BIRTHDAY as birthday, EMAIL as email, HEAD_PICTURE as headPicture, NATIONALITY as nationality,
        UNIT_NAME as unitName, OPEN_ID as openId, FIGERPRINT_FALG as figerprintFalg, FACEID_FALG as faceidFalg, CREATE_TIME as createTime, UPDATE_TIME as updateTime, IS_ENABLE as isEnable
        from APP_USER where IS_ENABLE = 0
        <if test="phone !=null">
            and PHONE !=#{phone}
        </if>
    </select>
</mapper>