ContractMapper.xml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.minpay.db.table.own.mapper.ContractMapper">
  4. <select id="queryContract" resultType="hashmap" parameterType="java.util.Map">
  5. SELECT
  6. inf.OIF_ORDERNO "orderNo",
  7. inf.OIF_COM_ID "comId",
  8. info.CIF_NAME "cifName",
  9. fi.FRS_NO "no",
  10. fi.FRS_FILE_NAME "fileName",
  11. fi.FRS_FILE_URL "fileUrl",
  12. fi.FRS_CREATETIME "createTime",
  13. '00' as "productNum"
  14. FROM pub_file_resources fi, tp_order_inf inf, tp_company_info info
  15. WHERE
  16. info.CIF_ID = inf.OIF_COM_ID
  17. and fi.FRS_NO = inf.OIF_FINANCING_CON
  18. <if test="startDate != null and startDate != '' and endDate != null and endDate != ''">
  19. AND fi.FRS_CREATETIME BETWEEN #{startDate,jdbcType=VARCHAR} AND #{endDate,jdbcType=VARCHAR}
  20. </if>
  21. <if test="contractNo == null or contractNo == ''">
  22. and fi.FRS_NO like CONCAT('%',#{contractNo, jdbcType=VARCHAR},'%')
  23. </if>
  24. <if test="contractType != null and contractType == '00'">
  25. and fi.FRS_NO = inf.OIF_FINANCING_CON
  26. </if>
  27. <if test="contractType != null and contractType == '01'">
  28. and fi.FRS_NO = inf.OIF_PRO_CON
  29. </if>
  30. <if test="contractType != null and contractType == '02'">
  31. and fi.FRS_NO = inf.OIF_GENER_AGREEMENT
  32. </if>
  33. <if test="contractType != null and contractType == '03'">
  34. and fi.FRS_NO = inf.OIF_FORWARD_CON_RUL
  35. </if>
  36. <if test="contractType == null and contractType == ''">
  37. and (fi.FRS_NO = inf.OIF_FINANCING_CON or fi.FRS_NO = inf.OIF_PRO_CON or fi.FRS_NO = inf.OIF_GENER_AGREEMENT or fi.FRS_NO = inf.OIF_FORWARD_CON_RUL)
  38. </if>
  39. <if test="contractNo != null and contractNo != ''">
  40. and fi.FRS_FILE_NAME like CONCAT('%', #{contractNo,jdbcType=VARCHAR}, '%')
  41. </if>
  42. <if test="orderNo != null and orderNo != ''">
  43. and inf.OIF_ORDERNO like CONCAT('%', #{orderNo,jdbcType=VARCHAR}, '%')
  44. </if>
  45. <if test="busName != null and busName != ''">
  46. and info.CIF_NAME like CONCAT('%', #{busName,jdbcType=VARCHAR}, '%')
  47. </if>
  48. </select>
  49. </mapper>