trnlogmapper.xml 9.84 KB
Newer Older
hulei committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
<?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.brilliance.isc.mda.dao.TrnlogMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.common.trnlog.Trnlog">
        <result property="inr" column="inr" jdbcType="VARCHAR" />
        <result property="oprbegdat" column="oprbegdat" jdbcType="DATE" />
        <result property="oprenddat" column="oprenddat" jdbcType="DATE" />
        <result property="oprusrinr" column="oprusrinr" jdbcType="VARCHAR" />
        <result property="oprusr" column="oprusr" jdbcType="VARCHAR" />
        <result property="oprbchinr" column="oprbchinr" jdbcType="VARCHAR" />
        <result property="oprbch" column="oprbch" jdbcType="VARCHAR" />
        <result property="objnam" column="objnam" jdbcType="VARCHAR" />
        <result property="objtyp" column="objtyp" jdbcType="VARCHAR" />
        <result property="rptno" column="rptno" jdbcType="VARCHAR" />
        <result property="oprdet" column="oprdet" jdbcType="VARCHAR" />
        <result property="sta" column="sta" jdbcType="VARCHAR" />
        <result property="dblinr" column="dblinr" jdbcType="VARCHAR" />
        <result property="lsh" column="lsh" jdbcType="VARCHAR" />
        <result property="oprusrnam" column="oprusrnam" jdbcType="VARCHAR" />
        <result property="oprbchnam" column="oprbchnam" jdbcType="VARCHAR" />
    </resultMap>

    <sql id="Base_Column_List">
        inr,oprbegdat,oprenddat,oprusrinr,oprusr,oprbchinr,oprbch,objnam,objtyp,rptno,oprdet,sta,dblinr,lsh,oprusrnam,oprbchnam
    </sql>

    <select id="selectByPrimaryKey" resultMap="BaseResultMap">
        select
            <include refid="Base_Column_List" />
        from trnlog
        where inr = #{inr,jdbcType=VARCHAR}
    </select>

    <delete id="deleteByPrimaryKey">
        delete from trnlog
        where inr = #{inr,jdbcType=VARCHAR}
    </delete>

    <insert id="insert">
        insert into trnlog (<include refid="Base_Column_List" />)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{oprbegdat,jdbcType=DATE},
            #{oprenddat,jdbcType=DATE},
            #{oprusrinr,jdbcType=VARCHAR},
            #{oprusr,jdbcType=VARCHAR},
            #{oprbchinr,jdbcType=VARCHAR},
            #{oprbch,jdbcType=VARCHAR},
            #{objnam,jdbcType=VARCHAR},
            #{objtyp,jdbcType=VARCHAR},
            #{rptno,jdbcType=VARCHAR},
            #{oprdet,jdbcType=VARCHAR},
            #{sta,jdbcType=VARCHAR},
            #{dblinr,jdbcType=VARCHAR},
            #{lsh,jdbcType=VARCHAR},
            #{oprusrnam,jdbcType=VARCHAR},
            #{oprbchnam,jdbcType=VARCHAR},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into trnlog
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inr != null">inr,</if>
            <if test="oprbegdat != null">oprbegdat,</if>
            <if test="oprenddat != null">oprenddat,</if>
            <if test="oprusrinr != null">oprusrinr,</if>
            <if test="oprusr != null">oprusr,</if>
            <if test="oprbchinr != null">oprbchinr,</if>
            <if test="oprbch != null">oprbch,</if>
            <if test="objnam != null">objnam,</if>
            <if test="objtyp != null">objtyp,</if>
            <if test="rptno != null">rptno,</if>
            <if test="oprdet != null">oprdet,</if>
            <if test="sta != null">sta,</if>
            <if test="dblinr != null">dblinr,</if>
            <if test="lsh != null">lsh,</if>
            <if test="oprusrnam != null">oprusrnam,</if>
            <if test="oprbchnam != null">oprbchnam,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="inr != null">#{inr,jdbcType=VARCHAR}, </if>
            <if test="oprbegdat != null">#{oprbegdat,jdbcType=DATE}, </if>
            <if test="oprenddat != null">#{oprenddat,jdbcType=DATE}, </if>
            <if test="oprusrinr != null">#{oprusrinr,jdbcType=VARCHAR}, </if>
            <if test="oprusr != null">#{oprusr,jdbcType=VARCHAR}, </if>
            <if test="oprbchinr != null">#{oprbchinr,jdbcType=VARCHAR}, </if>
            <if test="oprbch != null">#{oprbch,jdbcType=VARCHAR}, </if>
            <if test="objnam != null">#{objnam,jdbcType=VARCHAR}, </if>
            <if test="objtyp != null">#{objtyp,jdbcType=VARCHAR}, </if>
            <if test="rptno != null">#{rptno,jdbcType=VARCHAR}, </if>
            <if test="oprdet != null">#{oprdet,jdbcType=VARCHAR}, </if>
            <if test="sta != null">#{sta,jdbcType=VARCHAR}, </if>
            <if test="dblinr != null">#{dblinr,jdbcType=VARCHAR}, </if>
            <if test="lsh != null">#{lsh,jdbcType=VARCHAR}, </if>
            <if test="oprusrnam != null">#{oprusrnam,jdbcType=VARCHAR}, </if>
            <if test="oprbchnam != null">#{oprbchnam,jdbcType=VARCHAR}, </if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective">
        update trnlog
        <set>
            <if test="oprbegdat != null">oprbegdat = #{oprbegdat,jdbcType=DATE},</if>
            <if test="oprenddat != null">oprenddat = #{oprenddat,jdbcType=DATE},</if>
            <if test="oprusrinr != null">oprusrinr = #{oprusrinr,jdbcType=VARCHAR},</if>
            <if test="oprusr != null">oprusr = #{oprusr,jdbcType=VARCHAR},</if>
            <if test="oprbchinr != null">oprbchinr = #{oprbchinr,jdbcType=VARCHAR},</if>
            <if test="oprbch != null">oprbch = #{oprbch,jdbcType=VARCHAR},</if>
            <if test="objnam != null">objnam = #{objnam,jdbcType=VARCHAR},</if>
            <if test="objtyp != null">objtyp = #{objtyp,jdbcType=VARCHAR},</if>
            <if test="rptno != null">rptno = #{rptno,jdbcType=VARCHAR},</if>
            <if test="oprdet != null">oprdet = #{oprdet,jdbcType=VARCHAR},</if>
            <if test="sta != null">sta = #{sta,jdbcType=VARCHAR},</if>
            <if test="dblinr != null">dblinr = #{dblinr,jdbcType=VARCHAR},</if>
            <if test="lsh != null">lsh = #{lsh,jdbcType=VARCHAR},</if>
            <if test="oprusrnam != null">oprusrnam = #{oprusrnam,jdbcType=VARCHAR},</if>
            <if test="oprbchnam != null">oprbchnam = #{oprbchnam,jdbcType=VARCHAR},</if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <update id="updateByPrimaryKey">
        update trnlog
        <set>
            oprbegdat = #{oprbegdat,jdbcType=DATE},
            oprenddat = #{oprenddat,jdbcType=DATE},
            oprusrinr = #{oprusrinr,jdbcType=VARCHAR},
            oprusr = #{oprusr,jdbcType=VARCHAR},
            oprbchinr = #{oprbchinr,jdbcType=VARCHAR},
            oprbch = #{oprbch,jdbcType=VARCHAR},
            objnam = #{objnam,jdbcType=VARCHAR},
            objtyp = #{objtyp,jdbcType=VARCHAR},
            rptno = #{rptno,jdbcType=VARCHAR},
            oprdet = #{oprdet,jdbcType=VARCHAR},
            sta = #{sta,jdbcType=VARCHAR},
            dblinr = #{dblinr,jdbcType=VARCHAR},
            lsh = #{lsh,jdbcType=VARCHAR},
            oprusrnam = #{oprusrnam,jdbcType=VARCHAR},
            oprbchnam = #{oprbchnam,jdbcType=VARCHAR},
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <delete id="deleteByIds">
        delete from act where inr in
        <foreach item="item" index="index" collection="collection" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>

    <delete id="dyncDelete">
        ${sql}
    </delete>

    <select id="dyncRead" resultMap="BaseResultMap">
        ${sql}
    </select>

    <select id="selectLogUserByPage" resultMap="BaseResultMap" parameterType="com.brilliance.isc.common.trnlog.LogUserVo">
        select
        <include refid="Base_Column_List" />
        from trnlog where 1=1
            <if test='objnam != null and objnam != "" '>
                and  objnam =#{objnam}
            </if>
            <if test='objtyp != null and objtyp != "" '>
                and  objtyp =#{objtyp}
            </if>
            <if test='rptno != null and rptno != "" '>
                and  rptno =#{rptno}
            </if>
            <if test='oprusr != null and oprusr != "" '>
                and  oprusr =#{oprusr}
            </if>
            <if test='oprbch != null and oprbch != "" '>
                and  oprbch =#{oprbch}
            </if>
            <if test='frmdat != null'>
                and  oprenddat <![CDATA[ >= ]]> date_format(#{frmdat},'%Y-%m-%d')
            </if>
            <if test='tildat != null'>
                and  oprenddat <![CDATA[ <= ]]> date_format(#{tildat},'%Y-%m-%d')
            </if>
            order by oprenddat ASC

    </select>

    <select id="selectByLogpVo" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from trnlog m1 where sta='0'
        <if test='objnam != null and objnam != "" '>
            and  m1.objnam =#{objnam}
        </if>
        <if test='objtyp != null and objtyp != "" '>
            and  m1.objtyp =#{objtyp}
        </if>
        <if test="branchInrs != null and branchInrs.size() >0 ">
            and (
            m1.oprbchinr in
            <foreach item="branchinr" collection="branchInrs" open="(" separator="," close=")">
                #{branchinr}
            </foreach>
            or m1.oprbchinr is null
            )
        </if>
        <if test='rptno != null and rptno != "" '>
            and m1.rptno like concat('%',#{rptno},'%')
        </if>
        <if test='oprusr != null and oprusr != "" '>
            and m1.oprusr like concat('%',#{oprusr},'%')
        </if>
        <if test='oprbch != null and oprbch != "" '>
            and m1.oprbch like concat('%',#{oprbch},'%')
        </if>
        <if test="strdat !=null">
            and m1.oprbegdat &gt;=#{strdat}
        </if>
        <if test="enddat !=null">
            and m1.oprbegdat &lt;=#{enddat}
        </if>
        order by m1.oprbegdat DESC
    </select>
</mapper>