DgArchivesReplenishMapper.xml 2.25 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.replenish.mapper.DgArchivesReplenishMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.pashanhoo.replenish.entity.DgArchivesReplenishDO">
        <id column="BSM_MODIFY" property="bsmModify"/>
        <result column="BSM_ARCHIVES" property="bsmArchives"/>
        <result column="BLBH" property="blbh"/>
        <result column="CREATETIME" property="createTime"/>
        <result column="CREATER" property="creater"/>
        <result column="BZ" property="bz"/>
    </resultMap>

    <select id="search" resultType="com.pashanhoo.replenish.entity.vo.DgArchivesReplenishListVO">
        select DGR.BSM_ARCHIVES,
               DGR.BSM_MODIFY,
               DB.QLLX,
               DB.DJLX,
               DA.AJH,
               DB.YWH,
               BDCDY.BDCDYH,
               BDCDY.QLR,
               BDCDY.YWR,
               BDCDY.BDCQZH,
               DGR.CREATETIME,
               DGR.CREATER,
               DGR.STATE,
               count(1) over (partition by BDCDY.BSM_ARCHIVES) as bdcdyNum
        from DG_REPLENISH DGR
                     join DG_ARCHIVES DA on DA.BSM_ARCHIVES = DGR.BSM_ARCHIVES
                     join DG_BDCDY BDCDY on BDCDY.BSM_ARCHIVES = DGR.BSM_ARCHIVES
                     join DG_BUSINESS DB on DB.BSM_ARCHIVES = DGR.BSM_ARCHIVES
        <where>
            <if test="request.ywh != null and request.ywh != ''">
                DB.YWH = #{request.ywh,jdbcType=VARCHAR}
            </if>
            <if test="request.qllx != null and request.qllx != ''">
                and DB.QLLX = #{request.qllx,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 DGR.CREATER = #{request.creater,jdbcType=VARCHAR}
            </if>
            <if test="request.createTime != null">
                and DGR.CREATETIME = #{request.createTime,jdbcType=TIMESTAMP}
            </if>
        </where>
    </select>
</mapper>