<?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.bonus.sharedstation.auth.mapper.GreenUserMapper">

    <sql id="userAllColumns">
        <![CDATA[
        green_user_info
        .
        id
        , green_user_info.user_id, green_user_info.isc_id, green_user_info.login_name, green_user_info.user_password, green_user_info.real_name,
            green_user_info.mobile, green_user_info.email, green_user_info.unicode, green_user_info.department_id, green_user_info.department_name,
            green_user_info.owner_location, green_user_info.org_id, green_user_info.org_name, green_user_info.title, green_user_info.user_status,
            green_user_info.start_useful_life, green_user_info.end_useful_life, green_user_info.birthday, green_user_info.id_card,
            green_user_info.meal_status, green_user_info.meal_no, green_user_info.compony, green_user_info.remark, green_user_info.creator,
            green_user_info.modifier, green_user_info.gmt_created, green_user_info.gmt_modified, green_user_info.is_deleted,
            green_user_info.office, green_user_info.baseorg_id, green_user_info.baseorg_path, green_user_info.employee_no,
            green_user_info.meal_card_type, green_user_info.meal_card_operation, green_user_info.peration_date, green_user_info.validity_period,
            green_user_info.car_number, green_user_info.gender, green_user_info.landline, green_user_info.live_addr, green_user_info.duties_id,
            green_user_info.tenant_id,green_user_info.cust_id,green_user_info.date_time
        ]]>
    </sql>

    <resultMap id="AllGreenUserInfoMap" type="com.bonus.sharedstation.auth.entity.GreenUserInfoDo">
        <result property="id" column="id"/>
        <result property="userId" column="user_id"/>
        <result property="iscId" column="isc_id"/>
        <result property="loginName" column="login_name"/>
        <result property="userPassword" column="user_password"/>
        <result property="realName" column="real_name"/>
        <result property="mobile" column="mobile"/>
        <result property="email" column="email"/>
        <result property="unicode" column="unicode"/>
        <result property="departmentId" column="department_id"/>
        <result property="departmentName" column="department_name"/>
        <result property="ownerLocation" column="owner_location"/>
        <result property="orgId" column="org_id"/>
        <result property="orgName" column="org_name"/>
        <result property="title" column="title"/>
        <result property="userStatus" column="user_status"/>
        <result property="startUsefulLife" column="start_useful_life"/>
        <result property="endUsefulLife" column="end_useful_life"/>
        <result property="birthday" column="birthday"/>
        <result property="idCard" column="id_card"/>
        <result property="mealStatus" column="meal_status"/>
        <result property="mealNo" column="meal_no"/>
        <result property="compony" column="compony"/>
        <result property="remark" column="remark"/>
        <result property="creator" column="creator"/>
        <result property="modifier" column="modifier"/>
        <result property="gmtCreated" column="gmt_created"/>
        <result property="gmtModified" column="gmt_modified"/>
        <result property="isDeleted" column="is_deleted"/>
        <result property="office" column="office"/>
        <result property="baseorgId" column="baseorg_id"/>
        <result property="baseorgPath" column="baseorg_path"/>
        <result property="employeeNo" column="employee_no"/>
        <result property="mealCardType" column="meal_card_type"/>
        <result property="mealCardOperation" column="meal_card_operation"/>
        <result property="perationDate" column="peration_date"/>
        <result property="validityPeriod" column="validity_period"/>
        <result property="carNumber" column="car_number"/>
        <result property="gender" column="gender"/>
        <result property="landline" column="landline"/>
        <result property="liveAddr" column="live_addr"/>
        <result property="dutiesId" column="duties_id"/>
        <result property="tenantId" column="tenant_id"/>
        <result property="custId" column="cust_id"/>
        <result property="dateTime" column="date_time"/>
    </resultMap>
    <select id="getUserByMobile" resultMap="AllGreenUserInfoMap">
        SELECT
        <include refid="userAllColumns"/>
        FROM
        green_user_info
        WHERE 1=1 and
        mobile = #{mobile} and is_deleted = 'N'
    </select>
</mapper>

