|
@@ -157,4 +157,81 @@
|
|
|
LIMIT ${startRecord}, ${pageSize}
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 获得货主银行流水总数 -->
|
|
|
+ <select id="getBankFlowCountByCondition" parameterType="Map" resultType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ count(c.id)
|
|
|
+ FROM hy_cargo_owner_capital_info c
|
|
|
+ LEFT JOIN hy_cargo_owner_info co ON co.common_id = c.common_id AND co.delete_flag = '0'
|
|
|
+ LEFT JOIN hy_company_info ho ON ho.id = c.company_id AND ho.delete_flag = '0'
|
|
|
+ LEFT JOIN common_user cu ON cu.id = co.common_id AND cu.delete_flag = '0'
|
|
|
+ LEFT JOIN common_user cs ON cs.id = ho.common_id AND cs.delete_flag = '0'
|
|
|
+ WHERE
|
|
|
+ c.delete_flag = '0'
|
|
|
+ AND (c.types = '提现' OR c.types = '充值')
|
|
|
+ AND c.serial_number !=''
|
|
|
+ <if test="searchKeyWord != null and searchKeyWord != ''">
|
|
|
+ AND (lower(co.name) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(cu.phone) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(ho.company_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(ho.legal_person_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(cs.phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ AND (DATE_FORMAT(c.payment_date,"%Y%m%d") >=
|
|
|
+ DATE_FORMAT(#{startDate},"%Y%m%d"))
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ AND (DATE_FORMAT(c.payment_date,"%Y%m%d") <=
|
|
|
+ DATE_FORMAT(#{endDate},"%Y%m%d"))
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 货主银行流水列表查询 -->
|
|
|
+ <select id="getBankFlowListByCondition" parameterType="Map"
|
|
|
+ resultType="com.yh.saas.plugin.yiliangyiyun.entity.HyCargoOwnerCapitalInfo">
|
|
|
+ SELECT
|
|
|
+ c.id,
|
|
|
+ c.common_id as commonId,
|
|
|
+ c.company_id as companyId,
|
|
|
+ c.serial_number as serialNumber,
|
|
|
+ case when c.company_id is null then co.name else ho.legal_person_name end as cargoOwnerName,
|
|
|
+ case when c.company_id is null then cu.phone else cs.phone end as accountNumber,
|
|
|
+ c.bank_card as bankCard,
|
|
|
+ case when ho.company_name is null then '个人货主' else ho.company_name end as affiliatedEnterprise,
|
|
|
+ c.amount_money as amountMoney,
|
|
|
+ c.types,
|
|
|
+ c.payment_date as paymentDate,
|
|
|
+ c.create_date as createDate
|
|
|
+ FROM hy_cargo_owner_capital_info c
|
|
|
+ LEFT JOIN hy_cargo_owner_info co ON co.common_id = c.common_id AND co.delete_flag = '0'
|
|
|
+ LEFT JOIN hy_company_info ho ON ho.id = c.company_id AND ho.delete_flag = '0'
|
|
|
+ LEFT JOIN common_user cu ON cu.id = co.common_id AND cu.delete_flag = '0'
|
|
|
+ LEFT JOIN common_user cs ON cs.id = ho.common_id AND cs.delete_flag = '0'
|
|
|
+ WHERE
|
|
|
+ c.delete_flag = '0'
|
|
|
+ AND (c.types = '提现' OR c.types = '充值')
|
|
|
+ AND c.serial_number !=''
|
|
|
+ <if test="searchKeyWord != null and searchKeyWord != ''">
|
|
|
+ AND (lower(co.name) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(cu.phone) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(ho.company_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(ho.legal_person_name) like lower(CONCAT('%',#{searchKeyWord},'%'))
|
|
|
+ OR lower(cs.phone) like lower(CONCAT('%',#{searchKeyWord},'%')))
|
|
|
+ </if>
|
|
|
+ <if test="startDate != null and startDate != ''">
|
|
|
+ AND (DATE_FORMAT(c.payment_date,"%Y%m%d") >=
|
|
|
+ DATE_FORMAT(#{startDate},"%Y%m%d"))
|
|
|
+ </if>
|
|
|
+ <if test="endDate != null and endDate != ''">
|
|
|
+ AND (DATE_FORMAT(c.payment_date,"%Y%m%d") <=
|
|
|
+ DATE_FORMAT(#{endDate},"%Y%m%d"))
|
|
|
+ </if>
|
|
|
+ ORDER BY c.payment_date DESC
|
|
|
+ <if test="currentPage != null and currentPage != ''">
|
|
|
+ LIMIT ${startRecord}, ${pageSize}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
</mapper>
|