小程序认证登录

This commit is contained in:
18792927508
2023-10-16 17:00:20 +08:00
parent c80c801239
commit 2e91e53da7
13 changed files with 436 additions and 12 deletions
@@ -177,7 +177,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
<select id="selectUserByIdCard" parameterType="String" resultMap="SysUserResult">
select u.* from sys_user u
where u.id_card = #{idCard} and u.del_flag = '0' and u.status='0' order by u.create_time limit 1
</select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user(
<if test="userId != null and userId != 0">user_id,</if>
<if test="deptId != null and deptId != 0">dept_id,</if>
@@ -11,12 +11,14 @@
<result property="certificationStatus" column="certification_status" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="idAddress" column="id_address" />
</resultMap>
<insert id="insertIdentityAuthentication" parameterType="IdentityAuthentication" useGeneratedKeys="true" keyProperty="id">
insert into identi_authenti(
<if test="userId != null">user_id,</if>
<if test="idAddress != null and idAddress != ''">id_address,</if>
<if test="name != null and name != ''">name,</if>
<if test="identityNo != null and identityNo != ''">identity_no,</if>
certification_time,
@@ -26,6 +28,7 @@
create_time
)values(
<if test="userId != null ">#{userId},</if>
<if test="idAddress != null and idAddress != ''">#{idAddress},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="identityNo != null and identityNo != ''">#{identityNo},</if>
sysdate(),
@@ -35,6 +38,17 @@
sysdate()
)
</insert>
<update id="updateIdentityAuthentication">
update identi_authenti
<set>
<if test="userId != null ">user_id = #{userId},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="identityNo != null and identityNo != ''">identity_no = #{identityNo},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where id = #{id}
</update>
<select id="selectIdentityAuthentication" parameterType="IdentityAuthentication" resultMap="IdentityAuthenticationResult">
SELECT i.id ,i.name ,i.identity_no ,i.certification_time ,i.certification_status ,i.user_id ,i.user_name
@@ -0,0 +1,61 @@
<?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.ruoyi.wisdomarbitrate.mapper.WeChatUserMapper">
<resultMap type="com.ruoyi.wisdomarbitrate.domain.vo.WeChatUserVO" id="BaseResult">
<id property="id" column="id" />
<result property="name" column="name" />
<result property="identityNo" column="identity_no" />
<result property="certificationTime" column="certification_time" />
<result property="certificationStatus" column="certification_status" />
<result property="openId" column="open_id" />
<result property="phone" column="phone" />
<result property="email" column="email" />
</resultMap>
<insert id="insertUser">
insert into identi_authenti(
<if test="name != null and name != ''">name,</if>
<if test="identityNo != null and identityNo != ''">identity_no,</if>
certification_time,
<if test="certificationStatus != null ">certification_status,</if>
<if test="openId != null ">open_id,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
<if test="phone != null and phone != ''">phone,</if>
<if test="email != null and email != ''">email,</if>
create_time
)values(
<if test="name != null and name != ''">#{name},</if>
<if test="identityNo != null and identityNo != ''">#{identityNo},</if>
sysdate(),
<if test="certificationStatus != null ">#{certificationStatus},</if>
<if test="openId != null ">#{openId},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="phone != null and phone != ''">#{phone},</if>
<if test="email != null and email != ''">#{email},</if>
sysdate()
)
</insert>
<update id="updateUser">
update identi_authenti
<set>
<if test="phone != null and phone != ''">phone = #{phone},</if>
<if test="email != null and email != ''">email = #{email},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where id = #{id}
</update>
<select id="selectIdentityAuthentication" resultMap="BaseResult">
SELECT i.id ,i.name ,i.identity_no ,i.certification_time ,i.certification_status ,i.user_id ,i.user_name,open_id,phone,email
from identi_authenti i
</select>
<select id="selectUserByOppenId" resultMap="BaseResult">
SELECT i.id ,i.name ,i.identity_no ,i.certification_time ,i.certification_status ,i.user_id ,i.user_name,open_id,phone,email
from identi_authenti i where open_id=#{oppenId}
</select>
</mapper>