<commit_before><?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="CreditMapper">
	<sql id="creditColumns">
		 select id,
		 user_id,
		 cr_type,
		 cr_amount,
		 cr_status,
		 disposal_type,
		 commision_range,
		 contact_name,
		 contact_number,
		 debt_name,
		 debt_province,
		 debt_city,
		 debt_phone,
		 debt_proof,
		 description,
		 create_date,
		 end_date,
		 open_date,
		 agreed_date,
		 credit_type,
		 signed_path,
		 legal_service_path,
		 deal_team_name,
		 dept_type
	</sql>

	<resultMap type="Credit" id="CreditResultMap">
		<id column="id" property="id"/>
		<result column="user_id" property="userId"/>
		<result column="cr_type" property="crType"/>
		<result column="cr_amount" property="crAmount"/>
		<result column="cr_status" property="crStatus"/>
		<result column="disposal_type" property="disposalType"/>
		<result column="commision_range" property="commisionRange"/>
		<result column="contact_name" property="contactName"/>
		<result column="contact_number" property="contactNumber"/>
		<result column="dept_type" property="deptType"/>
		<result column="debt_name" property="debtName"/>
		<result column="debt_province" property="debtProvince"/>
	    <result column="debt_city" property="debtCity"/>
		<result column="debt_phone" property="debtPhone"/>
		<result column="debt_proof" property="debtProof"/>
		<result column="description" property="description"/>
		<result column="create_date" property="createDate"/>
		<result column="end_date" property="endDate"/>
		<result column="open_date" property="openDate"/>
		<result column="agreed_date" property="agreedDate"/>
		<result column="credit_type" property="creditType"/>
		<result column="signed_path" property="signedPath"/>
		<result column="legal_service_path" property="legalServicePath"/>
		<result column="deal_team_name" property="dealTeamName"/>
	</resultMap>
    
    <!-- 根据id获取债权信息 -->
	<select id="findById" parameterType="PageData" resultType="Credit" useCache="false">
	   <include refid="creditColumns"></include>
		from cr_credit 
		where id = #{id}
	</select>
	
	
   <select id="count" parameterType="PageData" resultType="int">
		select count(1)
		from cr_credit u
		where 1=1
		<if test="userId == null or userId == ''">
			and is_audit = 1
		</if>
		<if test="userId != null and userId != ''">
			and user_id=#{userId}
		</if>
		<if test="crStatus != null and crStatus != ''">
			and cr_status=#{crStatus}
		</if>
		<if test="crType != null and crType != ''">
			and cr_type=#{crType}
		</if>
		<if test="creditType != null and creditType != ''">
			and credit_type=#{creditType}
		</if>
		<if test="dealTeamName != null and dealTeamName != ''">
			and deal_team_name=#{dealTeamName}
		</if>
		<if test="contactName!=nul and contactName!=''">
			and contact_name like CONCAT(CONCAT('%',#{contactName}),'%')
		</if>
	</select>
	
	<select id="list" parameterType="PageData" resultType="Credit">
	   <include refid="creditColumns"></include>
		 from cr_credit u
		where 1 = 1
		<if test="userId == null or userId == ''">
			and is_audit = 1
		</if>
		<if test="userId != null and userId != ''">
			and user_id=#{userId}
		</if>
		<if test="crStatus != null and crStatus != ''">
			and cr_status=#{crStatus}
		</if>
		<if test="crType != null and crType != ''">
			and cr_type=#{crType}
		</if>
		<if test="creditType != null and creditType != ''">
			and credit_type=#{creditType}
		</if>
		<if test="dealTeamName != null and dealTeamName != ''">
			and deal_team_name=#{dealTeamName}
		</if>
		<if test="contactName!=nul and contactName!=''">
			and contact_name like CONCAT(CONCAT('%',#{contactName}),'%')
		</if>
		order by u.id desc
		limit #{from},#{size}
	</select>
	
	
	<insert id="creditSave" parameterType="credit">
		insert into cr_credit (
			 user_id,
			 cr_type,
			 cr_amount,
			 cr_status,
			 disposal_type,
			 commision_range,
			 contact_name,
			 contact_number,
			 dept_type,
			 debt_name,
			 debt_province,
			 debt_city,
			 debt_phone,
			 debt_proof,
			 description,
			 create_date,
			 end_date,
			 open_date,
			 agreed_date,
			 credit_type,
			 is_audit
		) values (
			#{userId},
			#{crType},
			#{crAmount},
			#{crStatus},
			#{disposalType},
			#{commisionRange},
			#{contactName},
			#{contactNumber},
			#{deptType},
			#{debtName},
			#{debtProvince},
			#{debtCity},
			#{debtPhone},
			#{debtProof},
			#{description},
			#{createDate},
			#{endDate},
			#{openDate},
			#{agreedDate},
			#{creditType},
			0
		)
	</insert>	
	<select id="tranCount" parameterType="PageData" resultType="int">
		select count(1)
		from cr_credit u
		where deal_team_name=#{dealTeamName}
		<if test="crStatus != null and crStatus != ''">
			and cr_status=#{crStatus}
		</if>
		<if test="crType != null and crType != ''">
			and cr_type=#{crType}
		</if>
		<if test="creditType != null and creditType != ''">
			and credit_type=#{creditType}
		</if>
		<if test="contactName!=nul and contactName!=''">
			and contact_name like CONCAT(CONCAT('%',#{contactName}),'%')
		</if>
	</select>
	<select id="tranList" parameterType="PageData" resultType="Credit">
	   <include refid="creditColumns"></include>
		 from cr_credit u
		where deal_team_name=#{dealTeamName}
		<if test="crStatus != null and crStatus != ''"><commit_msg>2:修复删除的债权不显示。<commit_after><?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="CreditMapper">
	<sql id="creditColumns">
		 select id,
		 user_id,
		 cr_type,
		 cr_amount,
		 cr_status,
		 disposal_type,
		 commision_range,
		 contact_name,
		 contact_number,
		 debt_name,
		 debt_province,
		 debt_city,
		 debt_phone,
		 debt_proof,
		 description,
		 create_date,
		 end_date,
		 open_date,
		 agreed_date,
		 credit_type,
		 signed_path,
		 legal_service_path,
		 deal_team_name,
		 dept_type
	</sql>

	<resultMap type="Credit" id="CreditResultMap">
		<id column="id" property="id"/>
		<result column="user_id" property="userId"/>
		<result column="cr_type" property="crType"/>
		<result column="cr_amount" property="crAmount"/>
		<result column="cr_status" property="crStatus"/>
		<result column="disposal_type" property="disposalType"/>
		<result column="commision_range" property="commisionRange"/>
		<result column="contact_name" property="contactName"/>
		<result column="contact_number" property="contactNumber"/>
		<result column="dept_type" property="deptType"/>
		<result column="debt_name" property="debtName"/>
		<result column="debt_province" property="debtProvince"/>
	    <result column="debt_city" property="debtCity"/>
		<result column="debt_phone" property="debtPhone"/>
		<result column="debt_proof" property="debtProof"/>
		<result column="description" property="description"/>
		<result column="create_date" property="createDate"/>
		<result column="end_date" property="endDate"/>
		<result column="open_date" property="openDate"/>
		<result column="agreed_date" property="agreedDate"/>
		<result column="credit_type" property="creditType"/>
		<result column="signed_path" property="signedPath"/>
		<result column="legal_service_path" property="legalServicePath"/>
		<result column="deal_team_name" property="dealTeamName"/>
	</resultMap>
    
    <!-- 根据id获取债权信息 -->
	<select id="findById" parameterType="PageData" resultType="Credit" useCache="false">
	   <include refid="creditColumns"></include>
		from cr_credit 
		where id = #{id}
	</select>
	
	
   <select id="count" parameterType="PageData" resultType="int">
		select count(1)
		from cr_credit u
		where cr_status!=-1
		<if test="userId == null or userId == ''">
			and is_audit = 1
		</if>
		<if test="userId != null and userId != ''">
			and user_id=#{userId}
		</if>
		<if test="crStatus != null and crStatus != ''">
			and cr_status=#{crStatus}
		</if>
		<if test="crType != null and crType != ''">
			and cr_type=#{crType}
		</if>
		<if test="creditType != null and creditType != ''">
			and credit_type=#{creditType}
		</if>
		<if test="dealTeamName != null and dealTeamName != ''">
			and deal_team_name=#{dealTeamName}
		</if>
		<if test="contactName!=nul and contactName!=''">
			and contact_name like CONCAT(CONCAT('%',#{contactName}),'%')
		</if>
	</select>
	
	<select id="list" parameterType="PageData" resultType="Credit">
	   <include refid="creditColumns"></include>
		 from cr_credit u
		where cr_status!=-1
		<if test="userId == null or userId == ''">
			and is_audit = 1
		</if>
		<if test="userId != null and userId != ''">
			and user_id=#{userId}
		</if>
		<if test="crStatus != null and crStatus != ''">
			and cr_status=#{crStatus}
		</if>
		<if test="crType != null and crType != ''">
			and cr_type=#{crType}
		</if>
		<if test="creditType != null and creditType != ''">
			and credit_type=#{creditType}
		</if>
		<if test="dealTeamName != null and dealTeamName != ''">
			and deal_team_name=#{dealTeamName}
		</if>
		<if test="contactName!=nul and contactName!=''">
			and contact_name like CONCAT(CONCAT('%',#{contactName}),'%')
		</if>
		order by u.id desc
		limit #{from},#{size}
	</select>
	
	
	<insert id="creditSave" parameterType="credit">
		insert into cr_credit (
			 user_id,
			 cr_type,
			 cr_amount,
			 cr_status,
			 disposal_type,
			 commision_range,
			 contact_name,
			 contact_number,
			 dept_type,
			 debt_name,
			 debt_province,
			 debt_city,
			 debt_phone,
			 debt_proof,
			 description,
			 create_date,
			 end_date,
			 open_date,
			 agreed_date,
			 credit_type,
			 is_audit
		) values (
			#{userId},
			#{crType},
			#{crAmount},
			#{crStatus},
			#{disposalType},
			#{commisionRange},
			#{contactName},
			#{contactNumber},
			#{deptType},
			#{debtName},
			#{debtProvince},
			#{debtCity},
			#{debtPhone},
			#{debtProof},
			#{description},
			#{createDate},
			#{endDate},
			#{openDate},
			#{agreedDate},
			#{creditType},
			0
		)
	</insert>	
	<select id="tranCount" parameterType="PageData" resultType="int">
		select count(1)
		from cr_credit u
		where deal_team_name=#{dealTeamName}
		and cr_status!=-1
		<if test="crStatus != null and crStatus != ''">
			and cr_status=#{crStatus}
		</if>
		<if test="crType != null and crType != ''">
			and cr_type=#{crType}
		</if>
		<if test="creditType != null and creditType != ''">
			and credit_type=#{creditType}
		</if>
		<if test="contactName!=nul and contactName!=''">
			and contact_name like CONCAT(CONCAT('%',#{contactName}),'%')
		</if>
	</select>
	<select id="tranList" parameterType="PageData" resultType="Credit">
	   <include refid="creditColumns"></include>
		 from cr_credit u
		where deal_team_name=#{dealTeamName}
		and cr_status!=-1
		<if test="crStatus != null and crStatus != ''">
{'fraction_non_alphanumeric': 0.16932492581602374, 'fraction_numerical': 0.0028746290801186943, 'mean_word_length': 4.32067094227923, 'pattern_counts': {'":': 0, '<': 175, '<?xml version=': 2, '>': 175, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5520800', 'n_tokens_mistral': 4329, 'n_tokens_neox': 3695, 'n_words': 779}