155 lines
5.7 KiB
XML
155 lines
5.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="cn.wepact.dfm.training.mapper.TUserPermissionMapper">
|
|
<resultMap id="BaseResultMap" type="cn.wepact.dfm.training.dto.entity.TUserPermission">
|
|
<id column="id" jdbcType="BIGINT" property="id" />
|
|
<result column="user_id" jdbcType="BIGINT" property="userId" />
|
|
<result column="user_type" jdbcType="VARCHAR" property="userType" />
|
|
<result column="org_code" jdbcType="VARCHAR" property="orgCode" />
|
|
<result column="pre_type" jdbcType="VARCHAR" property="preType" />
|
|
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
|
|
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
|
|
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
|
|
<result column="created_by" jdbcType="VARCHAR" property="createdBy" />
|
|
<result column="del_flag" jdbcType="VARCHAR" property="delFlag" />
|
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
|
id, user_id, user_type, org_code, pre_type, updated_at, updated_by, created_at,
|
|
created_by, del_flag
|
|
</sql>
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
from t_user_permission
|
|
where id = #{id,jdbcType=BIGINT}
|
|
</select>
|
|
<select id="selectByUserId" resultMap="BaseResultMap"
|
|
parameterType="java.lang.Long">
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
from t_user_permission
|
|
where user_id = #{userId,jdbcType=BIGINT}
|
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
delete from t_user_permission
|
|
where id = #{id,jdbcType=BIGINT}
|
|
</delete>
|
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="cn.wepact.dfm.training.dto.entity.TUserPermission" useGeneratedKeys="true">
|
|
insert into t_user_permission (user_id, user_type, org_code,
|
|
pre_type, updated_at, updated_by,
|
|
created_at, created_by, del_flag
|
|
)
|
|
values (#{userId,jdbcType=BIGINT}, #{userType,jdbcType=VARCHAR}, #{orgCode,jdbcType=BIGINT},
|
|
#{preType,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=VARCHAR},
|
|
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=VARCHAR}, #{delFlag,jdbcType=VARCHAR}
|
|
)
|
|
</insert>
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="cn.wepact.dfm.training.dto.entity.TUserPermission" useGeneratedKeys="true">
|
|
insert into t_user_permission
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="userId != null">
|
|
user_id,
|
|
</if>
|
|
<if test="userType != null">
|
|
user_type,
|
|
</if>
|
|
<if test="orgCode != null">
|
|
org_code,
|
|
</if>
|
|
<if test="preType != null">
|
|
pre_type,
|
|
</if>
|
|
<if test="updatedAt != null">
|
|
updated_at,
|
|
</if>
|
|
<if test="updatedBy != null">
|
|
updated_by,
|
|
</if>
|
|
<if test="createdAt != null">
|
|
created_at,
|
|
</if>
|
|
<if test="createdBy != null">
|
|
created_by,
|
|
</if>
|
|
<if test="delFlag != null">
|
|
del_flag,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="userId != null">
|
|
#{userId,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="userType != null">
|
|
#{userType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="orgCode != null">
|
|
#{orgCode,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="preType != null">
|
|
#{preType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="updatedAt != null">
|
|
#{updatedAt,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="updatedBy != null">
|
|
#{updatedBy,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createdAt != null">
|
|
#{createdAt,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="createdBy != null">
|
|
#{createdBy,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="delFlag != null">
|
|
#{delFlag,jdbcType=VARCHAR},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<update id="updateByPrimaryKeySelective" parameterType="cn.wepact.dfm.training.dto.entity.TUserPermission">
|
|
update t_user_permission
|
|
<set>
|
|
<if test="userId != null">
|
|
user_id = #{userId,jdbcType=BIGINT},
|
|
</if>
|
|
<if test="userType != null">
|
|
user_type = #{userType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="orgCode != null">
|
|
org_code = #{orgCode,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="preType != null">
|
|
pre_type = #{preType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="updatedAt != null">
|
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="updatedBy != null">
|
|
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="createdAt != null">
|
|
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
|
</if>
|
|
<if test="createdBy != null">
|
|
created_by = #{createdBy,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="delFlag != null">
|
|
del_flag = #{delFlag,jdbcType=VARCHAR},
|
|
</if>
|
|
</set>
|
|
where id = #{id,jdbcType=BIGINT}
|
|
</update>
|
|
<update id="updateByPrimaryKey" parameterType="cn.wepact.dfm.training.dto.entity.TUserPermission">
|
|
update t_user_permission
|
|
set user_id = #{userId,jdbcType=BIGINT},
|
|
user_type = #{userType,jdbcType=VARCHAR},
|
|
org_code = #{orgCode,jdbcType=VARCHAR},
|
|
pre_type = #{preType,jdbcType=VARCHAR},
|
|
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
|
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
|
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
|
created_by = #{createdBy,jdbcType=VARCHAR},
|
|
del_flag = #{delFlag,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=BIGINT}
|
|
</update>
|
|
</mapper>
|