后台服务
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

WxProfitSharingReceiverApplyMapper.xml 11 KiB

před 2 roky
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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.iformall.mapper.WxProfitSharingReceiverApplyMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxProfitSharingReceiverApply">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
  8. <result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
  9. <result column="plat" jdbcType="INTEGER" property="plat" />
  10. <result column="out_request_no" jdbcType="VARCHAR" property="outRequestNo" />
  11. <result column="organization_type" jdbcType="INTEGER" property="organizationType" />
  12. <result column="finance_institution" jdbcType="INTEGER" property="financeInstitution" />
  13. <result column="business_license_info" jdbcType="VARCHAR" property="businessLicenseInfo" />
  14. <result column="certificate_info" jdbcType="VARCHAR" property="certificateInfo" />
  15. <result column="finance_institution_info" jdbcType="VARCHAR" property="financeInstitutionInfo" />
  16. <result column="id_holder_type" jdbcType="INTEGER" property="idHolderType" />
  17. <result column="id_doc_type" jdbcType="INTEGER" property="idDocType" />
  18. <result column="authorize_letter" jdbcType="VARCHAR" property="authorizeLetter" />
  19. <result column="authorize_letter_copy" jdbcType="VARCHAR" property="authorizeLetterCopy" />
  20. <result column="id_card_info" jdbcType="VARCHAR" property="idCardInfo" />
  21. <result column="id_doc_info" jdbcType="VARCHAR" property="idDocInfo" />
  22. <result column="owner" jdbcType="INTEGER" property="owner" />
  23. <result column="ubo_info_list" jdbcType="VARCHAR" property="uboInfoList" />
  24. <result column="account_info" jdbcType="VARCHAR" property="accountInfo" />
  25. <result column="contact_info" jdbcType="VARCHAR" property="contactInfo" />
  26. <result column="sales_scene_info" jdbcType="VARCHAR" property="salesSceneInfo" />
  27. <result column="settlement_info" jdbcType="VARCHAR" property="settlementInfo" />
  28. <result column="merchant_shortname" jdbcType="VARCHAR" property="merchantShortname" />
  29. <result column="service_phone" jdbcType="VARCHAR" property="servicePhone" />
  30. <result column="sales_info" jdbcType="VARCHAR" property="salesInfo" />
  31. <result column="qualifications" jdbcType="VARCHAR" property="qualifications" />
  32. <result column="addition_info" jdbcType="VARCHAR" property="additionInfo" />
  33. <result column="business_addition_pics" jdbcType="VARCHAR" property="businessAdditionPics" />
  34. <result column="business_addition_desc" jdbcType="VARCHAR" property="businessAdditionDesc" />
  35. <result column="applyment_id" jdbcType="VARCHAR" property="applymentId" />
  36. <result column="applyment_state" jdbcType="INTEGER" property="applymentState" />
  37. <result column="applyment_state_desc" jdbcType="VARCHAR" property="applymentStateDesc" />
  38. <result column="function_state" jdbcType="INTEGER" property="functionState" />
  39. <result column="function_state_desc" jdbcType="VARCHAR" property="functionStateDesc" />
  40. <result column="sign_state" jdbcType="INTEGER" property="signState" />
  41. <result column="sign_url" jdbcType="VARCHAR" property="signUrl" />
  42. <result column="sub_mchid" jdbcType="VARCHAR" property="subMchid" />
  43. <result column="account_validation" jdbcType="VARCHAR" property="accountValidation" />
  44. <result column="audit_detail" jdbcType="VARCHAR" property="auditDetail" />
  45. <result column="legal_validation_url" jdbcType="VARCHAR" property="legalValidationUrl" />
  46. <result column="legal_validation_qrcode" jdbcType="VARCHAR" property="legalValidationQrcode" />
  47. <result column="verify_result" jdbcType="INTEGER" property="verifyResult" />
  48. <result column="verify_fail_reason" jdbcType="VARCHAR" property="verifyFailReason" />
  49. <result column="status" jdbcType="INTEGER" property="status" />
  50. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  51. <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
  52. </resultMap>
  53. <sql id="allColumns">
  54. `id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`plat`,
  55. `out_request_no`,`organization_type`,`finance_institution`,`business_license_info`,`certificate_info`,`finance_institution_info`,
  56. `id_holder_type`,`id_doc_type`,`authorize_letter`,`authorize_letter_copy`,`id_card_info`,`id_doc_info`,
  57. `owner`,`ubo_info_list`,`account_info`,`contact_info`,`sales_scene_info`,`settlement_info`,
  58. `merchant_shortname`,`service_phone`,`sales_info`,`qualifications`,`addition_info`,`business_addition_pics`,`business_addition_desc`,
  59. `applyment_id`,`applyment_state`,`applyment_state_desc`,`function_state`,`function_state_desc`,`sign_state`,`sign_url`,
  60. `sub_mchid`,`account_validation`,`audit_detail`,`legal_validation_url`,`legal_validation_qrcode`,
  61. `verify_result`,`verify_fail_reason`,`status`,`create_time`,`update_time`
  62. </sql>
  63. <sql id="dynamicWhereConditions">
  64. where 1 = 1
  65. <if test=" null != id ">
  66. and `id` = #{id}
  67. </if>
  68. <if test=" null != tenantId and '' != tenantId">
  69. and `tenant_id` = #{tenantId}
  70. </if>
  71. <if test=" null != parentTenantId and '' != parentTenantId">
  72. and `parent_tenant_id` = #{parentTenantId}
  73. </if>
  74. <if test=" null != merchantId ">
  75. and `merchant_id` = #{merchantId}
  76. </if>
  77. <if test=" null != plat ">
  78. and `plat` = #{plat}
  79. </if>
  80. <if test=" null != outRequestNo and '' != outRequestNo">
  81. and `out_request_no` = #{outRequestNo}
  82. </if>
  83. <if test=" null != organizationType ">
  84. and `organization_type` = #{organizationType}
  85. </if>
  86. <if test=" null != applymentId and '' != applymentId ">
  87. and `applyment_id` = #{applymentId}
  88. </if>
  89. <if test=" null != subMchid and '' != subMchid ">
  90. and `sub_mchid` = #{subMchid}
  91. </if>
  92. <if test=" null != applymentState ">
  93. and `applyment_state` = #{applymentState}
  94. </if>
  95. <if test=" null != functionState ">
  96. and `function_state` = #{functionState}
  97. </if>
  98. <if test=" null != signState ">
  99. and `sign_state` = #{signState}
  100. </if>
  101. <if test=" null != verifyResult ">
  102. and `verify_result` = #{verifyResult}
  103. </if>
  104. <if test=" null != status ">
  105. and `status` = #{status}
  106. </if>
  107. <if test=" null != applymentStates ">
  108. and `applyment_state` in
  109. <foreach collection="applymentStates" index="index" item="idItem" open="(" separator="," close=")">
  110. #{idItem}
  111. </foreach>
  112. </if>
  113. <if test=" null != ids ">
  114. and id in
  115. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  116. #{idItem}
  117. </foreach>
  118. </if>
  119. <if test=" null != sortColumns"> order by ${sortColumns} </if>
  120. </sql>
  121. <select id="findList" parameterType="com.iformall.domain.po.WxProfitSharingReceiverApply" resultMap="BaseResultMap">
  122. select
  123. <include refid="allColumns"/>
  124. from wx_profit_sharing_receiver_apply
  125. <include refid="dynamicWhereConditions"/>
  126. </select>
  127. <select id="findResultStateById" parameterType="Long" resultMap="BaseResultMap">
  128. select
  129. `id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`plat`,`out_request_no`,
  130. `applyment_id`,`applyment_state`,`applyment_state_desc`,`sign_state`,`sign_url`,
  131. `sub_mchid`,`account_validation`,`audit_detail`,`legal_validation_url`,`legal_validation_qrcode`,
  132. `verify_result`,`verify_fail_reason`,`status`,`create_time`,`update_time`
  133. from wx_profit_sharing_receiver_apply
  134. where `id` = #{id}
  135. </select>
  136. <select id="findListByApplymentState" parameterType="com.iformall.domain.po.WxProfitSharingReceiverApply" resultMap="BaseResultMap">
  137. select
  138. `id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`plat`,`out_request_no`,`applyment_id`,`applyment_state`
  139. from wx_profit_sharing_receiver_apply
  140. <include refid="dynamicWhereConditions"/>
  141. </select>
  142. <select id="findListByVerifyResult" parameterType="com.iformall.domain.po.WxProfitSharingReceiverApply" resultMap="BaseResultMap">
  143. select
  144. `id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`plat`,`out_request_no`,`applyment_id`,`sub_mchid`,`verify_result`
  145. from wx_profit_sharing_receiver_apply
  146. <include refid="dynamicWhereConditions"/>
  147. </select>
  148. <select id="findListVo" parameterType="com.iformall.domain.vo.WxMerchantReceiverApplyVo" resultType="com.iformall.domain.vo.WxMerchantReceiverApplyVo">
  149. select
  150. m.`id` as merchantId,m.`name` as merchantName,m.`link_person` as merchantlinkPerson,m.`link_phone` as merchantLinkPhone,m.`status` as merchantStatus,
  151. wpsra.`id` as applyId, wpsra.`tenant_id` as tenantId,wpsra.`parent_tenant_id` as parentTenantId,wpsra.`out_request_no` as outRequestNo,wpsra.`plat` as plat,
  152. wpsra.`organization_type` as organizationType,
  153. wpsra.`business_license_info`->>'$.merchant_name' as businessName,wpsra.`business_license_info`->>'$.legal_person' as businessLegalPerson,wpsra.`merchant_shortname` as businessShortName,
  154. wpsra.`contact_info`->>'$.contact_name' as contactName,wpsra.`contact_info`->>'$.mobile_phone' as contactPhone,wpsra.`contact_info`->>'$.contact_email' as contactEmail,
  155. wpsra.`applyment_id` as applymentId,wpsra.`applyment_state` as applymentState,wpsra.`applyment_state_desc` as applymentStateDesc,
  156. wpsra.`function_state` as functionState,wpsra.`function_state_desc` as functionStateDesc,wpsra.`sign_state` as signState,wpsra.`sign_url` as signUrl,
  157. wpsra.`sub_mchid` as subMchid,
  158. wpsra.`account_validation` as accountValidation,wpsra.`audit_detail` as auditDetail,
  159. wpsra.`legal_validation_url` as legalValidationUrl,wpsra.`legal_validation_qrcode` as legalValidationQrcode,
  160. wpsra.`verify_result` as verifyResult,wpsra.`verify_fail_reason` as verifyFailReason,
  161. wpsra.`status` as status,wpsra.`create_time` as createTime,wpsra.`update_time` as updateTime
  162. from wx_profit_sharing_receiver_apply wpsra
  163. left join wx_merchant m on wpsra.merchant_id = m.id and m.is_del = 0
  164. where m.`is_private` = 0
  165. <if test=" null != merchantName and ''!=merchantName ">
  166. and m.`name` like concat('%', #{merchantName},'%')
  167. </if>
  168. <if test=" null != merchantStatus ">
  169. and m.`status` = #{merchantStatus}
  170. </if>
  171. and wpsra.`applyment_state` is not null
  172. <if test=" null != tenantId and '' != tenantId">
  173. and wpsra.`tenant_id` = #{tenantId}
  174. </if>
  175. <if test=" null != parentTenantId and '' != parentTenantId">
  176. and wpsra.`parent_tenant_id` = #{parentTenantId}
  177. </if>
  178. <if test=" null != organizationType ">
  179. and wpsra.`organization_type` = #{organizationType}
  180. </if>
  181. <if test=" null != businessName and '' != businessName">
  182. and wpsra.`business_license_info`->>'$.merchant_name' like concat('%', #{businessName},'%')
  183. </if>
  184. <if test=" null != contactName and '' != contactName">
  185. and wpsra.`contact_info`->>'$.contact_name' like concat('%', #{contactName},'%')
  186. </if>
  187. <if test=" null != applymentId and '' != applymentId ">
  188. and wpsra.`applyment_id` = #{applymentId}
  189. </if>
  190. <if test=" null != subMchid and '' != subMchid ">
  191. and wpsra.`sub_mchid` = #{subMchid}
  192. </if>
  193. <if test=" null != applymentState ">
  194. and wpsra.`applyment_state` = #{applymentState}
  195. </if>
  196. <if test=" null != functionState ">
  197. and wpsra.`function_state` = #{functionState}
  198. </if>
  199. <if test=" null != signState ">
  200. and wpsra.`sign_state` = #{signState}
  201. </if>
  202. <if test=" null != verifyResult ">
  203. and wpsra.`verify_result` = #{verifyResult}
  204. </if>
  205. <if test=" null != status ">
  206. and wpsra.`status` = #{status}
  207. </if>
  208. order by wpsra.`update_time` desc
  209. </select>
  210. </mapper>