2025-07-27 15:53:14 +08:00
|
|
|
<?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.baseUser.mapper.ZcBaseUserMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="ZcBaseUser" id="ZcBaseUserResult">
|
|
|
|
|
<result property="id" column="id" />
|
|
|
|
|
<result property="userName" column="user_name" />
|
|
|
|
|
<result property="avatarUrl" column="avatar_url" />
|
|
|
|
|
<result property="password" column="password" />
|
|
|
|
|
<result property="phoneNumber" column="phone_number" />
|
|
|
|
|
<result property="roleId" column="role_id" />
|
|
|
|
|
<result property="nickName" column="nick_name" />
|
|
|
|
|
<result property="wechatOpenid" column="wechat_openid" />
|
|
|
|
|
<result property="alipayUserid" column="alipay_userid" />
|
|
|
|
|
<result property="delFlag" column="del_flag" />
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectZcBaseUserVo">
|
|
|
|
|
select id, user_name, avatar_url, password, phone_number, role_id, nick_name, wechat_openid, alipay_userid, del_flag, create_time, update_time from zc_base_user
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectZcBaseUserList" parameterType="ZcBaseUser" resultMap="ZcBaseUserResult">
|
|
|
|
|
<include refid="selectZcBaseUserVo"/>
|
2025-07-27 16:08:06 +08:00
|
|
|
<where>
|
|
|
|
|
del_flag = '0'
|
2025-07-27 15:53:14 +08:00
|
|
|
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
|
|
|
|
<if test="avatarUrl != null and avatarUrl != ''"> and avatar_url = #{avatarUrl}</if>
|
|
|
|
|
<if test="password != null and password != ''"> and password = #{password}</if>
|
|
|
|
|
<if test="phoneNumber != null and phoneNumber != ''"> and phone_number = #{phoneNumber}</if>
|
|
|
|
|
<if test="roleId != null "> and role_id = #{roleId}</if>
|
|
|
|
|
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
|
|
|
|
<if test="wechatOpenid != null and wechatOpenid != ''"> and wechat_openid = #{wechatOpenid}</if>
|
|
|
|
|
<if test="alipayUserid != null and alipayUserid != ''"> and alipay_userid = #{alipayUserid}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectZcBaseUserById" parameterType="Long" resultMap="ZcBaseUserResult">
|
|
|
|
|
<include refid="selectZcBaseUserVo"/>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertZcBaseUser" parameterType="ZcBaseUser" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
insert into zc_base_user
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="userName != null and userName != ''">user_name,</if>
|
|
|
|
|
<if test="avatarUrl != null">avatar_url,</if>
|
|
|
|
|
<if test="password != null and password != ''">password,</if>
|
|
|
|
|
<if test="phoneNumber != null and phoneNumber != ''">phone_number,</if>
|
|
|
|
|
<if test="roleId != null">role_id,</if>
|
|
|
|
|
<if test="nickName != null">nick_name,</if>
|
|
|
|
|
<if test="wechatOpenid != null">wechat_openid,</if>
|
|
|
|
|
<if test="alipayUserid != null">alipay_userid,</if>
|
|
|
|
|
<if test="delFlag != null">del_flag,</if>
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="userName != null and userName != ''">#{userName},</if>
|
|
|
|
|
<if test="avatarUrl != null">#{avatarUrl},</if>
|
|
|
|
|
<if test="password != null and password != ''">#{password},</if>
|
|
|
|
|
<if test="phoneNumber != null and phoneNumber != ''">#{phoneNumber},</if>
|
|
|
|
|
<if test="roleId != null">#{roleId},</if>
|
|
|
|
|
<if test="nickName != null">#{nickName},</if>
|
|
|
|
|
<if test="wechatOpenid != null">#{wechatOpenid},</if>
|
|
|
|
|
<if test="alipayUserid != null">#{alipayUserid},</if>
|
|
|
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateZcBaseUser" parameterType="ZcBaseUser">
|
|
|
|
|
update zc_base_user
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
|
|
|
|
<if test="avatarUrl != null">avatar_url = #{avatarUrl},</if>
|
|
|
|
|
<if test="password != null and password != ''">password = #{password},</if>
|
|
|
|
|
<if test="phoneNumber != null and phoneNumber != ''">phone_number = #{phoneNumber},</if>
|
|
|
|
|
<if test="roleId != null">role_id = #{roleId},</if>
|
|
|
|
|
<if test="nickName != null">nick_name = #{nickName},</if>
|
|
|
|
|
<if test="wechatOpenid != null">wechat_openid = #{wechatOpenid},</if>
|
|
|
|
|
<if test="alipayUserid != null">alipay_userid = #{alipayUserid},</if>
|
|
|
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteZcBaseUserById" parameterType="Long">
|
|
|
|
|
delete from zc_base_user where id = #{id}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteZcBaseUserByIds" parameterType="String">
|
2025-07-27 16:08:06 +08:00
|
|
|
update zc_base_user set del_flag = '2' where id in
|
2025-07-27 15:53:14 +08:00
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
</mapper>
|