|
@@ -41,13 +41,78 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getList" parameterType="InputVo" resultMap="BizArchiveInputResult">
|
|
|
+ SELECT
|
|
|
+ t1.*,
|
|
|
+ t2.name as company_name,
|
|
|
+ t1.boss,
|
|
|
+ t2.social_credit_code as social_credit_code,
|
|
|
+ t3.nick_name as signer_name,
|
|
|
+ t4.title as source_category_name,
|
|
|
+ t4.referrer_data_source
|
|
|
+ FROM biz_archive_input t1
|
|
|
+ left join biz_company t2 on t2.id = t1.company_id
|
|
|
+ left join sys_user t3 on t3.user_id = t1.signer_id
|
|
|
+ left join biz_source t4 on t4.id = t1.source_category_id
|
|
|
+ <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
|
|
|
+ t1.deleted = 0
|
|
|
+ <if test="fromId != null">AND (t1.from_id = #{fromId} or t1.id = #{fromId})</if>
|
|
|
+ <if test="id != null and id != ''">AND t1.id = #{id}</if>
|
|
|
+ <if test="companyName != null and companyName != ''">AND t2.name like concat("%", #{companyName}, "%")</if>
|
|
|
+ <if test="archiveTypeId != null">and archive_type_id = #{archiveTypeId}</if>
|
|
|
+ <if test="companyId != null and companyId != ''">AND t1.company_id = #{companyId}</if>
|
|
|
+ <if test="archiveCode != null and archiveCode != ''">AND t1.archive_code = #{archiveCode}</if>
|
|
|
+ <if test="startMonth != null ">AND t1.start_month = #{startMonth}</if>
|
|
|
+ <if test="endMonth != null ">AND t1.end_month = #{endMonth}</if>
|
|
|
+ <if test="proofUrl != null and proofUrl != ''">AND t1.proof_url = #{proofUrl}</if>
|
|
|
+ <if test="contractNo != null and contractNo != ''">AND t1.contract_no = #{contractNo}</if>
|
|
|
+ <if test="formDate != null ">AND t1.form_date = #{formDate}</if>
|
|
|
+ <if test="amount != null ">AND t1.amount = #{amount}</if>
|
|
|
+ <if test="verifyStatus != null ">AND t1.verify_status = #{verifyStatus}</if>
|
|
|
+ <if test="contractType != null ">AND t1.contract_type = #{contractType}</if>
|
|
|
+ <if test="serviceType != null ">AND t1.service_type = #{serviceType}</if>
|
|
|
+ <if test="outputDate != null ">AND t1.output_date = #{outputDate}</if>
|
|
|
+ <if test="monthNum != null ">AND t1.month_num = #{monthNum}</if>
|
|
|
+ <if test="companyName != null and companyName != '' ">AND t2.name like concat('%', #{companyName}, '%')</if>
|
|
|
+ <if test="verifyRemark != null and verifyRemark != ''">AND t1.verify_remark = #{verifyRemark}</if>
|
|
|
+ <if test="tenantId != null">AND t1.tenant_id = #{tenantId}</if>
|
|
|
+ <if test="isKeepAccount != null">AND <if test="isKeepAccount == 0">not</if> exists (select 1 from
|
|
|
+ biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 1)
|
|
|
+ </if>
|
|
|
+ <if test="isSocialSecurity != null">AND <if test="isSocialSecurity == 0">not</if> exists (select 1 from
|
|
|
+ biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 2)
|
|
|
+ </if>
|
|
|
+ <if test="isHousingFund != null">AND <if test="isHousingFund == 0">not</if> exists (select 1 from
|
|
|
+ biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 3)
|
|
|
+ </if>
|
|
|
+ <if test="isReturnTax != null">AND <if test="isReturnTax == 0">not</if> exists (select 1 from
|
|
|
+ biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 4)
|
|
|
+ </if>
|
|
|
+ <if test="isRegister != null">AND <if test="isRegister == 0">not</if> exists (select 1 from
|
|
|
+ biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 5)
|
|
|
+ </if>
|
|
|
+ <if test="isAlter != null">AND <if test="isAlter == 0">not</if> exists (select 1 from
|
|
|
+ biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 6)
|
|
|
+ </if>
|
|
|
+ <if test="isLogout != null">AND <if test="isLogout == 0">not</if> exists (select 1 from
|
|
|
+ biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 7)
|
|
|
+ </if>
|
|
|
+ <if test="isQualified != null">AND <if test="isQualified == 0">not</if> exists (select 1 from
|
|
|
+ biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 8)
|
|
|
+ </if>
|
|
|
+ <if test="isOther != null">AND <if test="isOther == 0">not</if> exists (select 1 from
|
|
|
+ biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 9)
|
|
|
+ </if>
|
|
|
|
|
|
- <select id="getList" parameterType="BizArchiveInput" resultMap="BizArchiveInputResult">
|
|
|
+ </trim>
|
|
|
+ </select>
|
|
|
+ <select id="getListByInput" parameterType="InputVo" resultMap="BizArchiveInputResult">
|
|
|
SELECT
|
|
|
t1.*,
|
|
|
t2.name as company_name,
|
|
|
t1.boss,
|
|
|
t2.customer_label_id as customerLabelId,
|
|
|
+ t5.lable as customerLabelName,
|
|
|
t2.social_credit_code as social_credit_code,
|
|
|
t3.nick_name as signer_name,
|
|
|
t4.title as source_category_name,
|
|
@@ -56,10 +121,12 @@
|
|
|
left join biz_company t2 on t2.id = t1.company_id
|
|
|
left join sys_user t3 on t3.user_id = t1.signer_id
|
|
|
left join biz_source t4 on t4.id = t1.source_category_id
|
|
|
+ left join biz_lable t5 on t5.id = t2.customer_label_id
|
|
|
<trim prefix=" WHERE" suffix="" suffixOverrides="AND">
|
|
|
t1.deleted = 0
|
|
|
<if test="fromId != null">AND (t1.from_id = #{fromId} or t1.id = #{fromId})</if>
|
|
|
<if test="id != null and id != ''">AND t1.id = #{id}</if>
|
|
|
+ <if test="contactNo!=null and contactNo != '' ">AND t1.contract_no like concat("%",#{contractNo}, "%")</if>
|
|
|
<if test="companyName != null and companyName != ''">AND t2.name like concat("%", #{companyName}, "%")</if>
|
|
|
<if test="archiveTypeId != null">and archive_type_id = #{archiveTypeId}</if>
|
|
|
<if test="companyId != null and companyId != ''">AND t1.company_id = #{companyId}</if>
|
|
@@ -68,7 +135,13 @@
|
|
|
<if test="endMonth != null ">AND t1.end_month = #{endMonth}</if>
|
|
|
<if test="proofUrl != null and proofUrl != ''">AND t1.proof_url = #{proofUrl}</if>
|
|
|
<if test="contractNo != null and contractNo != ''">AND t1.contract_no = #{contractNo}</if>
|
|
|
- <if test="formDate != null ">AND t1.form_date = #{formDate}</if>
|
|
|
+ <if test="formDate!= null and formDate.size() ">
|
|
|
+ AND (
|
|
|
+ DATE_FORMAT(t1.form_date,'%Y-%m-%d') >= #{formDate[0]}
|
|
|
+ AND
|
|
|
+ DATE_FORMAT(t1.form_date,'%Y-%m-%d') <= #{formDate[1]}
|
|
|
+ )
|
|
|
+ </if>
|
|
|
<if test="amount != null ">AND t1.amount = #{amount}</if>
|
|
|
<if test="verifyStatus != null ">AND t1.verify_status = #{verifyStatus}</if>
|
|
|
<if test="contractType != null ">AND t1.contract_type = #{contractType}</if>
|
|
@@ -105,9 +178,18 @@
|
|
|
<if test="isOther != null">AND <if test="isOther == 0">not</if> exists (select 1 from
|
|
|
biz_archive_input_detail t5 where t5.deleted = 0 and t5.contract_id = t1.id and t5.task_type_id = 9)
|
|
|
</if>
|
|
|
+ <if test="customerLabelId != null and customerLabelId.size() > 0">
|
|
|
+ AND t2.customer_label_id IN
|
|
|
+ <foreach collection="customerLabelId" index="index" item="item" separator="," open="(" close=")">
|
|
|
+ #{item,jdbcType=BIGINT}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
</trim>
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
+
|
|
|
<update id="removeByIds">
|
|
|
UPDATE biz_archive_input
|
|
|
SET deleted=1
|