<?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.ruoyi.info.collection.mapper.CcdiCreditNegativeInfoMapper">

    <resultMap id="CcdiCreditNegativeInfoResultMap" type="com.ruoyi.info.collection.domain.CcdiCreditNegativeInfo">
        <id property="negativeId" column="negative_id"/>
        <result property="personId" column="person_id"/>
        <result property="personName" column="person_name"/>
        <result property="queryDate" column="query_date"/>
        <result property="civilCnt" column="civil_cnt"/>
        <result property="enforceCnt" column="enforce_cnt"/>
        <result property="admCnt" column="adm_cnt"/>
        <result property="civilLmt" column="civil_lmt"/>
        <result property="enforceLmt" column="enforce_lmt"/>
        <result property="admLmt" column="adm_lmt"/>
        <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>

    <select id="selectByPersonId" resultMap="CcdiCreditNegativeInfoResultMap">
        SELECT
            negative_id, person_id, person_name, query_date, civil_cnt, enforce_cnt, adm_cnt,
            civil_lmt, enforce_lmt, adm_lmt, create_by, create_time, update_by, update_time
        FROM ccdi_credit_negative_info
        WHERE person_id = #{personId}
        LIMIT 1
    </select>

    <delete id="deleteByPersonId">
        DELETE FROM ccdi_credit_negative_info
        WHERE person_id = #{personId}
    </delete>

</mapper>
