DgArchivesModifyMapper.xml 4.06 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.DgModifyDO">
        <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>
    <!--&lt;!&ndash; 通用查询映射结果 &ndash;&gt;-->
    <!--<resultMap id="SearchResultMap" type="com.pashanhoo.modify.entity.vo.DgArchivesModifyListVO">-->
    <!--    <id column="BSM_ARCHIVES" property="bsmArchives" />-->
    <!--    <result column="XGSJ" property="xgsj" />-->
    <!--    <result column="CREATER" property="creater" />-->
    <!--    <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="bdcdyNum" />-->
    <!--</resultMap>-->
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        BSM_MODIFY,
        BSM_ARCHIVES,
        XGBH,
        YDAXX,
        XDAXX,
        XGNR,
        XGSJ,
        XGR,
        BZ
    </sql>
    <select id="searchDgArchivesModifyList" resultType="com.pashanhoo.modify.entity.vo.DgArchivesModifyListVO">
        select DA.BSM_ARCHIVES,
               DB.DJYWMC,
               DB.DJLX,
               DA.AJH,
               DB.YWH,
               BDCDY.BDCDYH,
               BDCDY.QLR,
               BDCDY.YWR,
               BDCDY.BDCQZH,
               DM.CREATETIME,
               DM.CREATER,
               count(*) over (partition by BDCDY.bdcdyh) as bdcdyNum
        from DG_MODIFY DM
                     join DG_BUSINESS DB on DM.BSM_ARCHIVES = DB.BSM_ARCHIVES
                     join DG_BDCDY BDCDY on DM.BSM_ARCHIVES = BDCDY.BSM_ARCHIVES
                     join DG_ARCHIVES DA on DM.BSM_ARCHIVES = DA.BSM_ARCHIVES
        <where>
            <if test="request.djywmc != null and request.djywmc != ''">
                DB.DJYWMC = #{request.djywmc,jdbcType=VARCHAR}
            </if>
            <if test="request.djlx != null and request.djlx != ''">
                and DB.DJLX = #{request.djlx,jdbcType=VARCHAR}
            </if>
            <if test="request.creater != null and request.creater != ''">
                and DM.CREATER = #{request.creater,jdbcType=VARCHAR}
            </if>
            <if test="request.xgqssj != null">
                <![CDATA[
                and DM.CREATETIME >= #{request.xgqssj,jdbcType=TIMESTAMP}
                ]]>
            </if>
            <if test="request.xgjzsj != null">
                <![CDATA[
                and DM.CREATETIME <= #{request.xgjzsj,jdbcType=TIMESTAMP}
                ]]>
            </if>
            <if test="request.ajh != null and request.ajh != ''">
                and DA.AJH = #{request.ajh,jdbcType=VARCHAR}
            </if>
            <if test="request.ywh != null and request.ywh != ''">
                and DB.YWH = #{request.ywh,jdbcType=VARCHAR}
            </if>
            <if test="request.bdcdyh != null and request.bdcdyh != ''">
                and BDCDY.BDCDYH = #{request.bdcdyh,jdbcType=VARCHAR}
            </if>
            <if test="request.bdcqzh != null and request.bdcqzh != ''">
                and BDCDY.BDCQZH = #{request.bdcqzh,jdbcType=VARCHAR}
            </if>
        </where>
    </select>
</mapper>