<?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.tofly.feesapi.wxgl.wechatbasicmgt.mapper.WxTstzMapper">
    <select id="SelectChargeMaxCode" resultType="BigDecimal">
        select nvl(max(id), 0) id
        from WX_TSTZ
    </select>

    <select id="selectWxTsNoticePage" resultType="com.tofly.feesapi.wxgl.wechatbasicmgt.entity.WxTstz">

        select
            *
        from
            WX_TSTZ
        where 1=1
        <!--模糊查询 -->
        <if test="searchText != null and searchText != ''">
            and (STOP_AREA like '%${searchText}%' or EDIT_NAME like '%${searchText}%' or TITLE like
            '%${searchText}%' or REMARK like '%${searchText}%' )
        </if>
        <if test="state != null and state != '' and state!='all'">
            and state=#{state}
        </if>
        <if test="editDateStart != null and editDateEnd != null and editDateStart != '' and editDateEnd !=''">
            and EDIT_DATE between to_date( #{editDateStart},'yyyy-mm-dd hh24:mi:ss') and
            to_date( #{editDateEnd},'yyyy-mm-dd hh24:mi:ss')
        </if>
    </select>

    <resultMap id="wxTstzMap" type="com.tofly.feesapi.wxgl.wechatbasicmgt.entity.WxTstz">
        <id property="id" column="ID"/>
        <result property="clnum" column="CLNUM"/>
        <result property="clnumsus" column="CLNUMSUS"/>
        <result property="clnuerr" column="CLNUERR"/>
        <result property="editDate" column="EDIT_DATE"/>
        <result property="editCode" column="EDIT_CODE"/>
        <result property="editName" column="EDIT_NAME"/>
        <result property="title" column="TITLE"/>
        <result property="state" column="STATE"/>
        <result property="type" column="TYPE"/>
        <result property="stopArea" column="STOP_AREA"/>
        <result property="stopTime" column="STOP_TIME"/>
        <result property="remark" column="REMARK"/>
        <result property="restoreTime" column="RESTORE_TIME"/>
        <result property="clLock" column="CL_LOCK"/>
        <result property="auditFlag" column="AUDIT_FLAG"/>
        <result property="auditResult" column="AUDIT_RESULT"/>
        <result property="auditCode" column="AUDIT_CODE"/>
        <result property="auditName" column="AUDIT_NAME"/>
        <result property="auditDate" column="AUDIT_DATE"/>
        <result property="auditRemark" column="AUDIT_REMARK"/>
        <result property="printTimes" column="PRINT_TIMES"/>
        <result property="stopReason" column="STOP_REASON"/>
    </resultMap>
</mapper>
