|
|
|
<?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.DgApplyAmountInfoMapper">
|
|
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
|
<resultMap id="BaseResultMap" type="com.daqing.framework.domain.guarantee.DgApplyAmountInfo">
|
|
|
|
<id column="id" property="id" />
|
|
|
|
<result column="company_id" property="companyId" />
|
|
|
|
<result column="presenter_id" property="presenterId" />
|
|
|
|
<result column="apply_amount" property="applyAmount" />
|
|
|
|
<result column="apply_time" property="applyTime" />
|
|
|
|
<result column="bank" property="bank" />
|
|
|
|
<result column="amount_wide" property="amountWide" />
|
|
|
|
<result column="en_guarantee_measures" property="enGuaranteeMeasures" />
|
|
|
|
<result column="description" property="description" />
|
|
|
|
<result column="customer_type" property="customerType" />
|
|
|
|
<result column="business_type" property="businessType" />
|
|
|
|
<result column="create_time" property="createTime" />
|
|
|
|
<result column="update_time" property="updateTime" />
|
|
|
|
<result column="operating_status" property="operatingStatus" />
|
|
|
|
<result column="role_id" property="roleId" />
|
|
|
|
<result column="type" property="type" />
|
|
|
|
</resultMap>
|
|
|
|
<select id="pageByCondition" resultType="com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse">
|
|
|
|
select ai.id,ai.company_id,ai.presenter_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,ai.create_time,
|
|
|
|
ai.status,cc.name,cc.phone
|
|
|
|
from dg_apply_amount_info ai
|
|
|
|
left join crms_company_customer ccl on ai.company_id = ccl.id
|
|
|
|
left join crms_customer cc on cc.id = ccl.customer_id
|
|
|
|
<where>
|
|
|
|
<if test="CustomerNumberOrName != null and CustomerNumberOrName != ''">
|
|
|
|
AND ai.business_code LIKE CONCAT('%',#{CustomerNumberOrName},'%') OR cc.name LIKE CONCAT('%',#{CustomerNumberOrName},'%')
|
|
|
|
</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="excelList" resultType="com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse">
|
|
|
|
select ai.id,ai.company_id,ai.presenter_id,ai.business_code,ai.business_type,ai.apply_amount,ai.apply_time,ai.create_time,
|
|
|
|
ai.status,cc.name,cc.phone
|
|
|
|
from dg_apply_amount_info ai
|
|
|
|
left join crms_company_customer ccl on ai.company_id = ccl.id
|
|
|
|
left join crms_customer cc on cc.id = ccl.customer_id
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectApplyAmountInfoById" resultType="com.daqing.financial.guarantee.model.response.DgApplyAmountInfoResponse">
|
|
|
|
select * from dg_apply_amount_info where id=#{id}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectListByIds" resultType="com.daqing.financial.guarantee.model.response.BusinessApplicationListResponse">
|
|
|
|
select au.id,ai.company_id,au.business_id,ai.presenter_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_apply_amount_list 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>
|
|
|
|
|
|
|
|
<select id="selectBusinessTaday" parameterType="java.lang.String" resultType="java.lang.Integer">
|
|
|
|
select count(0) from dg_apply_amount_info where create_time LIKE CONCAT('%',#{dateTime},'%')
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectMaxBusinessTaday" parameterType="java.lang.String" resultType="java.lang.String">
|
|
|
|
select business_code
|
|
|
|
from dg_apply_amount_info
|
|
|
|
where create_time LIKE CONCAT('%',#{dateTime},'%')
|
|
|
|
order by id desc limit 1
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</mapper>
|