<?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.punishment.mapper.TsbizpunishunlockMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.chinaweal.aiccs.aiccs.punishment.entity.TsbizPunishUnlock">
        <id column="unLockId" property="unLockId" />
        <result column="ELID" property="elid" />
        <result column="BIZSEQ" property="bizseq" />
        <result column="UNISCID" property="uniscid" />
        <result column="PRIPID" property="pripid" />
        <result column="REGNO" property="regno" />
        <result column="ENTNAME" property="entname" />
        <result column="UNLOCKREASON" property="unlockreason" />
        <result column="UNLOCKTIME" property="unlockTime" />
        <result column="UNLUSERNAME" property="unlusername" />
        <result column="UNLUSERID" property="unluserid" />
        <result column="ULDEPTID" property="uldeptid" />
        <result column="ULUNITID" property="ulunitid" />
        <result column="UNLDATE" property="unldate" />
        <result column="status" property="status" />
        <result column="handler" property="handler" />
        <result column="LAUPTIME" property="lauptime" />
        <result column="APPROVALDATE" property="approvaldate" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        unLockId, ELID, BIZSEQ, UNISCID, PRIPID, REGNO, ENTNAME, UNLOCKREASON, UNLOCKTIME, UNLUSERNAME, UNLUSERID, ULDEPTID, ULUNITID, UNLDATE, status, handler, LAUPTIME, APPROVALDATE
    </sql>

    <select id="checkpunishlock" resultType="Boolean">
        select count(1) from tsbizpunishunlock where ELID = #{elid} and status in (9,1)
    </select>

</mapper>
