DgArchivesMapper.xml 3.72 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.archive.mapper.DgArchivesMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.pashanhoo.archive.entity.DgArchivesDO">
        <id column="BSM_ARCHIVES" property="bsmArchives" />
        <result column="AJBT" property="ajbt" />
        <result column="ZTC" property="ztc" />
        <result column="FLH" property="flh" />
        <result column="MLH" property="mlh" />
        <result column="AJH" property="ajh" />
        <result column="ND" property="nd" />
        <result column="JS" property="js" />
        <result column="YS" property="ys" />
        <result column="BGQX" property="bgqx" />
        <result column="QSRQ" property="qsrq" />
        <result column="ZZRQ" property="zzrq" />
        <result column="MJ" property="mj" />
        <result column="HH" property="hh" />
        <result column="CFWZ" property="cfwz" />
        <result column="CJR" property="cjr" />
        <result column="CJRQ" property="cjrq" />
        <result column="HCR" property="hcr" />
        <result column="BZ" property="bz" />
        <result column="SMZT" property="smzt" />
        <result column="DAZT" property="dazt" />
        <result column="CDJGBM" property="cdjgbm" />
        <result column="DALY" property="daly" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        BSM_ARCHIVES, AJBT, ZTC, FLH, MLH, AJH, ND, JS, YS, BGQX, QSRQ, ZZRQ, MJ, HH, CFWZ, CJR, CJRQ, HCR, BZ, SMZT, DAZT, CDJGBM, DALY
    </sql>
    <update id="updateArchivesInfoByReceiveIdList">
        update DG_ARCHIVES a set a.dazt=#{dazt,jdbcType=VARCHAR} where exists (
         select 1 from dg_receive_relation b where  a.BSM_ARCHIVES=b.BSM_ARCHIVES
         and b.bms_receive in
        <foreach collection="idList" index="index" item="item"
                 separator="," open="(" close=")">
            #{item,jdbcType=VARCHAR}
        </foreach>
        )
    </update>

    <select id="searchArchive" resultType="com.pashanhoo.archive.entity.vo.SearchArchiveVO">
        select rownum as xh,
        DA.BSM_ARCHIVES,
        DA.DAZT,
        DA.DALY,
        DA.AJH,
        DA.CFWZ,
        DA.HH,
        D.BDCQZH,
        D.QLR,
        D.YWR,
        DB.YWH,
        D.BDCDYH,
        DB.QLLX
        from DG_ARCHIVES DA
        join DG_BUSINESS DB on DA.BSM_ARCHIVES = DB.BSM_ARCHIVES
        join DG_BDCDY D on DA.BSM_ARCHIVES = D.BSM_ARCHIVES
        <where>
            <if test="request.ajh != null and request.ajh != ''">
                AJH = #{request.ajh,jdbcType=VARCHAR}
            </if>
            <if test="request.mlh != null and request.mlh != ''">
                and MLH = #{request.mlh,jdbcType=VARCHAR}
            </if>
            <if test="request.hh != null and request.hh != ''">
                and HH = #{request.hh,jdbcType=VARCHAR}
            </if>
            <if test="request.dazt != null and request.dazt != ''">
                and DAZT = #{request.dazt,jdbcType=VARCHAR}
            </if>
            <if test="request.ywh != null and request.ywh != ''">
                and YWH = #{request.ywh,jdbcType=VARCHAR}
            </if>
            <if test="request.bdcqzh != null and request.bdcqzh != ''">
                and BDCQZH = #{request.bdcqzh,jdbcType=VARCHAR}
            </if>
            <if test="request.bdcdyh != null and request.bdcdyh != ''">
                and BDCDYH = #{request.bdcdyh,jdbcType=VARCHAR}
            </if>
            <if test="request.qllx != null and request.qllx != ''">
                and QLLX = #{request.qllx,jdbcType=VARCHAR}
            </if>
        </where>
    </select>

</mapper>