|
|
@@ -0,0 +1,144 @@
|
|
|
+<?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.zd.laboratory.mapper.XxpUserAuthMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.zd.laboratory.domain.XxpUserAuth" id="XxpUserAuthResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="userId" column="user_id"/>
|
|
|
+ <result property="userName" column="user_name"/>
|
|
|
+ <result property="authType" column="auth_type"/>
|
|
|
+ <result property="userType" column="user_type"/>
|
|
|
+ <result property="subjectId" column="subject_id"/>
|
|
|
+ <result property="subjectName" column="subject_name"/>
|
|
|
+ <result property="hardwareId" column="hardware_id"/>
|
|
|
+ <result property="deptId" column="dept_id"/>
|
|
|
+ <result property="deptName" column="dept_name"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectXxpUserAuth">
|
|
|
+ select id,
|
|
|
+ user_id,
|
|
|
+ user_name,
|
|
|
+ auth_type,
|
|
|
+ user_type,
|
|
|
+ subject_id,
|
|
|
+ subject_name,
|
|
|
+ hardware_id,
|
|
|
+ dept_id,
|
|
|
+ dept_name,
|
|
|
+ create_by,
|
|
|
+ create_time,
|
|
|
+ update_by,
|
|
|
+ update_time
|
|
|
+ from xxp_user_auth t
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectXxpUserAuthList" parameterType="com.zd.laboratory.domain.XxpUserAuth"
|
|
|
+ resultMap="XxpUserAuthResult">
|
|
|
+ <include refid="selectXxpUserAuth"/>
|
|
|
+ <where>
|
|
|
+ <if test="userId != null ">and t.user_id = #{userId}</if>
|
|
|
+ <if test="userName != null and userName != ''">and t.user_name = #{userName}</if>
|
|
|
+ <if test="authType != null ">and t.auth_type = #{authType}</if>
|
|
|
+ <if test="userType != null ">and t.user_type = #{userType}</if>
|
|
|
+ <if test="subjectId != null ">and t.subject_id = #{subjectId}</if>
|
|
|
+ <if test="subjectName != null and subjectName != '' ">and t.subject_name = #{subjectName}</if>
|
|
|
+ <if test="hardwareId != null ">and t.hardware_id = #{hardwareId}</if>
|
|
|
+ <if test="deptId != null ">and ( t.dept_id in (SELECT dt.dept_id FROM sys_dept dt WHERE
|
|
|
+ find_in_set(#{deptId} ,ancestors )) or t.dept_id = #{deptId} )
|
|
|
+ </if>
|
|
|
+ <if test="deptName != null ">and t.dept_name = #{deptName}</if>
|
|
|
+ <if test="createBy != null ">and t.create_by =#{createBy}</if>
|
|
|
+ <if test="createTime != null ">and t.create_time =#{createTime}</if>
|
|
|
+ <if test="updateBy != null ">and t.update_by =#{updateBy}</if>
|
|
|
+ <if test="updateTime != null ">and t.update_time =#{updateTime}</if>
|
|
|
+ <if test="beginTime != null ">
|
|
|
+ and t.create_time >= str_to_date(#{beginTime}, '%Y-%m-%d')
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null ">
|
|
|
+ and t.create_time <= str_to_date(#{endTime}, '%Y-%m-%d')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by t.create_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectXxpUserAuthById" resultMap="XxpUserAuthResult">
|
|
|
+ <include refid="selectXxpUserAuth"/>
|
|
|
+ where t.id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <insert id="insertXxpUserAuth" parameterType="com.zd.laboratory.domain.XxpUserAuth">
|
|
|
+ insert into xxp_user_auth
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="userName != null">user_name,</if>
|
|
|
+ <if test="authType != null">auth_type,</if>
|
|
|
+ <if test="userType != null">user_type,</if>
|
|
|
+ <if test="subjectId != null">subject_id,</if>
|
|
|
+ <if test="subjectName != null">subject_name,</if>
|
|
|
+ <if test="hardwareId != null">hardware_id,</if>
|
|
|
+ <if test="deptId != null">dept_id,</if>
|
|
|
+ <if test="deptName != null">dept_name,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="userName != null">#{userName},</if>
|
|
|
+ <if test="authType != null">#{authType},</if>
|
|
|
+ <if test="userType != null">#{userType},</if>
|
|
|
+ <if test="subjectId != null">#{subjectId},</if>
|
|
|
+ <if test="subjectName != null">#{subjectName},</if>
|
|
|
+ <if test="hardwareId != null">#{hardwareId},</if>
|
|
|
+ <if test="deptId != null">#{deptId},</if>
|
|
|
+ <if test="deptName != null">#{deptName},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateXxpUserAuth" parameterType="com.zd.laboratory.domain.XxpUserAuth">
|
|
|
+ update xxp_user_auth
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
+ <if test="userName != null">user_name = #{userName},</if>
|
|
|
+ <if test="authType != null">auth_type = #{authType},</if>
|
|
|
+ <if test="userType != null">user_type = #{userType},</if>
|
|
|
+ <if test="subjectId != null">subject_id = #{subjectId},</if>
|
|
|
+ <if test="subjectName != null">subject_name = #{subjectName},</if>
|
|
|
+ <if test="hardwareId != null">hardware_id = #{hardwareId},</if>
|
|
|
+ <if test="deptId != null">dept_id = #{deptId},</if>
|
|
|
+ <if test="deptName != null">dept_name = #{deptName},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteXxpUserAuthById">
|
|
|
+ delete
|
|
|
+ from xxp_user_auth
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteXxpUserAuthByIds">
|
|
|
+ delete from xxp_user_auth where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|