Files
Arbitrate-Backend/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/WeChatUserMapper.xml
T
2023-10-16 17:00:20 +08:00

61 lines
2.9 KiB
XML

<?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>