|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.iformall.mapper.WxProfitSharingReceiverApplyMapper">
- <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxProfitSharingReceiverApply">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
- <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
- <result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
- <result column="plat" jdbcType="INTEGER" property="plat" />
- <result column="out_request_no" jdbcType="VARCHAR" property="outRequestNo" />
- <result column="organization_type" jdbcType="INTEGER" property="organizationType" />
- <result column="finance_institution" jdbcType="INTEGER" property="financeInstitution" />
- <result column="business_license_info" jdbcType="VARCHAR" property="businessLicenseInfo" />
- <result column="certificate_info" jdbcType="VARCHAR" property="certificateInfo" />
- <result column="finance_institution_info" jdbcType="VARCHAR" property="financeInstitutionInfo" />
- <result column="id_holder_type" jdbcType="INTEGER" property="idHolderType" />
- <result column="id_doc_type" jdbcType="INTEGER" property="idDocType" />
- <result column="authorize_letter" jdbcType="VARCHAR" property="authorizeLetter" />
- <result column="authorize_letter_copy" jdbcType="VARCHAR" property="authorizeLetterCopy" />
- <result column="id_card_info" jdbcType="VARCHAR" property="idCardInfo" />
- <result column="id_doc_info" jdbcType="VARCHAR" property="idDocInfo" />
- <result column="owner" jdbcType="INTEGER" property="owner" />
- <result column="ubo_info_list" jdbcType="VARCHAR" property="uboInfoList" />
- <result column="account_info" jdbcType="VARCHAR" property="accountInfo" />
- <result column="contact_info" jdbcType="VARCHAR" property="contactInfo" />
- <result column="sales_scene_info" jdbcType="VARCHAR" property="salesSceneInfo" />
- <result column="settlement_info" jdbcType="VARCHAR" property="settlementInfo" />
- <result column="merchant_shortname" jdbcType="VARCHAR" property="merchantShortname" />
- <result column="service_phone" jdbcType="VARCHAR" property="servicePhone" />
- <result column="sales_info" jdbcType="VARCHAR" property="salesInfo" />
- <result column="qualifications" jdbcType="VARCHAR" property="qualifications" />
- <result column="addition_info" jdbcType="VARCHAR" property="additionInfo" />
- <result column="business_addition_pics" jdbcType="VARCHAR" property="businessAdditionPics" />
- <result column="business_addition_desc" jdbcType="VARCHAR" property="businessAdditionDesc" />
-
- <result column="applyment_id" jdbcType="VARCHAR" property="applymentId" />
- <result column="applyment_state" jdbcType="INTEGER" property="applymentState" />
- <result column="applyment_state_desc" jdbcType="VARCHAR" property="applymentStateDesc" />
- <result column="function_state" jdbcType="INTEGER" property="functionState" />
- <result column="function_state_desc" jdbcType="VARCHAR" property="functionStateDesc" />
- <result column="sign_state" jdbcType="INTEGER" property="signState" />
- <result column="sign_url" jdbcType="VARCHAR" property="signUrl" />
- <result column="sub_mchid" jdbcType="VARCHAR" property="subMchid" />
-
- <result column="account_validation" jdbcType="VARCHAR" property="accountValidation" />
- <result column="audit_detail" jdbcType="VARCHAR" property="auditDetail" />
- <result column="legal_validation_url" jdbcType="VARCHAR" property="legalValidationUrl" />
- <result column="legal_validation_qrcode" jdbcType="VARCHAR" property="legalValidationQrcode" />
-
- <result column="verify_result" jdbcType="INTEGER" property="verifyResult" />
- <result column="verify_fail_reason" jdbcType="VARCHAR" property="verifyFailReason" />
-
- <result column="status" jdbcType="INTEGER" property="status" />
-
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
- </resultMap>
-
- <sql id="allColumns">
- `id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`plat`,
- `out_request_no`,`organization_type`,`finance_institution`,`business_license_info`,`certificate_info`,`finance_institution_info`,
- `id_holder_type`,`id_doc_type`,`authorize_letter`,`authorize_letter_copy`,`id_card_info`,`id_doc_info`,
- `owner`,`ubo_info_list`,`account_info`,`contact_info`,`sales_scene_info`,`settlement_info`,
- `merchant_shortname`,`service_phone`,`sales_info`,`qualifications`,`addition_info`,`business_addition_pics`,`business_addition_desc`,
- `applyment_id`,`applyment_state`,`applyment_state_desc`,`function_state`,`function_state_desc`,`sign_state`,`sign_url`,
- `sub_mchid`,`account_validation`,`audit_detail`,`legal_validation_url`,`legal_validation_qrcode`,
- `verify_result`,`verify_fail_reason`,`status`,`create_time`,`update_time`
- </sql>
-
- <sql id="dynamicWhereConditions">
- where 1 = 1
-
- <if test=" null != id ">
- and `id` = #{id}
- </if>
-
- <if test=" null != tenantId and '' != tenantId">
- and `tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and `parent_tenant_id` = #{parentTenantId}
- </if>
-
- <if test=" null != merchantId ">
- and `merchant_id` = #{merchantId}
- </if>
-
- <if test=" null != plat ">
- and `plat` = #{plat}
- </if>
-
- <if test=" null != outRequestNo and '' != outRequestNo">
- and `out_request_no` = #{outRequestNo}
- </if>
-
- <if test=" null != organizationType ">
- and `organization_type` = #{organizationType}
- </if>
-
- <if test=" null != applymentId and '' != applymentId ">
- and `applyment_id` = #{applymentId}
- </if>
-
- <if test=" null != subMchid and '' != subMchid ">
- and `sub_mchid` = #{subMchid}
- </if>
-
- <if test=" null != applymentState ">
- and `applyment_state` = #{applymentState}
- </if>
-
- <if test=" null != functionState ">
- and `function_state` = #{functionState}
- </if>
-
- <if test=" null != signState ">
- and `sign_state` = #{signState}
- </if>
-
- <if test=" null != verifyResult ">
- and `verify_result` = #{verifyResult}
- </if>
-
- <if test=" null != status ">
- and `status` = #{status}
- </if>
-
- <if test=" null != applymentStates ">
- and `applyment_state` in
- <foreach collection="applymentStates" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
-
- <if test=" null != ids ">
- and id in
- <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
- #{idItem}
- </foreach>
- </if>
- <if test=" null != sortColumns"> order by ${sortColumns} </if>
- </sql>
-
- <select id="findList" parameterType="com.iformall.domain.po.WxProfitSharingReceiverApply" resultMap="BaseResultMap">
- select
- <include refid="allColumns"/>
- from wx_profit_sharing_receiver_apply
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="findResultStateById" parameterType="Long" resultMap="BaseResultMap">
- select
- `id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`plat`,`out_request_no`,
- `applyment_id`,`applyment_state`,`applyment_state_desc`,`sign_state`,`sign_url`,
- `sub_mchid`,`account_validation`,`audit_detail`,`legal_validation_url`,`legal_validation_qrcode`,
- `verify_result`,`verify_fail_reason`,`status`,`create_time`,`update_time`
- from wx_profit_sharing_receiver_apply
- where `id` = #{id}
- </select>
-
- <select id="findListByApplymentState" parameterType="com.iformall.domain.po.WxProfitSharingReceiverApply" resultMap="BaseResultMap">
- select
- `id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`plat`,`out_request_no`,`applyment_id`,`applyment_state`
- from wx_profit_sharing_receiver_apply
- <include refid="dynamicWhereConditions"/>
- </select>
-
- <select id="findListByVerifyResult" parameterType="com.iformall.domain.po.WxProfitSharingReceiverApply" resultMap="BaseResultMap">
- select
- `id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`plat`,`out_request_no`,`applyment_id`,`sub_mchid`,`verify_result`
- from wx_profit_sharing_receiver_apply
- <include refid="dynamicWhereConditions"/>
- </select>
-
-
- <select id="findListVo" parameterType="com.iformall.domain.vo.WxMerchantReceiverApplyVo" resultType="com.iformall.domain.vo.WxMerchantReceiverApplyVo">
- select
- m.`id` as merchantId,m.`name` as merchantName,m.`link_person` as merchantlinkPerson,m.`link_phone` as merchantLinkPhone,m.`status` as merchantStatus,
- 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,
- wpsra.`organization_type` as organizationType,
- wpsra.`business_license_info`->>'$.merchant_name' as businessName,wpsra.`business_license_info`->>'$.legal_person' as businessLegalPerson,wpsra.`merchant_shortname` as businessShortName,
- wpsra.`contact_info`->>'$.contact_name' as contactName,wpsra.`contact_info`->>'$.mobile_phone' as contactPhone,wpsra.`contact_info`->>'$.contact_email' as contactEmail,
- wpsra.`applyment_id` as applymentId,wpsra.`applyment_state` as applymentState,wpsra.`applyment_state_desc` as applymentStateDesc,
- wpsra.`function_state` as functionState,wpsra.`function_state_desc` as functionStateDesc,wpsra.`sign_state` as signState,wpsra.`sign_url` as signUrl,
- wpsra.`sub_mchid` as subMchid,
- wpsra.`account_validation` as accountValidation,wpsra.`audit_detail` as auditDetail,
- wpsra.`legal_validation_url` as legalValidationUrl,wpsra.`legal_validation_qrcode` as legalValidationQrcode,
- wpsra.`verify_result` as verifyResult,wpsra.`verify_fail_reason` as verifyFailReason,
- wpsra.`status` as status,wpsra.`create_time` as createTime,wpsra.`update_time` as updateTime
- from wx_profit_sharing_receiver_apply wpsra
- left join wx_merchant m on wpsra.merchant_id = m.id and m.is_del = 0
- where m.`is_private` = 0
- <if test=" null != merchantName and ''!=merchantName ">
- and m.`name` like concat('%', #{merchantName},'%')
- </if>
- <if test=" null != merchantStatus ">
- and m.`status` = #{merchantStatus}
- </if>
-
- and wpsra.`applyment_state` is not null
-
- <if test=" null != tenantId and '' != tenantId">
- and wpsra.`tenant_id` = #{tenantId}
- </if>
- <if test=" null != parentTenantId and '' != parentTenantId">
- and wpsra.`parent_tenant_id` = #{parentTenantId}
- </if>
- <if test=" null != organizationType ">
- and wpsra.`organization_type` = #{organizationType}
- </if>
- <if test=" null != businessName and '' != businessName">
- and wpsra.`business_license_info`->>'$.merchant_name' like concat('%', #{businessName},'%')
- </if>
- <if test=" null != contactName and '' != contactName">
- and wpsra.`contact_info`->>'$.contact_name' like concat('%', #{contactName},'%')
- </if>
- <if test=" null != applymentId and '' != applymentId ">
- and wpsra.`applyment_id` = #{applymentId}
- </if>
-
- <if test=" null != subMchid and '' != subMchid ">
- and wpsra.`sub_mchid` = #{subMchid}
- </if>
-
- <if test=" null != applymentState ">
- and wpsra.`applyment_state` = #{applymentState}
- </if>
-
- <if test=" null != functionState ">
- and wpsra.`function_state` = #{functionState}
- </if>
-
- <if test=" null != signState ">
- and wpsra.`sign_state` = #{signState}
- </if>
-
- <if test=" null != verifyResult ">
- and wpsra.`verify_result` = #{verifyResult}
- </if>
-
- <if test=" null != status ">
- and wpsra.`status` = #{status}
- </if>
-
- order by wpsra.`update_time` desc
- </select>
-
- </mapper>
|