<?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.mohrss.leaf.zjrs.auth.entity.FwOperatorMapper">

    <resultMap id="FwOperatorResultMap" type="org.mohrss.leaf.zjrs.auth.entity.FwOperator">
        <result column="BAE001"     property="bae001"/>
        <result column="OPERUNITID" property="operunitid"/>
        <result column="OPERID"     property="operid"/>
        <result column="SGUSERID"   property="sguserid"/>
        <result column="OPERNAME"   property="opername"/>
        <result column="OPERTYPE"   property="opertype"/>
        <result column="LOGINID"    property="loginid"/>
        <result column="PASSWORD"   property="password"/>
        <result column="PWENCRYPT"  property="pwencrypt"/>
        <result column="AAE100"     property="aae100"/>
        <result column="OPERTYPE2"  property="opertype2"/>
    </resultMap>

    <!-- 根据 loginId 查询操作员（只取必要字段，含密码） -->
    <select id="selectByLoginId" resultMap="FwOperatorResultMap">
        SELECT BAE001, OPERUNITID, OPERID, SGUSERID, OPERNAME, OPERTYPE,
               LOGINID, PASSWORD, PWENCRYPT, AAE100, OPERTYPE2
        FROM ZJRS_YWXT.FW_OPERATOR
        WHERE LOGINID = #{loginId}
          AND ROWNUM = 1
    </select>

    <select id="selectByOperId" resultMap="FwOperatorResultMap">
        SELECT BAE001, OPERUNITID, OPERID, SGUSERID, OPERNAME, OPERTYPE,
               LOGINID, PASSWORD, PWENCRYPT, AAE100, OPERTYPE2
        FROM ZJRS_YWXT.FW_OPERATOR
        WHERE OPERID = #{operid}
          AND ROWNUM = 1
    </select>

</mapper>
