|
|
@@ -156,173 +156,174 @@
|
|
|
</sql>
|
|
|
|
|
|
<select id="queryNew" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
|
|
|
- select
|
|
|
- pa.agreement_name as "agreementName",
|
|
|
- pa.agreement_type as "agreementType",
|
|
|
- pa.docking_person as "dockingPerson",
|
|
|
- upf.url as "imageUrl",
|
|
|
- su.name as "userName",
|
|
|
- <include refid="income_com"/>
|
|
|
- from ins_ply_income a
|
|
|
- LEFT JOIN ptl_agreement pa on a.agreement_id = pa.id
|
|
|
- LEFT JOIN sys_user su on su.id=a.user_id
|
|
|
- LEFT JOIN ins_upload_files upf on a.settlement_image_id=upf.id
|
|
|
- LEFT JOIN esm_ins_company eic on eic.id=a.partner_companies_id
|
|
|
- <where>
|
|
|
- <if test="startDate !=null and startDate!='' and endDate !=null and endDate !=''">
|
|
|
- and DATE_FORMAT( a.signdate, '%Y-%m-%d') between DATE_FORMAT(#{startDate}, '%Y-%m-%d') and DATE_FORMAT(#{endDate}, '%Y-%m-%d')
|
|
|
- </if>
|
|
|
- <if test="agreementType !=null and agreementType !=''">
|
|
|
- and pa.agreement_type =#{agreementType}
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="signDateEnd !=null and signDateEnd!='' and signDateStart !=null and signDateStart !=''">
|
|
|
- and a.signdate between #{signDateStart} and #{signDateEnd}
|
|
|
- </if>
|
|
|
+ select
|
|
|
+ pa.agreement_name as "agreementName",
|
|
|
+ pa.agreement_type as "agreementType",
|
|
|
+ pa.docking_person as "dockingPerson",
|
|
|
+ upf.url as "imageUrl",
|
|
|
+ su.name as "userName",
|
|
|
+ b.name as "deptName",
|
|
|
+ <include refid="income_com"/>
|
|
|
+ from ins_ply_income a
|
|
|
+ LEFT JOIN ptl_agreement pa on a.agreement_id = pa.id
|
|
|
+ LEFT JOIN sys_user su on su.id=a.user_id
|
|
|
+ LEFT JOIN ins_upload_files upf on a.settlement_image_id=upf.id
|
|
|
+ LEFT JOIN esm_ins_company eic on eic.id=a.partner_companies_id
|
|
|
+ LEFT JOIN sys_dept b on pa.dept_id=b.id
|
|
|
+ <where>
|
|
|
+ <if test="startDate !=null and startDate!='' and endDate !=null and endDate !=''">
|
|
|
+ and DATE_FORMAT( a.signdate, '%Y-%m-%d') between DATE_FORMAT(#{startDate}, '%Y-%m-%d') and DATE_FORMAT(#{endDate}, '%Y-%m-%d')
|
|
|
+ </if>
|
|
|
+ <if test="agreementType !=null and agreementType !=''">
|
|
|
+ and pa.agreement_type =#{agreementType}
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="handlingFeesStatus !=null and handlingFeesStatus !=''">
|
|
|
- and a.handling_fees_status =#{handlingFeesStatus}
|
|
|
- </if>
|
|
|
+ <if test="signDateEnd !=null and signDateEnd!='' and signDateStart !=null and signDateStart !=''">
|
|
|
+ and a.signdate between #{signDateStart} and #{signDateEnd}
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="allPartnerCompaniesId !=null and allPartnerCompaniesId !=''">
|
|
|
- AND eic.parent_id LIKE CONCAT(#{allPartnerCompaniesId}, '%')
|
|
|
- </if>
|
|
|
+ <if test="handlingFeesStatus !=null and handlingFeesStatus !=''">
|
|
|
+ and a.handling_fees_status =#{handlingFeesStatus}
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="provincePartnerCompaniesId !=null and provincePartnerCompaniesId !=''">
|
|
|
- and eic.parent_id =#{provincePartnerCompaniesId}
|
|
|
- </if>
|
|
|
+ <if test="allPartnerCompaniesId !=null and allPartnerCompaniesId !=''">
|
|
|
+ AND eic.parent_id LIKE CONCAT(#{allPartnerCompaniesId}, '%')
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="dockingPerson !=null and dockingPerson !=''">
|
|
|
- and pa.docking_person =#{dockingPerson}
|
|
|
- </if>
|
|
|
+ <if test="provincePartnerCompaniesId !=null and provincePartnerCompaniesId !=''">
|
|
|
+ and eic.parent_id =#{provincePartnerCompaniesId}
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="provinceId != null and provinceId != ''">
|
|
|
- and a.dept_id LIKE CONCAT(#{provinceId}, '%')
|
|
|
- </if>
|
|
|
+ <if test="dockingPerson !=null and dockingPerson !=''">
|
|
|
+ and pa.docking_person =#{dockingPerson}
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="cityId != null and cityId != ''">
|
|
|
- and a.dept_id LIKE CONCAT(#{cityId}, '%')
|
|
|
- </if>
|
|
|
+ <if test="provinceId != null and provinceId != ''">
|
|
|
+ and pa.dept_id LIKE CONCAT(#{provinceId}, '%')
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="countyId != null and countyId != ''">
|
|
|
- and a.dept_id LIKE CONCAT(#{countyId}, '%')
|
|
|
- </if>
|
|
|
- <if test="taskId != null and taskId != ''">
|
|
|
- and a.task_id = #{taskId}
|
|
|
- </if>
|
|
|
- <if test="orderno !=null and orderno !=''">
|
|
|
- and a.orderno =#{orderno}
|
|
|
- </if>
|
|
|
- <if test="companyName !=null and companyName !=''">
|
|
|
- and a.company_id =#{companyName}
|
|
|
- </if>
|
|
|
+ <if test="cityId != null and cityId != ''">
|
|
|
+ and pa.dept_id LIKE CONCAT(#{cityId}, '%')
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="policyno !=null and policyno !=''">
|
|
|
- and a.policyno =#{policyno}
|
|
|
- </if>
|
|
|
- <if test="documentaryFeesStatus !=null and documentaryFeesStatus !=''">
|
|
|
- and a.documentary_fees_status =#{documentaryFeesStatus}
|
|
|
- </if>
|
|
|
+ <if test="countyId != null and countyId != ''">
|
|
|
+ and pa.dept_id LIKE CONCAT(#{countyId}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="taskId != null and taskId != ''">
|
|
|
+ and a.task_id = #{taskId}
|
|
|
+ </if>
|
|
|
+ <if test="orderno !=null and orderno !=''">
|
|
|
+ and a.orderno =#{orderno}
|
|
|
+ </if>
|
|
|
+ <if test="companyName !=null and companyName !=''">
|
|
|
+ and a.company_id =#{companyName}
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="isNotCar !=null and isNotCar !=''">
|
|
|
- and a.is_not_car =#{isNotCar}
|
|
|
- </if>
|
|
|
+ <if test="policyno !=null and policyno !=''">
|
|
|
+ and a.policyno =#{policyno}
|
|
|
+ </if>
|
|
|
+ <if test="documentaryFeesStatus !=null and documentaryFeesStatus !=''">
|
|
|
+ and a.documentary_fees_status =#{documentaryFeesStatus}
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="deptId !=null and deptId !=''">
|
|
|
- and pa.dept_id =#{deptId}
|
|
|
- </if>
|
|
|
+ <if test="isNotCar !=null and isNotCar !=''">
|
|
|
+ and a.is_not_car =#{isNotCar}
|
|
|
+ </if>
|
|
|
|
|
|
+ <if test="deptId !=null and deptId !=''">
|
|
|
+ and pa.dept_id =#{deptId}
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="ids != null and ids != '' and ids.length > 0">
|
|
|
- and a.id in
|
|
|
- <foreach collection="ids" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
- <if test="incomeIds != null and incomeIds != '' and incomeIds.size() > 0">
|
|
|
- and a.id in
|
|
|
- <foreach collection="incomeIds" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
|
|
|
- <if test="selectIds != null and selectIds != '' and selectIds.size() > 0">
|
|
|
- and a.id in
|
|
|
- <foreach collection="selectIds" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
+ <if test="ids != null and ids != '' and ids.length > 0">
|
|
|
+ and a.id in
|
|
|
+ <foreach collection="ids" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="incomeIds != null and incomeIds != '' and incomeIds.size() > 0">
|
|
|
+ and a.id in
|
|
|
+ <foreach collection="incomeIds" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="partnerCompaniesIdList != null and partnerCompaniesIdList != '' and partnerCompaniesIdList.size() > 0">
|
|
|
- and a.partner_companies_id in
|
|
|
- <foreach collection="partnerCompaniesIdList" item="item" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- </if>
|
|
|
+ <if test="selectIds != null and selectIds != '' and selectIds.size() > 0">
|
|
|
+ and a.id in
|
|
|
+ <foreach collection="selectIds" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="isOther !=null and isOther !=''">
|
|
|
- and a.is_not_documentary =#{isOther}
|
|
|
- </if>
|
|
|
- <if test="licenseno != null and licenseno != ''">
|
|
|
- and a.licenseno =#{licenseno}
|
|
|
- </if>
|
|
|
- <if test="syPolicyno != null and syPolicyno != ''">
|
|
|
- and a.sy_policyno =#{syPolicyno}
|
|
|
- </if>
|
|
|
+ <if test="partnerCompaniesIdList != null and partnerCompaniesIdList != '' and partnerCompaniesIdList.size() > 0">
|
|
|
+ and a.partner_companies_id in
|
|
|
+ <foreach collection="partnerCompaniesIdList" item="item" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="noPolicyno != null and noPolicyno != ''">
|
|
|
- and a.no_policyno =#{noPolicyno}
|
|
|
- </if>
|
|
|
- <if test="signdate !=null and signdate !=''">
|
|
|
- AND a.signdate =#{signdate}
|
|
|
- </if>
|
|
|
- <if test="partnerCompaniesId !=null and partnerCompaniesId !=''">
|
|
|
- AND a.partner_companies_id =#{partnerCompaniesId}
|
|
|
- </if>
|
|
|
+ <if test="isOther !=null and isOther !=''">
|
|
|
+ and a.is_not_documentary =#{isOther}
|
|
|
+ </if>
|
|
|
+ <if test="licenseno != null and licenseno != ''">
|
|
|
+ and a.licenseno =#{licenseno}
|
|
|
+ </if>
|
|
|
+ <if test="syPolicyno != null and syPolicyno != ''">
|
|
|
+ and a.sy_policyno =#{syPolicyno}
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="partnerCompaniesName !=null and partnerCompaniesName !=''">
|
|
|
- AND a.partner_companies_name =#{partnerCompaniesName}
|
|
|
- </if>
|
|
|
+ <if test="noPolicyno != null and noPolicyno != ''">
|
|
|
+ and a.no_policyno =#{noPolicyno}
|
|
|
+ </if>
|
|
|
+ <if test="signdate !=null and signdate !=''">
|
|
|
+ AND a.signdate =#{signdate}
|
|
|
+ </if>
|
|
|
+ <if test="partnerCompaniesId !=null and partnerCompaniesId !=''">
|
|
|
+ AND a.partner_companies_id =#{partnerCompaniesId}
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="createTime !=null and createTime !=''">
|
|
|
- AND a.create_time =#{createTime}
|
|
|
- </if>
|
|
|
- <if test="settlementTime !=null and settlementTime !=''">
|
|
|
- AND a.settlement_time =#{settlementTime}
|
|
|
- </if>
|
|
|
+ <if test="partnerCompaniesName !=null and partnerCompaniesName !=''">
|
|
|
+ AND a.partner_companies_name =#{partnerCompaniesName}
|
|
|
+ </if>
|
|
|
|
|
|
- <if test="userId !=null and userId !=''">
|
|
|
- and a.userId =#{userId}
|
|
|
- </if>
|
|
|
- <if test="companyId !=null and companyId !=''">
|
|
|
- and a.company_id =#{companyId}
|
|
|
- </if>
|
|
|
- <if test="riskcode !=null and riskcode !=''">
|
|
|
- and a.riskcode =#{riskcode}
|
|
|
- </if>
|
|
|
- <if test="year !=null and year !=''">
|
|
|
- AND YEAR(a.signdate) =#{year}
|
|
|
- </if>
|
|
|
- <if test="month !=null and month !=''">
|
|
|
- AND month(a.signdate) =#{month}
|
|
|
- </if>
|
|
|
- <if test="day !=null and day !=''">
|
|
|
- AND day(a.signdate) =#{day}
|
|
|
- </if>
|
|
|
- <if test="insuredName !=null and insuredName !=''">
|
|
|
- AND a.insured_name =#{insuredName}
|
|
|
- </if>
|
|
|
- <if test="jqStartDate !=null and jqStartDate != '' and jqEndDate != null and jqEndDate !=''">
|
|
|
- AND DATE(a.jq_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
|
|
|
+ <if test="createTime !=null and createTime !=''">
|
|
|
+ AND a.create_time =#{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="settlementTime !=null and settlementTime !=''">
|
|
|
+ AND a.settlement_time =#{settlementTime}
|
|
|
+ </if>
|
|
|
|
|
|
- </if>
|
|
|
- <if test="syStartDate !=null and syStartDate != '' and syEndDate != null and syEndDate !=''">
|
|
|
- AND DATE(a.sy_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
|
|
|
+ <if test="userId !=null and userId !=''">
|
|
|
+ and a.userId =#{userId}
|
|
|
+ </if>
|
|
|
+ <if test="companyId !=null and companyId !=''">
|
|
|
+ and a.company_id =#{companyId}
|
|
|
+ </if>
|
|
|
+ <if test="riskcode !=null and riskcode !=''">
|
|
|
+ and a.riskcode =#{riskcode}
|
|
|
+ </if>
|
|
|
+ <if test="year !=null and year !=''">
|
|
|
+ AND YEAR(a.signdate) =#{year}
|
|
|
+ </if>
|
|
|
+ <if test="month !=null and month !=''">
|
|
|
+ AND month(a.signdate) =#{month}
|
|
|
+ </if>
|
|
|
+ <if test="day !=null and day !=''">
|
|
|
+ AND day(a.signdate) =#{day}
|
|
|
+ </if>
|
|
|
+ <if test="insuredName !=null and insuredName !=''">
|
|
|
+ AND a.insured_name =#{insuredName}
|
|
|
+ </if>
|
|
|
+ <if test="jqStartDate !=null and jqStartDate != '' and jqEndDate != null and jqEndDate !=''">
|
|
|
+ AND DATE(a.jq_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
|
|
|
|
|
|
- </if>
|
|
|
+ </if>
|
|
|
+ <if test="syStartDate !=null and syStartDate != '' and syEndDate != null and syEndDate !=''">
|
|
|
+ AND DATE(a.sy_start_date) BETWEEN #{syStartDate} AND #{syEndDate}
|
|
|
|
|
|
- </where>
|
|
|
- ORDER BY a.create_time desc
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY a.create_time desc
|
|
|
|
|
|
</select>
|
|
|
<select id="getEntityById" resultType="com.ydtech.modules.fnc.entity.InsPlyIncome">
|