You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
117 lines
6.7 KiB
117 lines
6.7 KiB
<?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.chenhai.system.mapper.SysMuhuUserMapper">
|
|
|
|
<resultMap type="SysMuhuUser" id="SysMuhuUserResult">
|
|
<result property="userId" column="user_id" />
|
|
<result property="realName" column="real_name" />
|
|
<result property="idCard" column="id_card" />
|
|
<result property="idCardFront" column="id_card_front" />
|
|
<result property="idCardBack" column="id_card_back" />
|
|
<result property="faceImage" column="face_image" />
|
|
<result property="authStatus" column="auth_status" />
|
|
<result property="authTime" column="auth_time" />
|
|
<result property="authFailReason" column="auth_fail_reason" />
|
|
<result property="securityQuestion" column="security_question" />
|
|
<result property="securityAnswer" column="security_answer" />
|
|
<result property="lastLoginTime" column="last_login_time" />
|
|
<result property="lastLoginIp" column="last_login_ip" />
|
|
<result property="updateTime" column="update_time" />
|
|
</resultMap>
|
|
|
|
<sql id="selectSysMuhuUserVo">
|
|
select user_id, real_name, id_card, id_card_front, id_card_back, face_image, auth_status, auth_time, auth_fail_reason, security_question, security_answer, last_login_time, last_login_ip, update_time from sys_muhu_user
|
|
</sql>
|
|
|
|
<select id="selectSysMuhuUserList" parameterType="SysMuhuUser" resultMap="SysMuhuUserResult">
|
|
<include refid="selectSysMuhuUserVo"/>
|
|
<where>
|
|
<if test="realName != null and realName != ''"> and real_name like concat('%', #{realName}, '%')</if>
|
|
<if test="idCard != null and idCard != ''"> and id_card = #{idCard}</if>
|
|
<if test="idCardFront != null and idCardFront != ''"> and id_card_front = #{idCardFront}</if>
|
|
<if test="idCardBack != null and idCardBack != ''"> and id_card_back = #{idCardBack}</if>
|
|
<if test="faceImage != null and faceImage != ''"> and face_image = #{faceImage}</if>
|
|
<if test="authStatus != null and authStatus != ''"> and auth_status = #{authStatus}</if>
|
|
<if test="authTime != null "> and auth_time = #{authTime}</if>
|
|
<if test="authFailReason != null and authFailReason != ''"> and auth_fail_reason = #{authFailReason}</if>
|
|
<if test="securityQuestion != null and securityQuestion != ''"> and security_question = #{securityQuestion}</if>
|
|
<if test="securityAnswer != null and securityAnswer != ''"> and security_answer = #{securityAnswer}</if>
|
|
<if test="lastLoginTime != null "> and last_login_time = #{lastLoginTime}</if>
|
|
<if test="lastLoginIp != null and lastLoginIp != ''"> and last_login_ip = #{lastLoginIp}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectSysMuhuUserByUserId" parameterType="Long" resultMap="SysMuhuUserResult">
|
|
<include refid="selectSysMuhuUserVo"/>
|
|
where user_id = #{userId}
|
|
</select>
|
|
|
|
<insert id="insertSysMuhuUser" parameterType="SysMuhuUser">
|
|
insert into sys_muhu_user
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="userId != null">user_id,</if>
|
|
<if test="realName != null">real_name,</if>
|
|
<if test="idCard != null">id_card,</if>
|
|
<if test="idCardFront != null">id_card_front,</if>
|
|
<if test="idCardBack != null">id_card_back,</if>
|
|
<if test="faceImage != null">face_image,</if>
|
|
<if test="authStatus != null">auth_status,</if>
|
|
<if test="authTime != null">auth_time,</if>
|
|
<if test="authFailReason != null">auth_fail_reason,</if>
|
|
<if test="securityQuestion != null">security_question,</if>
|
|
<if test="securityAnswer != null">security_answer,</if>
|
|
<if test="lastLoginTime != null">last_login_time,</if>
|
|
<if test="lastLoginIp != null">last_login_ip,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="userId != null">#{userId},</if>
|
|
<if test="realName != null">#{realName},</if>
|
|
<if test="idCard != null">#{idCard},</if>
|
|
<if test="idCardFront != null">#{idCardFront},</if>
|
|
<if test="idCardBack != null">#{idCardBack},</if>
|
|
<if test="faceImage != null">#{faceImage},</if>
|
|
<if test="authStatus != null">#{authStatus},</if>
|
|
<if test="authTime != null">#{authTime},</if>
|
|
<if test="authFailReason != null">#{authFailReason},</if>
|
|
<if test="securityQuestion != null">#{securityQuestion},</if>
|
|
<if test="securityAnswer != null">#{securityAnswer},</if>
|
|
<if test="lastLoginTime != null">#{lastLoginTime},</if>
|
|
<if test="lastLoginIp != null">#{lastLoginIp},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateSysMuhuUser" parameterType="SysMuhuUser">
|
|
update sys_muhu_user
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="realName != null">real_name = #{realName},</if>
|
|
<if test="idCard != null">id_card = #{idCard},</if>
|
|
<if test="idCardFront != null">id_card_front = #{idCardFront},</if>
|
|
<if test="idCardBack != null">id_card_back = #{idCardBack},</if>
|
|
<if test="faceImage != null">face_image = #{faceImage},</if>
|
|
<if test="authStatus != null">auth_status = #{authStatus},</if>
|
|
<if test="authTime != null">auth_time = #{authTime},</if>
|
|
<if test="authFailReason != null">auth_fail_reason = #{authFailReason},</if>
|
|
<if test="securityQuestion != null">security_question = #{securityQuestion},</if>
|
|
<if test="securityAnswer != null">security_answer = #{securityAnswer},</if>
|
|
<if test="lastLoginTime != null">last_login_time = #{lastLoginTime},</if>
|
|
<if test="lastLoginIp != null">last_login_ip = #{lastLoginIp},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
</trim>
|
|
where user_id = #{userId}
|
|
</update>
|
|
|
|
<delete id="deleteSysMuhuUserByUserId" parameterType="Long">
|
|
delete from sys_muhu_user where user_id = #{userId}
|
|
</delete>
|
|
|
|
<delete id="deleteSysMuhuUserByUserIds" parameterType="String">
|
|
delete from sys_muhu_user where user_id in
|
|
<foreach item="userId" collection="array" open="(" separator="," close=")">
|
|
#{userId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|