DgArchivesModifyMapper.xml 2.67 KB
<?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.pashanhoo.modify.mapper.DgArchivesModifyMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.pashanhoo.modify.entity.DgArchivesModifyDO">
        <id column="BSM_MODIFY" property="bsmModify" />
        <result column="BSM_ARCHIVES" property="bsmArchives" />
        <result column="XGBH" property="xgbh" />
        <result column="YDAXX" property="ydaxx" />
        <result column="XDAXX" property="xdaxx" />
        <result column="XGNR" property="xgnr" />
        <result column="XGSJ" property="xgsj" />
        <result column="XGR" property="xgr" />
        <result column="BZ" property="bz" />
    </resultMap>
    <!-- 通用查询映射结果 -->
    <resultMap id="SearchResultMap" type="com.pashanhoo.modify.entity.vo.DgArchivesModifyListVO">
        <id column="BSM_ARCHIVES" property="bsm_archives" />
        <result column="XGSJ" property="xgsj" />
        <result column="XGR" property="xgr" />
        <result column="DJLX" property="djlx" />
        <result column="DJJGMC" property="djjgmc" />
        <result column="AJH" property="ajh" />
        <result column="YWH" property="ywh" />
        <result column="BDCDYH" property="bdcdyh" />
        <result column="QLR" property="qlr" />
        <result column="YWR" property="ywr" />
        <result column="BDCQZH" property="bdcqzh" />
        <result column="BDCDY_NUM" property="bdcdy_num" />
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        BSM_MODIFY, BSM_ARCHIVES, XGBH, YDAXX, XDAXX, XGNR, XGSJ, XGR, BZ
    </sql>
    <select id="searchDgArchivesModifyList" resultMap="SearchResultMap">
        select a.bsm_archives,a.xgsj,a.xgr,b.djlx,b.djjgmc,d.ajh,b.ywh,c.bdcdyh,c.qlr,c.ywr,c.BDCQZH,count(1) over(partition by c.bdcdyh) bdcdy_num
        from dg_archives_modify a, dg_business b, dg_bdcdy c,dg_archives d
        where a.bsm_archives = d.bsm_archives
        and a.bsm_archives=d.bsm_archives
        and c.bsm_archives=d.bsm_archives
        <if test="ywh != null and ywh!='' ">
            and b.ywh=#{ywh,jdbcType=VARCHAR}
        </if>
        <if test="djjgbm != null and djjgbm!='' ">
            and b.djjgbm=#{djjgbm,jdbcType=VARCHAR}
        </if>
        <if test="djlx != null and djlx!='' ">
            and b.djlx=#{djlx,jdbcType=VARCHAR}
        </if>
        <if test="xgr != null and xgr!='' ">
            and a.xgr=#{xgr,jdbcType=VARCHAR}
        </if>
        <if test="xgsj != null and xgsj!='' ">
            and a.xgsj=#{xgsj,jdbcType=VARCHAR}
        </if>


    </select>
</mapper>