ImportAsyncMapper.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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.ydtech.modules.fnc.dao.ImportAsyncMapper">
  4. <!-- 通用查询映射结果 -->
  5. <resultMap id="BaseResultMap" type="com.ydtech.modules.fnc.entity.ImportResult">
  6. <id column="id" property="id"/>
  7. <result column="create_time" property="createTime"/>
  8. <result column="created_at" property="createdAt"/>
  9. <result column="completed_at" property="completedAt"/>
  10. <result column="status" property="status"/>
  11. <result column="total_amount" property="totalAmount"/>
  12. <result column="upload_url" property="uploadUrl"/>
  13. <result column="company_id" property="companyId"/>
  14. <result column="partner_companies_id" property="partnerCompaniesId"/>
  15. <result column="agreement_id" property="agreementId"/>
  16. <result column="ids" property="ids"/>
  17. <result column="hand_status" property="handStatus"/>
  18. <result column="income_id" property="incomeId"/>
  19. </resultMap>
  20. <select id="queryNew" resultType="com.ydtech.modules.fnc.entity.ImportResult">
  21. select
  22. a.id as "id",
  23. a.create_time as "createTime",
  24. a.created_at as "createdAt",
  25. a.completed_at as "completedAt",
  26. a.status as "status",
  27. a.total_amount as "totalAmount",
  28. a.upload_url as "uploadUrl",
  29. a.company_id as "companyId",
  30. a.partner_companies_id as "partnerCompaniesId",
  31. a.agreement_id as "agreementId",
  32. a.ids as "ids",
  33. a.hand_status as "handStatus",
  34. a.hand_status as "handStatus",
  35. a.income_id as "incomeId",
  36. eic.namesimple as "partnerCompaniesName"
  37. from
  38. import_task a
  39. LEFT JOIN esm_ins_company eic on eic.id = a.partner_companies_id
  40. <where>
  41. <if test="handStatus !=null and handStatus !=''">
  42. a.hand_status =#{handStatus}
  43. </if>
  44. <if test="createTime !=null and createTime !=''">
  45. AND DATE(a.create_time) =#{createTime}
  46. </if>
  47. <if test="incomeId !=null and incomeId !=''">
  48. AND a.income_id =#{incomeId}
  49. </if>
  50. </where>
  51. order by a.create_time desc
  52. </select>
  53. <select id="selectByIncomeId" resultType="com.ydtech.modules.fnc.entity.ImportResult">
  54. select
  55. a.id as "id",
  56. a.create_time as "createTime",
  57. a.created_at as "createdAt",
  58. a.completed_at as "completedAt",
  59. a.status as "status",
  60. a.total_amount as "totalAmount",
  61. a.upload_url as "uploadUrl",
  62. a.company_id as "companyId",
  63. a.partner_companies_id as "partnerCompaniesId",
  64. a.agreement_id as "agreementId",
  65. a.ids as "ids",
  66. a.hand_status as "handStatus",
  67. a.hand_status as "handStatus",
  68. a.income_id as "incomeId",
  69. eic.namesimple as "partnerCompaniesName"
  70. from
  71. import_task a
  72. LEFT JOIN esm_ins_company eic on eic.id = a.partner_companies_id
  73. <where>
  74. <if test="handStatus !=null and handStatus !=''">
  75. a.hand_status =#{handStatus}
  76. </if>
  77. <if test="createTime !=null and createTime !=''">
  78. AND DATE(a.create_time) =#{createTime}
  79. </if>
  80. <if test="incomeId !=null and incomeId !=''">
  81. AND a.income_id =#{incomeId}
  82. </if>
  83. </where>
  84. order by a.create_time desc
  85. </select>
  86. </mapper>