|
|
@@ -24,6 +24,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="faceFeature" column="face_feature"/>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <resultMap type="com.zd.laboratory.api.entity.LabSysUserInfo" id="labSysUserInfo">
|
|
|
+ <result property="userId" column="user_id"/>
|
|
|
+ <result property="faceFeature" column="face_feature"/>
|
|
|
+ <result property="userName" column="user_name"/>
|
|
|
+ <result property="userType" column="user_type"/>
|
|
|
+ <result property="isWhite" column="is_white"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
<sql id="selectLabStudentsInfoVo">
|
|
|
select join_students_id,opinions,audit_time,audit_user, audit_status, card, face_img, dept_id, dept_name, user_id, remark, create_by, create_time, update_by, update_time,face_feature from lab_students_info si
|
|
|
</sql>
|
|
|
@@ -61,89 +69,94 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
where join_students_id = #{joinStudentsId}
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectLabStudentsInfoBySubjectId" resultType="com.zd.system.api.entity.LabStudentsInfo">
|
|
|
- <!--SELECT join_students_id,face_feature FROM `lab_students_info` WHERE join_students_id IN ( SELECT user_id
|
|
|
+ <select id="selectLabStudentsInfoBySubjectId" resultMap="labSysUserInfo">
|
|
|
+ <!--SELECT join_students_id,face_feature FROM `lab_students_info` WHERE join_students_id IN ( SELECT user_id
|
|
|
FROM lab_security_apply AS lab WHERE audit_status=2 AND subject_id=#{subjectId} AND valid_end_time >= NOW())-->
|
|
|
- SELECT join_students_id,face_feature FROM `lab_students_info` lsi WHERE (SELECT COUNT(*)
|
|
|
- FROM lab_security_apply AS lab WHERE audit_status=2 AND subject_id=#{subjectId} AND valid_end_time <![CDATA[<]]> NOW() AND lab.user_id=lsi.user_id )>0
|
|
|
- UNION
|
|
|
- SELECT join_students_id,face_feature FROM `lab_students_info` lsi WHERE (SELECT COUNT(*)
|
|
|
- FROM lab_whitelist AS lw WHERE lsi.user_id=lw.user_id)>0
|
|
|
- </select>
|
|
|
+ <!-- SELECT join_students_id,face_feature FROM `lab_students_info` lsi WHERE (SELECT COUNT(*)
|
|
|
+ FROM lab_security_apply AS lab WHERE audit_status=2 AND subject_id=#{subjectId} AND valid_end_time <![CDATA[<]]> NOW() AND lab.user_id=lsi.user_id )>0
|
|
|
+ UNION
|
|
|
+ SELECT join_students_id,face_feature FROM `lab_students_info` lsi WHERE (SELECT COUNT(*)
|
|
|
+ FROM lab_whitelist AS lw WHERE lsi.user_id=lw.user_id)>0-->
|
|
|
+ SELECT join_students_id as user_id,face_feature,(SELECT nick_name FROM sys_user su WHERE su.user_id=lsi.user_id) AS user_name,(SELECT user_type FROM sys_user su WHERE su.user_id=lsi.user_id) AS user_type,0 AS is_white FROM `lab_students_info` lsi WHERE (SELECT COUNT(*)
|
|
|
+ FROM lab_security_apply AS lab WHERE audit_status=2 AND subject_id=#{subjectId} AND valid_end_time <![CDATA[<]]> NOW() AND lab.user_id=lsi.user_id )>0
|
|
|
+ UNION
|
|
|
+ SELECT join_students_id user_id,face_feature,(SELECT nick_name FROM sys_user su WHERE su.user_id=lsi.user_id) AS user_name,(SELECT user_type FROM sys_user su WHERE su.user_id=lsi.user_id) AS user_type,1 AS is_white FROM `lab_students_info` lsi WHERE (SELECT COUNT(*)
|
|
|
+ FROM lab_whitelist AS lw WHERE lsi.user_id=lw.user_id)>0
|
|
|
+ </select>
|
|
|
|
|
|
- <insert id="insertLabStudentsInfo" parameterType="com.zd.system.api.entity.LabStudentsInfo">
|
|
|
- insert into lab_students_info
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="joinStudentsId != null">join_students_id,</if>
|
|
|
- <if test="auditStatus != null">audit_status,</if>
|
|
|
- <if test="card != null">card,</if>
|
|
|
- <if test="faceImg != null">face_img,</if>
|
|
|
- <if test="deptId != null">dept_id,</if>
|
|
|
- <if test="deptName != null">dept_name,</if>
|
|
|
- <if test="userId != null">user_id,</if>
|
|
|
- <if test="remark != null">remark,</if>
|
|
|
- <if test="createBy != null">create_by,</if>
|
|
|
- <if test="createTime != null">create_time,</if>
|
|
|
- <if test="updateBy != null">update_by,</if>
|
|
|
- <if test="updateTime != null">update_time,</if>
|
|
|
- <if test="opinions != null">opinions,</if>
|
|
|
- <if test="auditTime != null">audit_time,</if>
|
|
|
- <if test="auditUser != null">audit_user,</if>
|
|
|
- <if test="commitTime != null">commit_time,</if>
|
|
|
- <if test="faceFeature != null">face_feature,</if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="joinStudentsId != null">#{joinStudentsId},</if>
|
|
|
- <if test="auditStatus != null">#{auditStatus},</if>
|
|
|
- <if test="card != null">#{card},</if>
|
|
|
- <if test="faceImg != null">#{faceImg},</if>
|
|
|
- <if test="deptId != null">#{deptId},</if>
|
|
|
- <if test="deptName != null">#{deptName},</if>
|
|
|
- <if test="userId != null">#{userId},</if>
|
|
|
- <if test="remark != null">#{remark},</if>
|
|
|
- <if test="createBy != null">#{createBy},</if>
|
|
|
- <if test="createTime != null">#{createTime},</if>
|
|
|
- <if test="updateBy != null">#{updateBy},</if>
|
|
|
- <if test="updateTime != null">#{updateTime},</if>
|
|
|
- <if test="opinions != null">#{opinions},</if>
|
|
|
- <if test="auditTime != null">#{auditTime},</if>
|
|
|
- <if test="auditUser != null">#{auditUser},</if>
|
|
|
- <if test="commitTime != null">#{commitTime},</if>
|
|
|
- <if test="faceFeature != null">#{faceFeature},</if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
+ <insert id="insertLabStudentsInfo" parameterType="com.zd.system.api.entity.LabStudentsInfo">
|
|
|
+ insert into lab_students_info
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="joinStudentsId != null">join_students_id,</if>
|
|
|
+ <if test="auditStatus != null">audit_status,</if>
|
|
|
+ <if test="card != null">card,</if>
|
|
|
+ <if test="faceImg != null">face_img,</if>
|
|
|
+ <if test="deptId != null">dept_id,</if>
|
|
|
+ <if test="deptName != null">dept_name,</if>
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="opinions != null">opinions,</if>
|
|
|
+ <if test="auditTime != null">audit_time,</if>
|
|
|
+ <if test="auditUser != null">audit_user,</if>
|
|
|
+ <if test="commitTime != null">commit_time,</if>
|
|
|
+ <if test="faceFeature != null">face_feature,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="joinStudentsId != null">#{joinStudentsId},</if>
|
|
|
+ <if test="auditStatus != null">#{auditStatus},</if>
|
|
|
+ <if test="card != null">#{card},</if>
|
|
|
+ <if test="faceImg != null">#{faceImg},</if>
|
|
|
+ <if test="deptId != null">#{deptId},</if>
|
|
|
+ <if test="deptName != null">#{deptName},</if>
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="opinions != null">#{opinions},</if>
|
|
|
+ <if test="auditTime != null">#{auditTime},</if>
|
|
|
+ <if test="auditUser != null">#{auditUser},</if>
|
|
|
+ <if test="commitTime != null">#{commitTime},</if>
|
|
|
+ <if test="faceFeature != null">#{faceFeature},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
|
|
|
- <update id="updateLabStudentsInfo" parameterType="com.zd.system.api.entity.LabStudentsInfo">
|
|
|
- update lab_students_info
|
|
|
- <trim prefix="SET" suffixOverrides=",">
|
|
|
- <if test="auditStatus != null">audit_status = #{auditStatus},</if>
|
|
|
- <if test="card != null">card = #{card},</if>
|
|
|
- <if test="faceImg != null">face_img = #{faceImg},</if>
|
|
|
- <if test="deptId != null">dept_id = #{deptId},</if>
|
|
|
- <if test="deptName != null">dept_name = #{deptName},</if>
|
|
|
- <if test="userId != null">user_id = #{userId},</if>
|
|
|
- <if test="remark != null">remark = #{remark},</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>
|
|
|
- <if test="opinions != null">opinions = #{opinions},</if>
|
|
|
- <if test="auditTime != null">audit_time = #{auditTime},</if>
|
|
|
- <if test="auditUser != null">audit_user = #{auditUser},</if>
|
|
|
- <if test="commitTime != null">commit_time =#{commitTime},</if>
|
|
|
- <if test="faceFeature != null">face_feature =#{faceFeature},</if>
|
|
|
- </trim>
|
|
|
- where join_students_id = #{joinStudentsId}
|
|
|
- </update>
|
|
|
+ <update id="updateLabStudentsInfo" parameterType="com.zd.system.api.entity.LabStudentsInfo">
|
|
|
+ update lab_students_info
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="auditStatus != null">audit_status = #{auditStatus},</if>
|
|
|
+ <if test="card != null">card = #{card},</if>
|
|
|
+ <if test="faceImg != null">face_img = #{faceImg},</if>
|
|
|
+ <if test="deptId != null">dept_id = #{deptId},</if>
|
|
|
+ <if test="deptName != null">dept_name = #{deptName},</if>
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</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>
|
|
|
+ <if test="opinions != null">opinions = #{opinions},</if>
|
|
|
+ <if test="auditTime != null">audit_time = #{auditTime},</if>
|
|
|
+ <if test="auditUser != null">audit_user = #{auditUser},</if>
|
|
|
+ <if test="commitTime != null">commit_time =#{commitTime},</if>
|
|
|
+ <if test="faceFeature != null">face_feature =#{faceFeature},</if>
|
|
|
+ </trim>
|
|
|
+ where join_students_id = #{joinStudentsId}
|
|
|
+ </update>
|
|
|
|
|
|
- <delete id="deleteLabStudentsInfoByJoinStudentsId" >
|
|
|
- delete from lab_students_info where join_students_id = #{joinStudentsId}
|
|
|
- </delete>
|
|
|
+ <delete id="deleteLabStudentsInfoByJoinStudentsId" >
|
|
|
+ delete from lab_students_info where join_students_id = #{joinStudentsId}
|
|
|
+ </delete>
|
|
|
|
|
|
- <delete id="deleteLabStudentsInfoByJoinStudentsIds">
|
|
|
- delete from lab_students_info where join_students_id in
|
|
|
- <foreach item="joinStudentsId" collection="array" open="(" separator="," close=")">
|
|
|
- #{joinStudentsId}
|
|
|
- </foreach>
|
|
|
- </delete>
|
|
|
-</mapper>
|
|
|
+ <delete id="deleteLabStudentsInfoByJoinStudentsIds">
|
|
|
+ delete from lab_students_info where join_students_id in
|
|
|
+ <foreach item="joinStudentsId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{joinStudentsId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+ </mapper>
|