feat: user portal support kyc certification
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
<?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="org.wfc.user.mapper.UKycMapper">
|
||||
|
||||
<resultMap type="UKyc" id="UKycResult">
|
||||
<id property="kycId" column="kyc_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="birthDate" column="birth_date" />
|
||||
<result property="idType" column="id_type" />
|
||||
<result property="idFile" column="id_file" />
|
||||
<result property="identifyPicture" column="identify_picture" />
|
||||
<result property="status" column="status" />
|
||||
<result property="description" column="description" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertUserKyc" parameterType="UKyc" useGeneratedKeys="true" keyProperty="kycId">
|
||||
insert into u_kyc(
|
||||
<if test="userId != null and userId != 0">user_id,</if>
|
||||
<if test="birthDate != null">birth_date,</if>
|
||||
<if test="idType != null and idType != ''">id_type,</if>
|
||||
<if test="idFile != null and idFile != ''">id_file,</if>
|
||||
<if test="identifyPicture != null and identifyPicture != ''">identify_picture,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="description != null and description != ''">description,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="userId != null and userId != ''">#{userId},</if>
|
||||
<if test="birthDate != null">STR_TO_DATE(#{birthDate}, '%Y-%m-%d %H:%i:%s'),</if>
|
||||
<if test="idType != null and idType != ''">#{idType},</if>
|
||||
<if test="idFile != null and idFile != ''">#{idFile},</if>
|
||||
<if test="identifyPicture != null and identifyPicture != ''">#{identifyPicture},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="description != null and description != ''">#{description},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateUserKyc" parameterType="UKyc">
|
||||
update u_kyc
|
||||
<set>
|
||||
<if test="birthDate != null">birth_date = STR_TO_DATE(#{birthDate}, '%Y-%m-%d %H:%i:%s'),</if>
|
||||
<if test="idType != null and idType != ''">id_type = #{idType},</if>
|
||||
<if test="idFile != null and idFile != ''">id_file = #{idFile},</if>
|
||||
<if test="identifyPicture != null and identifyPicture != ''">identify_picture = #{identifyPicture},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="description != null and description != ''">description = #{description},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where user_id = #{userId}
|
||||
</update>
|
||||
|
||||
<select id="isExistUserKyc" parameterType="Long" resultType="int">
|
||||
select count(1) from u_user where user_id = #{userId} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectKycByUserId" resultType="org.wfc.user.domain.vo.UKycUserVo">
|
||||
SELECT
|
||||
k.kyc_id,
|
||||
k.user_id,
|
||||
u.user_name,
|
||||
k.birth_date,
|
||||
k.id_type,
|
||||
k.id_file,
|
||||
k.identify_picture,
|
||||
k.`status` as kyc_request_status,
|
||||
u.`kyc_status` as user_kyc_status,
|
||||
k.create_time,
|
||||
k.update_time
|
||||
FROM
|
||||
u_kyc k
|
||||
LEFT JOIN u_user u ON u.user_id = k.user_id
|
||||
WHERE
|
||||
u.del_flag = 0
|
||||
AND k.del_flag = 0
|
||||
AND k.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user