<?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.chinaweal.aiccs.aiccs.nonIocalCirculation.mapper.EOtPermitMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.chinaweal.aiccs.aiccs.nonIocalCirculation.entity.EOtPermit">
        <id column="id" property="id" />
        <result column="LICID" property="licid" />
        <result column="REGNO" property="regno" />
        <result column="UNISCID" property="uniscid" />
        <result column="ENTNAME" property="entname" />
        <result column="LICNO" property="licno" />
        <result column="LICNAME_CN" property="licnameCn" />
        <result column="VALFROM" property="valfrom" />
        <result column="VALTO" property="valto" />
        <result column="LICANTH" property="licanth" />
        <result column="LICITEM" property="licitem" />
        <result column="TYPE" property="type" />
        <result column="CANDATE" property="candate" />
        <result column="EQUPLECANREA" property="equplecanrea" />
        <result column="REVDATE" property="revdate" />
        <result column="SUGREVREASON" property="sugrevreason" />
        <result column="INVALIDDATE" property="invaliddate" />
        <result column="INVALIDREA" property="invalidrea" />
        <result column="DATADEPT" property="datadept" />
        <result column="UPLOADPROV" property="uploadprov" />
        <result column="TARGETPROV" property="targetprov" />
        <result column="OPFLAG" property="opflag" />
        <result column="insert_time" property="insertTime" />
        <result column="lastupdate_time" property="lastupdateTime" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, LICID, REGNO, UNISCID, ENTNAME, LICNO, LICNAME_CN, VALFROM, VALTO, LICANTH, LICITEM, TYPE, CANDATE, EQUPLECANREA, REVDATE, SUGREVREASON, INVALIDDATE, INVALIDREA, DATADEPT, UPLOADPROV, TARGETPROV, OPFLAG, insert_time, lastupdate_time
    </sql>

    <select id="queryByUNISCID" parameterType="String" resultMap="BaseResultMap">
        select * from e_ot_permit eop where
  		UNISCID = #{UNISCID} or REGNO = #{UNISCID}
  		order by insert_time desc
    </select>
</mapper>
