CreditScreenErrMapper.xml 5.45 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.credit.cy.business.mapper.CreditScreenErrMapper">
    
    <resultMap type="CreditScreenErr" id="CreditScreenErrResult">
        <result property="id"    column="id"    />
        <result property="type"    column="type"    />
        <result property="wsh"    column="wsh"    />
        <result property="bz"    column="bz"    />
        <result property="creditTime"    column="credit_time"    />
        <result property="creditBy"    column="credit_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="deptName"    column="dept_name"    />
        <result property="deptId"    column="dept_id"    />
    </resultMap>

    <sql id="selectCreditScreenErrVo">
        select id, type, wsh, bz, credit_time, credit_by, update_time, update_by, dept_name, dept_id from credit_screen_err
    </sql>

    <select id="selectCreditScreenErrList" parameterType="CreditScreenErr" resultMap="CreditScreenErrResult">
        <include refid="selectCreditScreenErrVo"/>
        <where>  
            <if test="type != null  and type != ''"> and type = #{type}</if>
            <if test="wsh != null  and wsh != ''"> and wsh concat('%', #{wsh},'%')</if>
            <if test="bz != null  and bz != ''"> and bz = #{bz}</if>
            <if test="creditTime != null "> and credit_time = #{creditTime}</if>
            <if test="creditBy != null  and creditBy != ''"> and credit_by = #{creditBy}</if>
            <if test="deptName != null  and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
            <if test="deptId != null  and deptId != ''"> and dept_id = #{deptId}</if>
        </where>
    </select>

    <select id="queryCreditScreenErrList" parameterType="CreditScreenErr" resultMap="CreditScreenErrResult">
        <include refid="selectCreditScreenErrVo"/>
        <where>
            <if test="type != null  and type != ''"> and type = #{type}</if>
            <if test="wsh != null  and wsh != ''"> and wsh = #{wsh}</if>
            <if test="bz != null  and bz != ''"> and bz = #{bz}</if>
            <if test="startTime!=null and startTime!=''">
                and credit_time > #{startTime}
            </if>
            <if test="endTime!=null and endTime!=''">
                and credit_time &lt;=#{endTime}
            </if>
            <if test="creditBy != null  and creditBy != ''"> and credit_by = #{creditBy}</if>
            <if test="deptName != null  and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
            <if test="deptId != null  and deptId != ''"> and dept_id = #{deptId}</if>
        </where>
        order by credit_time
    </select>
    
    <select id="selectCreditScreenErrById" parameterType="Long" resultMap="CreditScreenErrResult">
        <include refid="selectCreditScreenErrVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertCreditScreenErr" parameterType="CreditScreenErr" useGeneratedKeys="true" keyProperty="id">
        insert into credit_screen_err
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="type != null">type,</if>
            <if test="wsh != null">wsh,</if>
            <if test="bz != null">bz,</if>
            <if test="creditTime != null">credit_time,</if>
            <if test="creditBy != null">credit_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="deptName != null">dept_name,</if>
            <if test="deptId != null">dept_id,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="type != null">#{type},</if>
            <if test="wsh != null">#{wsh},</if>
            <if test="bz != null">#{bz},</if>
            <if test="creditTime != null">#{creditTime},</if>
            <if test="creditBy != null">#{creditBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="deptName != null">#{deptName},</if>
            <if test="deptId != null">#{deptId},</if>
         </trim>
    </insert>

    <update id="updateCreditScreenErr" parameterType="CreditScreenErr">
        update credit_screen_err
        <trim prefix="SET" suffixOverrides=",">
            <if test="type != null">type = #{type},</if>
            <if test="wsh != null">wsh = #{wsh},</if>
            <if test="bz != null">bz = #{bz},</if>
            <if test="creditTime != null">credit_time = #{creditTime},</if>
            <if test="creditBy != null">credit_by = #{creditBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="deptName != null">dept_name = #{deptName},</if>
            <if test="deptId != null">dept_id = #{deptId},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteCreditScreenErrById" parameterType="Long">
        delete from credit_screen_err where id = #{id}
    </delete>

    <delete id="deleteCreditScreenErrByIds" parameterType="String">
        delete from credit_screen_err where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>

</mapper>