<?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.mosty.base.manager.mapper.VwSydwJbxxGxMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.mosty.base.model.entity.afjcsj.VwSydwJbxxGx">
        <result column="XXSBZH" property="xxsbzh"/>
        <result column="ZCDZ" property="zcdz"/>
        <result column="GLDJ" property="gldj"/>
        <result column="XT_LRRID" property="xtLrrid"/>
        <result column="XT_LRIP" property="xtLrip"/>
        <result column="SFYTP" property="sfytp"/>
        <result column="DEP_FIRSTENTER_TIME" property="depFirstenterTime"/>
        <result column="SJDWID" property="sjdwid"/>
        <result column="DWLXDH" property="dwlxdh"/>
        <result column="LXRZJHM" property="lxrzjhm"/>
        <result column="LXRLXDH" property="lxrlxdh"/>
        <result column="SJDM" property="sjdm"/>
        <result column="DWSCJP" property="dwscjp"/>
        <result column="LXRXM" property="lxrxm"/>
        <result column="DWXZ" property="dwxz"/>
        <result column="DZ_DWDZMLPDM" property="dzDwdzmlpdm"/>
        <result column="ZCRQ" property="zcrq"/>
        <result column="ZCDZBH" property="zcdzbh"/>
        <result column="JKGS" property="jkgs"/>
        <result column="XT_ZHXGSJ" property="xtZhxgsj"/>
        <result column="LXRGJDM" property="lxrgjdm"/>
        <result column="BMJB" property="bmjb"/>
        <result column="DZ_DWDZXZ" property="dzDwdzxz"/>
        <result column="XT_TIMESTAMP" property="xtTimestamp"/>
        <result column="BZ" property="bz"/>
        <result column="WHKSRQ" property="whksrq"/>
        <result column="DWFL" property="dwfl"/>
        <result column="LXRZJLX" property="lxrzjlx"/>
        <result column="SXZW" property="sxzw"/>
        <result column="DWDZS" property="dwdzs"/>
        <result column="ZZJGDM" property="zzjgdm"/>
        <result column="DWMCJP" property="dwmcjp"/>
        <result column="XT_ZXYY" property="xtZxyy"/>
        <result column="XT_LRRXM" property="xtLrrxm"/>
        <result column="WHJZRQ" property="whjzrq"/>
        <result column="DEP_ACTION_FLAG" property="depActionFlag"/>
        <result column="DWDZSC" property="dwdzsc"/>
        <result column="SFBD" property="sfbd"/>
        <result column="CQZQ" property="cqzq"/>
        <result column="DZ_DWDZDM" property="dzDwdzdm"/>
        <result column="ID" property="id"/>
        <result column="SSZRQDM" property="sszrqdm"/>
        <result column="ZPFMID" property="zpfmid"/>
        <result column="ZXYYBZ" property="zxyybz"/>
        <result column="CYRS" property="cyrs"/>
        <result column="WLJDSBDZH" property="wljdsbdzh"/>
        <result column="DWMC" property="dwmc"/>
        <result column="SWDJH" property="swdjh"/>
        <result column="XT_ZXBZ" property="xtZxbz"/>
        <result column="XXSBMM" property="xxsbmm"/>
        <result column="YYZZH" property="yyzzh"/>
        <result column="JYFW" property="jyfw"/>
        <result column="SJDW" property="sjdw"/>
        <result column="ZBY" property="zby"/>
        <result column="ZCZB" property="zczb"/>
        <result column="SJLYBS" property="sjlybs"/>
        <result column="XT_CJSJ" property="xtCjsj"/>
        <result column="ZAFZR" property="zafzr"/>
        <result column="YXQZ" property="yxqz"/>
        <result column="XT_LRRBM" property="xtLrrbm"/>
        <result column="DWBH" property="dwbh"/>
        <result column="XT_LRSJ" property="xtLrsj"/>
        <result column="SSFJDM" property="ssfjdm"/>
        <result column="SCBJ" property="scbj"/>
        <result column="DZ_DWDZSSXDM" property="dzDwdzssxdm"/>
        <result column="XT_ZHXGRBMID" property="xtZhxgrbmid"/>
        <result column="XT_LRRBMID" property="xtLrrbmid"/>
        <result column="XT_ZHXGRBM" property="xtZhxgrbm"/>
        <result column="LXRGMSFHM" property="lxrgmsfhm"/>
        <result column="FZRQ" property="fzrq"/>
        <result column="SJMC" property="sjmc"/>
        <result column="SSDQ" property="ssdq"/>
        <result column="SFYSPJK" property="sfyspjk"/>
        <result column="XT_ZHXGRXM" property="xtZhxgrxm"/>
        <result column="XT_ZHXGRID" property="xtZhxgrid"/>
        <result column="XT_ZHXGIP" property="xtZhxgip"/>
        <result column="SSPCSDM" property="sspcsdm"/>
        <result column="WHZT" property="whzt"/>
        <result column="DZ_DWDZMLPXZ" property="dzDwdzmlpxz"/>
        <result column="OLD_ID" property="oldId"/>
        <result column="DWSC" property="dwsc"/>
        <result column="XZBJ" property="xzbj"/>
        <result column="DEP_ACTION_TIME" property="depActionTime"/>
        <result column="OLD_SJDWID" property="oldSjdwid"/>
        <result column="WLJDSBDMM" property="wljdsbdmm"/>
        <result column="BARS" property="bars"/>
        <result column="ZBX" property="zbx"/>
        <result column="ETL_OPER_TYPE" property="etlOperType"/>
        <result column="ETL_TIMESTAMP" property="etlTimestamp"/>
        <result column="ETL_UPDATE_TIME" property="etlUpdateTime"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        XXSBZH, ZCDZ, GLDJ, XT_LRRID, XT_LRIP, SFYTP, DEP_FIRSTENTER_TIME, SJDWID, DWLXDH,
        LXRZJHM, LXRLXDH, SJDM, DWSCJP, LXRXM, DWXZ, DZ_DWDZMLPDM, ZCRQ, ZCDZBH, JKGS, XT_ZHXGSJ,
        LXRGJDM, BMJB, DZ_DWDZXZ, XT_TIMESTAMP, BZ, WHKSRQ, DWFL, LXRZJLX, SXZW, DWDZS, ZZJGDM,
        DWMCJP, XT_ZXYY, XT_LRRXM, WHJZRQ, DEP_ACTION_FLAG, DWDZSC, SFBD, CQZQ, DZ_DWDZDM, ID,
        SSZRQDM, ZPFMID, ZXYYBZ, CYRS, WLJDSBDZH, DWMC, SWDJH, XT_ZXBZ, XXSBMM, YYZZH, JYFW,
        SJDW, ZBY, ZCZB, SJLYBS, XT_CJSJ, ZAFZR, YXQZ, XT_LRRBM, DWBH, XT_LRSJ, SSFJDM, SCBJ,
        DZ_DWDZSSXDM, XT_ZHXGRBMID, XT_LRRBMID, XT_ZHXGRBM, LXRGMSFHM, FZRQ, SJMC, SSDQ, SFYSPJK,
        XT_ZHXGRXM, XT_ZHXGRID, XT_ZHXGIP, SSPCSDM, WHZT, DZ_DWDZMLPXZ, OLD_ID, DWSC, XZBJ, DEP_ACTION_TIME,
        OLD_SJDWID, WLJDSBDMM, BARS, ZBX, ETL_OPER_TYPE, ETL_TIMESTAMP, ETL_UPDATE_TIME
    </sql>

    <select id="selectSydwList" resultType="com.mosty.base.model.entity.afjcsj.VwSydwJbxxGx">
        select * from af_jcsj.vw_sydw_jbxx_gx a where xt_zxbz = '0'
        <if test="dto.keyword != null and dto.keyword != ''">
            and match(a.zcdz,a.dwlxdh,a.dz_dwdzxz,a.dwmc) against (#{dto.keyword})
        </if>
        <if test="dto.gldj != null and dto.gldj != ''">
            and a.gldj = #{dto.gldj}
        </if>
        limit #{pageIndex},#{pageSize}
    </select>

    <select id="selectSydwCount" resultType="java.lang.Integer">
        select count(1) from af_jcsj.vw_sydw_jbxx_gx a where xt_zxbz = '0'
        <if test="dto.keyword != null and dto.keyword != ''">
            and match(a.zcdz,a.dwlxdh,a.dz_dwdzxz,a.dwmc) against (#{dto.keyword})
        </if>
        <if test="dto.gldj != null and dto.gldj != ''">
            and a.gldj = #{dto.gldj}
        </if>
    </select>

    <select id="getStatistics" resultType="java.util.Map">
        select count(gldj) count,gldj from af_jcsj.vw_sydw_jbxx_gx where xt_zxbz = '0' group by gldj
    </select>
</mapper>
