67 lines
2.7 KiB
XML
67 lines
2.7 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.yanzhu.system.mapper.SysUserExtMapper">
|
||
|
|
||
|
<resultMap type="SysUserExt" id="SysUserExtResult">
|
||
|
<result property="userId" column="user_id" />
|
||
|
<result property="projectId" column="project_id" />
|
||
|
<result property="status" column="status" />
|
||
|
<result property="userType" column="user_type" />
|
||
|
</resultMap>
|
||
|
|
||
|
<sql id="selectSysUserExtVo">
|
||
|
select user_id, project_id, status, user_type from sys_user_ext
|
||
|
</sql>
|
||
|
|
||
|
<select id="selectSysUserExtList" parameterType="SysUserExt" resultMap="SysUserExtResult">
|
||
|
<include refid="selectSysUserExtVo"/>
|
||
|
<where>
|
||
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||
|
<if test="userType != null and userType != ''"> and user_type = #{userType}</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="selectSysUserExtByUserId" parameterType="Long" resultMap="SysUserExtResult">
|
||
|
<include refid="selectSysUserExtVo"/>
|
||
|
where user_id = #{userId}
|
||
|
</select>
|
||
|
|
||
|
<insert id="insertSysUserExt" parameterType="SysUserExt">
|
||
|
insert into sys_user_ext
|
||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
<if test="userId != null">user_id,</if>
|
||
|
<if test="projectId != null">project_id,</if>
|
||
|
<if test="status != null">status,</if>
|
||
|
<if test="userType != null">user_type,</if>
|
||
|
</trim>
|
||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
<if test="userId != null">#{userId},</if>
|
||
|
<if test="projectId != null">#{projectId},</if>
|
||
|
<if test="status != null">#{status},</if>
|
||
|
<if test="userType != null">#{userType},</if>
|
||
|
</trim>
|
||
|
</insert>
|
||
|
|
||
|
<update id="updateSysUserExt" parameterType="SysUserExt">
|
||
|
update sys_user_ext
|
||
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
<if test="projectId != null">project_id = #{projectId},</if>
|
||
|
<if test="status != null">status = #{status},</if>
|
||
|
<if test="userType != null">user_type = #{userType},</if>
|
||
|
</trim>
|
||
|
where user_id = #{userId}
|
||
|
</update>
|
||
|
|
||
|
<delete id="deleteSysUserExtByUserId" parameterType="Long">
|
||
|
delete from sys_user_ext where user_id = #{userId}
|
||
|
</delete>
|
||
|
|
||
|
<delete id="deleteSysUserExtByUserIds" parameterType="String">
|
||
|
delete from sys_user_ext where user_id in
|
||
|
<foreach item="userId" collection="array" open="(" separator="," close=")">
|
||
|
#{userId}
|
||
|
</foreach>
|
||
|
</delete>
|
||
|
</mapper>
|