<?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.TsbizPunishLockMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.chinaweal.aiccs.aiccs.punishment.entity.TsbizPunishLock">
        <id column="lockId" property="lockId" />
        <result column="BIZSEQ" property="bizseq" />
        <result column="PRIPID" property="pripid" />
        <result column="REGNO" property="regno" />
        <result column="UNISCID" property="uniscid" />
        <result column="ENTNAME" property="entname" />
        <result column="punishFrom" property="punishFrom" />
        <result column="punishInfoId" property="punishInfoId" />
        <result column="LOCKREASON" property="lockreason" />
        <result column="LOCKUSERNAME" property="lockusername" />
        <result column="LOCKUSERID" property="lockuserid" />
        <result column="LOCKUSERDEPTID" property="lockuserdeptid" />
        <result column="LOCKUSERUNITID" property="lockuserunitid" />
        <result column="LOCKSTARTDATE" property="lockstartdate" />
        <result column="LOCKENDDATE" property="lockenddate" />
        <result column="LOCKTYPE" property="locktype" />
        <result column="LOCKSTATE" property="lockstate" />
        <result column="status" property="status" />
        <result column="handler" property="handler" />
        <result column="LAUPTIME" property="lauptime" />
        <result column="MEASURE" property="measure" />
        <result column="APPROVALDATE" property="approvaldate" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        lockId, BIZSEQ, PRIPID,MEASURE, UNISCID, REGNO, ENTNAME, punishFrom, punishInfoId, LOCKREASON, LOCKUSERNAME, LOCKUSERID, LOCKUSERDEPTID, LOCKUSERUNITID, LOCKSTARTDATE, LOCKENDDATE, LOCKTYPE, LOCKSTATE, status, handler, LAUPTIME, APPROVALDATE
    </sql>

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