|
|
@@ -5,68 +5,118 @@
|
|
|
<mapper namespace="com.zd.laboratory.mapper.LabSecurityMaterialDataMapper">
|
|
|
|
|
|
<resultMap type="com.zd.laboratory.domain.LabSecurityMaterialData" id="LabSecurityMaterialDataResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="materialName" column="material_name" />
|
|
|
- <result property="materialDescribe" column="material_describe" />
|
|
|
- <result property="materialSuit" column="material_suit" />
|
|
|
- <result property="materialType" column="material_type" />
|
|
|
- <result property="fileType" column="file_type" />
|
|
|
- <result property="relationType" column="relation_type" />
|
|
|
- <result property="createUserid" column="create_userid" />
|
|
|
- <result property="createUsername" column="create_username" />
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
- <result property="updateUserid" column="update_userid" />
|
|
|
- <result property="updateUsername" column="update_username" />
|
|
|
- <result property="updateTime" column="update_time" />
|
|
|
- <result property="remak" column="remak" />
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="materialName" column="material_name"/>
|
|
|
+ <result property="materialDescribe" column="material_describe"/>
|
|
|
+ <result property="materialSuit" column="material_suit"/>
|
|
|
+ <result property="materialType" column="material_type"/>
|
|
|
+ <result property="fileType" column="file_type"/>
|
|
|
+ <result property="relationType" column="relation_type"/>
|
|
|
+ <result property="userId" column="user_id"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="deptId" column="dept_id"/>
|
|
|
+ <result property="deptName" column="dept_name"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateUserid" column="update_userid"/>
|
|
|
+ <result property="updateUsername" column="update_username"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="remak" column="remak"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.zd.laboratory.domain.vo.LabSecurityMaterialDataVO" id="LabSecurityMaterialDataResultVO">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="materialName" column="material_name" />
|
|
|
- <result property="materialDescribe" column="material_describe" />
|
|
|
- <result property="materialSuit" column="material_suit" />
|
|
|
- <result property="materialType" column="material_type" />
|
|
|
- <result property="fileType" column="file_type" />
|
|
|
- <result property="relationType" column="relation_type" />
|
|
|
- <result property="createUserid" column="create_userid" />
|
|
|
- <result property="createUsername" column="create_username" />
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
- <result property="updateUserid" column="update_userid" />
|
|
|
- <result property="updateUsername" column="update_username" />
|
|
|
- <result property="updateTime" column="update_time" />
|
|
|
- <result property="remak" column="remak" />
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="materialName" column="material_name"/>
|
|
|
+ <result property="materialDescribe" column="material_describe"/>
|
|
|
+ <result property="materialSuit" column="material_suit"/>
|
|
|
+ <result property="materialType" column="material_type"/>
|
|
|
+ <result property="fileType" column="file_type"/>
|
|
|
+ <result property="relationType" column="relation_type"/>
|
|
|
+ <result property="userId" column="user_id"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="deptId" column="dept_id"/>
|
|
|
+ <result property="deptName" column="dept_name"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateUserid" column="update_userid"/>
|
|
|
+ <result property="updateUsername" column="update_username"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="remak" column="remak"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectLabSecurityMaterialDataVo">
|
|
|
- select id, material_name, material_describe, material_suit, material_type,file_type ,relation_type, create_userid, create_username, create_time, update_userid, update_username, update_time, remak from lab_security_material_data
|
|
|
+ select id,
|
|
|
+ material_name,
|
|
|
+ material_describe,
|
|
|
+ material_suit,
|
|
|
+ material_type,
|
|
|
+ file_type,
|
|
|
+ relation_type,
|
|
|
+ user_id,
|
|
|
+ create_by,
|
|
|
+ dept_id,
|
|
|
+ dept_name,
|
|
|
+ create_time,
|
|
|
+ update_userid,
|
|
|
+ update_username,
|
|
|
+ update_time,
|
|
|
+ remak
|
|
|
+ from lab_security_material_data
|
|
|
</sql>
|
|
|
<sql id="selectLabSecurityMaterialDataListVo">
|
|
|
- select t.id, t.material_name, t.material_describe, t.material_suit, t.material_type,t.file_type ,t.relation_type, t.create_userid, t.create_username, t.create_time, t.update_userid, t.update_username, t.update_time, t.remak from lab_security_material_data as t
|
|
|
+ select t.id,
|
|
|
+ t.material_name,
|
|
|
+ t.material_describe,
|
|
|
+ t.material_suit,
|
|
|
+ t.material_type,
|
|
|
+ t.file_type,
|
|
|
+ t.relation_type,
|
|
|
+ t.user_id,
|
|
|
+ t.create_by,
|
|
|
+ t.dept_id,
|
|
|
+ t.dept_name,
|
|
|
+ t.create_time,
|
|
|
+ t.update_userid,
|
|
|
+ t.update_username,
|
|
|
+ t.update_time,
|
|
|
+ t.remak
|
|
|
+ from lab_security_material_data as t
|
|
|
+ LEFT JOIN sys_dept d on t.dept_id=d.dept_id
|
|
|
+ LEFT JOIN sys_user u on t.user_id=u.user_id
|
|
|
</sql>
|
|
|
- <select id="selectLabSecurityMaterialDataList" parameterType="com.zd.laboratory.domain.LabSecurityMaterialData" resultMap="LabSecurityMaterialDataResult">
|
|
|
- <include refid="selectLabSecurityMaterialDataVo"/>
|
|
|
+ <select id="selectLabSecurityMaterialDataList" parameterType="com.zd.laboratory.domain.LabSecurityMaterialData"
|
|
|
+ resultMap="LabSecurityMaterialDataResult">
|
|
|
+ <include refid="selectLabSecurityMaterialDataListVo"/>
|
|
|
<where>
|
|
|
- <if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
|
|
- <if test="materialDescribe != null and materialDescribe != ''"> and material_describe = #{materialDescribe}</if>
|
|
|
- <if test="materialSuit != null "> and material_suit = #{materialSuit}</if>
|
|
|
- <if test="materialType != null "> and material_type = #{materialType}</if>
|
|
|
- <if test="materialType != null "> and relation_type = #{relationType}</if>
|
|
|
- <if test="createUserid != null "> and create_userid = #{createUserid}</if>
|
|
|
- <if test="createUsername != null and createUsername != ''"> and create_username like concat('%', #{createUsername}, '%')</if>
|
|
|
- <if test="updateUserid != null "> and update_userid = #{updateUserid}</if>
|
|
|
- <if test="updateUsername != null and updateUsername != ''"> and update_username like concat('%', #{updateUsername}, '%')</if>
|
|
|
- <if test="remak != null and remak != ''"> and remak = #{remak}</if>
|
|
|
+ <if test="materialName != null and materialName != ''">and t.material_name like concat('%', #{materialName},
|
|
|
+ '%')
|
|
|
+ </if>
|
|
|
+ <if test="materialDescribe != null and materialDescribe != ''">and t.material_describe =
|
|
|
+ #{materialDescribe}
|
|
|
+ </if>
|
|
|
+ <if test="materialSuit != null ">and t.material_suit = #{materialSuit}</if>
|
|
|
+ <if test="materialType != null ">and t.material_type = #{materialType}</if>
|
|
|
+ <if test="materialType != null ">and t.relation_type = #{relationType}</if>
|
|
|
+ <if test="userId != null ">and t.user_id = #{userId}</if>
|
|
|
+ <if test="createBy != null and createBy != ''">and t.create_by like concat('%',
|
|
|
+ #{createBy}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="updateUserid != null ">and t.update_userid = #{updateUserid}</if>
|
|
|
+ <if test="updateUsername != null and updateUsername != ''">and t.update_username like concat('%',
|
|
|
+ #{updateUsername}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="remak != null and remak != ''">and t.remak = #{remak}</if>
|
|
|
+ <!-- 数据范围过滤 -->
|
|
|
+ ${params.dataScope}
|
|
|
</where>
|
|
|
order by create_time desc
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectLabSecurityMaterialDataById" resultMap="LabSecurityMaterialDataResult">
|
|
|
+ <select id="selectLabSecurityMaterialDataById" resultMap="LabSecurityMaterialDataResult">
|
|
|
<include refid="selectLabSecurityMaterialDataVo"/>
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
|
|
|
- <insert id="insertLabSecurityMaterialData" parameterType="com.zd.laboratory.domain.LabSecurityMaterialData" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ <insert id="insertLabSecurityMaterialData" parameterType="com.zd.laboratory.domain.LabSecurityMaterialData"
|
|
|
+ useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into lab_security_material_data
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="materialName != null">material_name,</if>
|
|
|
@@ -81,9 +131,13 @@
|
|
|
|
|
|
<if test="relationType != null">relation_type,</if>
|
|
|
|
|
|
- <if test="createUserid != null">create_userid,</if>
|
|
|
+ <if test="userId != null">user_id,</if>
|
|
|
+
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
|
|
|
- <if test="createUsername != null">create_username,</if>
|
|
|
+ <if test="deptId != null">dept_id,</if>
|
|
|
+
|
|
|
+ <if test="deptName != null">dept_name,</if>
|
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
|
@@ -103,8 +157,10 @@
|
|
|
<if test="materialType != null">#{materialType},</if>
|
|
|
<if test="fileType != null">#{fileType},</if>
|
|
|
<if test="relationType != null">#{relationType},</if>
|
|
|
- <if test="createUserid != null">#{createUserid},</if>
|
|
|
- <if test="createUsername != null">#{createUsername},</if>
|
|
|
+ <if test="userId != null">#{userId},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="deptId != null">#{deptId},</if>
|
|
|
+ <if test="deptName != null">#{deptName},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
<if test="updateUserid != null">#{updateUserid},</if>
|
|
|
<if test="updateUsername != null">#{updateUsername},</if>
|
|
|
@@ -122,8 +178,10 @@
|
|
|
<if test="materialType != null">material_type = #{materialType},</if>
|
|
|
<if test="fileType != null">file_type = #{fileType},</if>
|
|
|
<if test="relationType != null">relation_type = #{relationType},</if>
|
|
|
- <if test="createUserid != null">create_userid = #{createUserid},</if>
|
|
|
- <if test="createUsername != null">create_username = #{createUsername},</if>
|
|
|
+ <if test="userId != null">user_id = #{userId},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="deptId != null">dept_id = #{deptId},</if>
|
|
|
+ <if test="deptName != null">dept_name = #{deptName},</if>
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
<if test="updateUserid != null">update_userid = #{updateUserid},</if>
|
|
|
<if test="updateUsername != null">update_username = #{updateUsername},</if>
|
|
|
@@ -133,8 +191,10 @@
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
- <delete id="deleteLabSecurityMaterialDataById" >
|
|
|
- delete from lab_security_material_data where id = #{id}
|
|
|
+ <delete id="deleteLabSecurityMaterialDataById">
|
|
|
+ delete
|
|
|
+ from lab_security_material_data
|
|
|
+ where id = #{id}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteLabSecurityMaterialDataByIds">
|
|
|
@@ -153,22 +213,29 @@
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectLabSecurityMaterialDataTeacher" resultMap="LabSecurityMaterialDataResultVO">
|
|
|
+ <select id="selectLabSecurityMaterialDataTeacher" resultMap="LabSecurityMaterialDataResultVO">
|
|
|
SELECT d.* FROM lab_security_material_data d, lab_security_subjectmaterial s
|
|
|
WHERE d.id=s.material_id AND s.material_type in(1,2)
|
|
|
- <if test="subjectId != null "> and s.subject_id = #{subjectId}</if>
|
|
|
+ <if test="subjectId != null ">and s.subject_id = #{subjectId}</if>
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectLabSecurityMaterialDataStudent" resultMap="LabSecurityMaterialDataResultVO">
|
|
|
+ <select id="selectLabSecurityMaterialDataStudent" resultMap="LabSecurityMaterialDataResultVO">
|
|
|
SELECT d.* FROM lab_security_material_data d, lab_security_subjectmaterial s
|
|
|
WHERE d.id=s.material_id AND s.material_type in(1,3)
|
|
|
- <if test="subjectId != null "> and s.subject_id = #{subjectId}</if>
|
|
|
+ <if test="subjectId != null ">and s.subject_id = #{subjectId}</if>
|
|
|
</select>
|
|
|
|
|
|
- <select id="selectTemplateTeacherList" parameterType="com.zd.laboratory.domain.vo.LabSecurityMaterialDataVO" resultMap="LabSecurityMaterialDataResult">
|
|
|
- SELECT * FROM lab_security_material_data md WHERE md.material_suit IN(1,2) AND (md.relation_type IS NULL OR md.relation_type!=2)
|
|
|
+ <select id="selectTemplateTeacherList" parameterType="com.zd.laboratory.domain.vo.LabSecurityMaterialDataVO"
|
|
|
+ resultMap="LabSecurityMaterialDataResult">
|
|
|
+ SELECT *
|
|
|
+ FROM lab_security_material_data md
|
|
|
+ WHERE md.material_suit IN (1, 2)
|
|
|
+ AND (md.relation_type IS NULL OR md.relation_type!=2)
|
|
|
</select>
|
|
|
- <select id="selectTemplateStudentList" parameterType="com.zd.laboratory.domain.vo.LabSecurityMaterialDataVO" resultMap="LabSecurityMaterialDataResult">
|
|
|
- SELECT * FROM lab_security_material_data md WHERE md.material_suit IN(1,3)
|
|
|
+ <select id="selectTemplateStudentList" parameterType="com.zd.laboratory.domain.vo.LabSecurityMaterialDataVO"
|
|
|
+ resultMap="LabSecurityMaterialDataResult">
|
|
|
+ SELECT *
|
|
|
+ FROM lab_security_material_data md
|
|
|
+ WHERE md.material_suit IN (1, 3)
|
|
|
</select>
|
|
|
</mapper>
|