CreditIndexParentMapper.xml 5.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.credit.cy.business.mapper.CreditIndexParentMapper">
    
    <resultMap type="CreditIndexParent" id="CreditIndexParentResult">
        <result property="id"    column="id"    />
        <result property="reportNo"    column="report_no"    />
        <result property="reportType"    column="report_type"    />
        <result property="reportDate"    column="report_date"    />
        <result property="reportDept"    column="report_dept"    />
        <result property="checkStatus"    column="check_status"    />
        <result property="reportOperate"    column="report_operate"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>

    <sql id="selectCreditIndexParentVo">
        select id, report_no, report_type, report_date, report_dept, check_status, report_operate, del_flag, create_by, create_time, update_by, update_time from credit_index_parent
    </sql>

    <select id="selectCreditIndexParentList" parameterType="CreditIndexParent" resultMap="CreditIndexParentResult">
        <include refid="selectCreditIndexParentVo"/>
        <where>  
            <if test="reportNo != null  and reportNo != ''"> and report_no = #{reportNo}</if>
            <if test="reportType != null  and reportType != ''"> and report_type = #{reportType}</if>
            <if test="reportDate != null "> and report_date = #{reportDate}</if>
            <if test="reportDept != null  and reportDept != ''"> and report_dept = #{reportDept}</if>
            <if test="checkStatus != null "> and check_status = #{checkStatus}</if>
            <if test="reportOperate != null "> and report_operate = #{reportOperate}</if>
        </where>
    </select>
    
    <select id="selectCreditIndexParentById" parameterType="Long" resultMap="CreditIndexParentResult">
        <include refid="selectCreditIndexParentVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertCreditIndexParent" parameterType="CreditIndexParent" useGeneratedKeys="true" keyProperty="id">
        insert into credit_index_parent
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="reportNo != null and reportNo != ''">report_no,</if>
            <if test="reportType != null and reportType != ''">report_type,</if>
            <if test="reportDate != null">report_date,</if>
            <if test="reportDept != null">report_dept,</if>
            <if test="checkStatus != null">check_status,</if>
            <if test="reportOperate != null">report_operate,</if>
            <if test="delFlag != null">del_flag,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="reportNo != null and reportNo != ''">#{reportNo},</if>
            <if test="reportType != null and reportType != ''">#{reportType},</if>
            <if test="reportDate != null">#{reportDate},</if>
            <if test="reportDept != null">#{reportDept},</if>
            <if test="checkStatus != null">#{checkStatus},</if>
            <if test="reportOperate != null">#{reportOperate},</if>
            <if test="delFlag != null">#{delFlag},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
         </trim>
    </insert>

    <update id="updateCreditIndexParent" parameterType="CreditIndexParent">
        update credit_index_parent
        <trim prefix="SET" suffixOverrides=",">
            <if test="reportNo != null and reportNo != ''">report_no = #{reportNo},</if>
            <if test="reportType != null and reportType != ''">report_type = #{reportType},</if>
            <if test="reportDate != null">report_date = #{reportDate},</if>
            <if test="reportDept != null">report_dept = #{reportDept},</if>
            <if test="checkStatus != null">check_status = #{checkStatus},</if>
            <if test="reportOperate != null">report_operate = #{reportOperate},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteCreditIndexParentById" parameterType="Long">
        delete from credit_index_parent where id = #{id}
    </delete>

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

</mapper>