CreditDissentMapper.xml 11.2 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.CreditDissentMapper">
    
    <resultMap type="CreditDissent" id="CreditDissentResult">
        <result property="id"    column="id"    />
        <result property="dissentId"    column="dissent_id"    />
        <result property="cardCode"    column="card_code"    />
        <result property="applyName"    column="apply_name"    />
        <result property="mobile"    column="mobile"    />
        <result property="counterpartName"    column="counterpart_name"    />
        <result property="counterpartCode"    column="counterpart_code"    />
        <result property="proveFiles"    column="prove_files"    />
        <result property="dissentType"    column="dissent_type"    />
        <result property="fileStatus"    column="file_status"    />
        <result property="applyFrom"    column="apply_from"    />
        <result property="applyTime"    column="apply_time"    />
        <result property="dataOrg"    column="data_org"    />
        <result property="portalUser"    column="portal_user"    />
        <result property="handleDept"    column="handle_dept"    />
        <result property="handleUser"    column="handle_user"    />
        <result property="forwardStatus"    column="forward_status"    />
        <result property="dissentStatus"    column="dissent_status"    />
        <result property="dissentContent"    column="dissent_content"    />
        <result property="dissentDescribe"    column="dissent_describe"    />
        <result property="dissentResult"    column="dissent_result"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="updateBy"    column="update_by"    />
    </resultMap>

    <sql id="selectCreditDissentVo">
        select id, dissent_id, card_code, apply_name, mobile, counterpart_name, counterpart_code, prove_files, dissent_type, file_status, apply_from, apply_time, data_org, portal_user, handle_dept, handle_user, forward_status, dissent_status, dissent_content, dissent_result,dissent_describe, create_time, update_time, update_by from credit_dissent
    </sql>

    <select id="selectCreditDissentList" parameterType="CreditDissent" resultMap="CreditDissentResult">
        <include refid="selectCreditDissentVo"/>
        <where>  
            <if test="dissentId != null "> and dissent_id = #{dissentId}</if>
            <if test="cardCode != null  and cardCode != ''"> and card_code = #{cardCode}</if>
            <if test="applyName != null  and applyName != ''"> and apply_name like concat('%', #{applyName}, '%')</if>
            <if test="mobile != null  and mobile != ''"> and mobile = #{mobile}</if>
            <if test="counterpartName != null  and counterpartName != ''"> and counterpart_name like concat('%', #{counterpartName}, '%')</if>
            <if test="counterpartCode != null  and counterpartCode != ''"> and counterpart_code = #{counterpartCode}</if>
            <if test="proveFiles != null  and proveFiles != ''"> and prove_files = #{proveFiles}</if>
            <if test="dissentType != null  and dissentType != ''"> and dissent_type = #{dissentType}</if>
            <if test="fileStatus != null  and fileStatus != ''"> and file_status = #{fileStatus}</if>
            <if test="applyFrom != null  and applyFrom != ''"> and apply_from = #{applyFrom}</if>
            <if test="applyTime != null "> and apply_time = #{applyTime}</if>
            <if test="dataOrg != null  and dataOrg != ''"> and data_org = #{dataOrg}</if>
            <if test="portalUser != null "> and portal_user = #{portalUser}</if>
            <if test="handleDept != null "> and handle_dept = #{handleDept}</if>
            <if test="handleUser != null "> and handle_user = #{handleUser}</if>
            <if test="forwardStatus != null "> and forward_status = #{forwardStatus}</if>
            <if test="dissentStatus != null "> and dissent_status = #{dissentStatus}</if>
            <if test="dissentContent != null  and dissentContent != ''"> and dissent_content = #{dissentContent}</if>
            <if test="dissentDescribe != null  and dissentDescribe != ''"> and dissent_describe = #{dissentDescribe}</if>
            <if test="dissentResult != null  and dissentResult != ''"> and dissent_result = #{dissentResult}</if>
        </where>
    </select>
    
    <select id="selectCreditDissentById" parameterType="Long" resultMap="CreditDissentResult">
        <include refid="selectCreditDissentVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertCreditDissent" parameterType="CreditDissent" useGeneratedKeys="true" keyProperty="id">
        insert into credit_dissent
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="dissentId != null">dissent_id,</if>
            <if test="cardCode != null and cardCode != ''">card_code,</if>
            <if test="applyName != null and applyName != ''">apply_name,</if>
            <if test="mobile != null and mobile != ''">mobile,</if>
            <if test="counterpartName != null and counterpartName != ''">counterpart_name,</if>
            <if test="counterpartCode != null">counterpart_code,</if>
            <if test="proveFiles != null">prove_files,</if>
            <if test="dissentType != null and dissentType != ''">dissent_type,</if>
            <if test="fileStatus != null">file_status,</if>
            <if test="applyFrom != null">apply_from,</if>
            <if test="applyTime != null">apply_time,</if>
            <if test="dataOrg != null">data_org,</if>
            <if test="portalUser != null">portal_user,</if>
            <if test="handleDept != null">handle_dept,</if>
            <if test="handleUser != null">handle_user,</if>
            <if test="forwardStatus != null">forward_status,</if>
            <if test="dissentStatus != null">dissent_status,</if>
            <if test="dissentContent != null">dissent_content,</if>
            <if test="dissentDescribe != null">dissent_describe,</if>
            <if test="dissentResult != null">dissent_result,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="updateBy != null">update_by,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="dissentId != null">#{dissentId},</if>
            <if test="cardCode != null and cardCode != ''">#{cardCode},</if>
            <if test="applyName != null and applyName != ''">#{applyName},</if>
            <if test="mobile != null and mobile != ''">#{mobile},</if>
            <if test="counterpartName != null and counterpartName != ''">#{counterpartName},</if>
            <if test="counterpartCode != null">#{counterpartCode},</if>
            <if test="proveFiles != null">#{proveFiles},</if>
            <if test="dissentType != null and dissentType != ''">#{dissentType},</if>
            <if test="fileStatus != null">#{fileStatus},</if>
            <if test="applyFrom != null">#{applyFrom},</if>
            <if test="applyTime != null">#{applyTime},</if>
            <if test="dataOrg != null">#{dataOrg},</if>
            <if test="portalUser != null">#{portalUser},</if>
            <if test="handleDept != null">#{handleDept},</if>
            <if test="handleUser != null">#{handleUser},</if>
            <if test="forwardStatus != null">#{forwardStatus},</if>
            <if test="dissentStatus != null">#{dissentStatus},</if>
            <if test="dissentContent != null">#{dissentContent},</if>
            <if test="dissentDescribe != null">#{dissentDescribe},</if>
            <if test="dissentResult != null">#{dissentResult},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
         </trim>
    </insert>

    <update id="updateCreditDissent" parameterType="CreditDissent">
        update credit_dissent
        <trim prefix="SET" suffixOverrides=",">
            <if test="dissentId != null">dissent_id = #{dissentId},</if>
            <if test="cardCode != null and cardCode != ''">card_code = #{cardCode},</if>
            <if test="applyName != null and applyName != ''">apply_name = #{applyName},</if>
            <if test="mobile != null and mobile != ''">mobile = #{mobile},</if>
            <if test="counterpartName != null and counterpartName != ''">counterpart_name = #{counterpartName},</if>
            <if test="counterpartCode != null">counterpart_code = #{counterpartCode},</if>
            <if test="proveFiles != null">prove_files = #{proveFiles},</if>
            <if test="dissentType != null and dissentType != ''">dissent_type = #{dissentType},</if>
            <if test="fileStatus != null">file_status = #{fileStatus},</if>
            <if test="applyFrom != null">apply_from = #{applyFrom},</if>
            <if test="applyTime != null">apply_time = #{applyTime},</if>
            <if test="dataOrg != null">data_org = #{dataOrg},</if>
            <if test="portalUser != null">portal_user = #{portalUser},</if>
            <if test="handleDept != null">handle_dept = #{handleDept},</if>
            <if test="handleUser != null">handle_user = #{handleUser},</if>
            <if test="forwardStatus != null">forward_status = #{forwardStatus},</if>
            <if test="dissentStatus != null">dissent_status = #{dissentStatus},</if>
            <if test="dissentContent != null">dissent_content = #{dissentContent},</if>
            <if test="dissentDescribe != null">dissent_describe = #{dissentDescribe},</if>
            <if test="dissentResult != null">dissent_result = #{dissentResult},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteCreditDissentById" parameterType="Long">
        delete from credit_dissent where id = #{id}
    </delete>

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

    <update id="auditCreditDissent" parameterType="CreditDissent">
        update credit_dissent
        <trim prefix="SET" suffixOverrides=",">
            <if test="fileStatus != null">file_status = #{fileStatus},</if>
            <if test="handleDept != null">handle_dept = #{handleDept},</if>
            <if test="handleUser != null">handle_user = #{handleUser},</if>
            <if test="dissentStatus != null">dissent_status = #{dissentStatus},</if>
            <if test="dissentResult != null">dissent_result = #{dissentResult},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
        </trim>
        where id = #{id}
    </update>
</mapper>