You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
4.2 KiB

<?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.daqing.financial.guarantee.mapper.DgAssetsInvestigationMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.daqing.framework.domain.guarantee.DgAssetsInvestigation">
<id column="id" property="id" />
<result column="business_id" property="businessId" />
<result column="company_id" property="companyId" />
<result column="emp_id" property="empId" />
<result column="role_id" property="roleId" />
<result column="type" property="type" />
<result column="status" property="status" />
<result column="operating_status" property="operatingStatus" />
<result column="assets_name" property="assetsName" />
<result column="assets_code" property="assetsCode" />
<result column="assets_time" property="assetsTime" />
<result column="amount_sum" property="amountSum" />
<result column="audit_name" property="auditName" />
<result column="audit_code" property="auditCode" />
<result column="audit_time" property="auditTime" />
<result column="audit_amount" property="auditAmount" />
<result column="guarantee_measures" property="guaranteeMeasures" />
<result column="file" property="file" />
<result column="apply_content" property="applyContent" />
<result column="assets_amount" property="assetsAmount" />
<result column="amount" property="amount" />
<result column="term" property="term" />
<result column="remark" property="remark" />
<result column="other_remark" property="otherRemark" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
</resultMap>
<select id="pageByCondition" resultType="com.daqing.financial.guarantee.model.response.AssetsInvestigationListResponse">
select au.id,au.role_id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,au.create_time,
au.status,au.operating_status,cc.name,cc.phone,ps.business_status
from dg_assets_investigation au
left join dg_apply_amount_info ai on au.business_id = ai.id
left join crms_company_customer ccl on ai.company_id = ccl.id
left join crms_customer cc on cc.id = ccl.customer_id
left JOIN dg_business_process_status ps ON ps.business_id = au.business_id
<where>
au.role_id in
<foreach collection="roleIdlist" open="(" separator="," close=")" item="id">
#{id}
</foreach>
<if test="customerNumberOrName != null and customerNumberOrName != ''">
AND (ai.business_code LIKE CONCAT('%',#{customerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{customerNumberOrName},'%'))
</if>
<if test="status != null">
AND au.status = #{status}
</if>
<if test="userId != null and userId != ''">
AND (au.emp_id =#{userId} or au.emp_id is null)
</if>
</where>
ORDER BY au.create_time DESC
</select>
<select id="selectInfoById" resultType="com.daqing.financial.guarantee.model.response.DgAssetsInvestigationResponse">
select * from dg_assets_investigation where id=#{id}
</select>
<select id="selectListByIds" resultType="com.daqing.financial.guarantee.model.response.AssetsInvestigationListResponse">
select au.id,au.company_id,au.business_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,au.create_time,
au.status,au.operating_status,cc.name,cc.phone,ps.business_status
from dg_assets_investigation au
left join dg_apply_amount_info ai on au.business_id = ai.id
left join crms_company_customer ccl on ai.company_id = ccl.id
left join crms_customer cc on cc.id = ccl.customer_id
left JOIN dg_business_process_status ps ON ps.business_id = au.business_id
where au.id in
<foreach collection="list" close=")" open="(" item="id" separator=",">
#{id}
</foreach>
</select>
</mapper>