|
@@ -141,4 +141,73 @@
|
|
|
LIMIT ${startRecord}, ${pageSize}
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <select id="getIdentityInfoNotLimitNew" parameterType="Map"
|
|
|
+ resultType="com.yh.saas.plugin.yiliangyiyun.entity.IdentityAuthenticationInfo">
|
|
|
+ SELECT * FROM (
|
|
|
+ SELECT
|
|
|
+ a.id as id,
|
|
|
+ a.customer_name as customerName,
|
|
|
+ a.customer_phone as customerPhone,
|
|
|
+ a.bank_card as bankCard,
|
|
|
+ a.bank_deposit as bankDeposit,
|
|
|
+ a.bank_deposit_branch as bankDepositBranch,
|
|
|
+ a.payee_name as payeeName,
|
|
|
+ a.village_committee_phone as villageCommitteePhone,
|
|
|
+ a.payee_number_card as payeeNumberCard,
|
|
|
+ a.authentication_status_key as authenticationStatusKey,
|
|
|
+ case when a.delete_flag = '1' then '已删除'
|
|
|
+ when a.cover = '1' then '已覆盖'
|
|
|
+ else a.authentication_status end as authenticationStatus,
|
|
|
+ a.cover ,
|
|
|
+ a.customer_number_card as customerNumberCard,
|
|
|
+ a.payee_address_url as payeeAddressUrl,
|
|
|
+ a.card_address_url as cardAddressUrl,
|
|
|
+ a.comp_id as compId,
|
|
|
+ a.supplier,
|
|
|
+ -- (SELECT IFNULL(sum(case when p.type ='潮粮' then p.pure_weight else p.net_weight end),0)
|
|
|
+ (SELECT IFNULL(sum(case when p.type ='潮粮' then p.net_weight else p.net_weight end),0)
|
|
|
+ FROM payment_management p
|
|
|
+ WHERE p.delete_flag = '0'
|
|
|
+ AND p.customer_number_card = a.customer_number_card
|
|
|
+ AND p.goods_name like CONCAT('%', #{goodsName},'%')
|
|
|
+ AND (DATE_FORMAT(p.create_date,"%Y%m%d") >=
|
|
|
+ DATE_FORMAT(#{year},"%Y%m%d"))
|
|
|
+ AND p.comp_id = b.com_id) as num
|
|
|
+ FROM identity_authentication_info a
|
|
|
+ left join
|
|
|
+ common_company_identity b
|
|
|
+ on
|
|
|
+ a.id = b.identity_id
|
|
|
+ and b.com_id=#{compId}
|
|
|
+ WHERE
|
|
|
+ a.customer_type_flag = '1'
|
|
|
+ and b.delete_flag = '0'
|
|
|
+ and a.cover=0
|
|
|
+ and a.delete_flag = '0'
|
|
|
+ and not exists (SELECT 1
|
|
|
+ FROM payment_management pm
|
|
|
+ LEFT JOIN contract_management_info cmi on cmi.contract_no=pm.contract_no and cmi.comp_id=pm.comp_id and cmi.delete_flag=0
|
|
|
+ WHERE pm.delete_flag = '0'
|
|
|
+ AND cmi.buyer != #{buyer}
|
|
|
+ AND (DATE_FORMAT(pm.create_date,"%Y%m%d") >=
|
|
|
+ DATE_FORMAT(#{year},"%Y%m%d"))
|
|
|
+ AND pm.comp_id = b.com_id
|
|
|
+ AND pm.customer_number_card = a.customer_number_card)
|
|
|
+ <if test="searchKeyWord != null and searchKeyWord != ''">
|
|
|
+ AND (lower(a.customer_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(a.customer_phone) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(a.supplier) like lower(CONCAT('%',#{searchKeyWord},'%')))
|
|
|
+ </if>
|
|
|
+ <if test="authenticationStatusKey != null and authenticationStatusKey != ''">
|
|
|
+ and a.authentication_status_key=#{authenticationStatusKey}
|
|
|
+ </if>
|
|
|
+ group by
|
|
|
+ a.id
|
|
|
+ ORDER BY a.update_date DESC
|
|
|
+ )
|
|
|
+ tt where tt.num + 50000 < #{saleLimit}
|
|
|
+ <if test="currentPage != null and currentPage != ''">
|
|
|
+ LIMIT ${startRecord}, ${pageSize}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|