|
|
@@ -0,0 +1,109 @@
|
|
|
+<?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.LabRiskPlanAbnormalDescMapper">
|
|
|
+ <!-- 通用查询映射结果 -->
|
|
|
+ <resultMap id="BaseResult" type="com.zd.laboratory.domain.LabRiskPlanAbnormalDesc">
|
|
|
+ <id column="desc_id" property="descId" />
|
|
|
+ <result column="group_id" property="groupId" />
|
|
|
+ <result column="risk_reason" property="riskReason" />
|
|
|
+ <result column="risk_level" property="riskLevel" />
|
|
|
+ <result column="start_date" property="startDate" />
|
|
|
+ <result column="end_date" property="endDate" />
|
|
|
+ <result column="risk_duration" property="riskDuration" />
|
|
|
+ <result column="handled_person" property="handledPerson" />
|
|
|
+ <result column="internal_person" property="internalPerson" />
|
|
|
+ <result column="record_video" property="recordVideo" />
|
|
|
+ <result column="create_time" property="createTime" />
|
|
|
+ <result column="create_by" property="createBy" />
|
|
|
+ <result column="update_time" property="updateTime" />
|
|
|
+ <result column="update_by" property="updateBy" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!-- 通用查询结果列 -->
|
|
|
+ <sql id="selectBaseColumn">
|
|
|
+ select desc_id, group_id, risk_reason, risk_level, start_date, end_date, risk_duration, internal_person, handled_person, record_video, create_time, create_by, update_time, update_by from lab_risk_plan_abnormal_desc
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <insert id="insert" parameterType="com.zd.laboratory.domain.LabRiskPlanAbnormalDesc">
|
|
|
+ insert into lab_risk_plan_abnormal_desc(
|
|
|
+ <if test="descId != null and descId != 0">desc_id,</if>
|
|
|
+ <if test="groupId != null and groupId != 0">group_id,</if>
|
|
|
+ <if test="riskReason != null and riskReason != ''">risk_reason,</if>
|
|
|
+ <if test="riskLevel != null">risk_level,</if>
|
|
|
+ <if test="startDate != null">start_date,</if>
|
|
|
+ <if test="endDate != null">end_date,</if>
|
|
|
+ <if test="riskDuration != null and riskDuration != ''">risk_duration,</if>
|
|
|
+ <if test="handledPerson != null and handledPerson != ''">handled_person,</if>
|
|
|
+ <if test="internalPerson != null and internalPerson != ''">internal_person,</if>
|
|
|
+ <if test="recordVideo != null and recordVideo != ''">record_video,</if>
|
|
|
+ <if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="updateBy !=null and updateBy != ''">update_by,</if>
|
|
|
+ create_time
|
|
|
+ )values(
|
|
|
+ <if test="descId != null and descId != 0">#{descId},</if>
|
|
|
+ <if test="groupId != null and groupId != 0">#{groupId},</if>
|
|
|
+ <if test="riskReason != null and riskReason != ''">#{riskReason},</if>
|
|
|
+ <if test="riskLevel != null">#{riskLevel},</if>
|
|
|
+ <if test="startDate != null">#{startDate},</if>
|
|
|
+ <if test="endDate != null">#{endDate},</if>
|
|
|
+ <if test="riskDuration != null and riskDuration != ''">#{riskDuration},</if>
|
|
|
+ <if test="handledPerson != null and handledPerson != ''">#{handledPerson},</if>
|
|
|
+ <if test="internalPerson != null and internalPerson != ''">#{internalPerson},</if>
|
|
|
+ <if test="recordVideo != null and recordVideo != ''">#{recordVideo},</if>
|
|
|
+ <if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="updateBy !=null and updateBy != ''">#{updateBy},</if>
|
|
|
+ sysdate()
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateById" parameterType="com.zd.laboratory.domain.LabRiskPlanAbnormalDesc">
|
|
|
+ update lab_risk_plan_abnormal_desc
|
|
|
+ <set>
|
|
|
+ <if test="groupId != null and groupId != 0">group_id = #{groupId},</if>
|
|
|
+ <if test="riskReason != null and riskReason != ''">risk_reason = #{riskReason},</if>
|
|
|
+ <if test="riskLevel != null">risk_level = #{riskLevel},</if>
|
|
|
+ <if test="startDate != null">start_date = #{startDate},</if>
|
|
|
+ <if test="endDate != null">end_date = #{endDate},</if>
|
|
|
+ <if test="riskDuration != null and riskDuration != ''">risk_duration = #{riskDuration},</if>
|
|
|
+ <if test="handledPerson != null and handledPerson != ''">handled_person = #{handledPerson},</if>
|
|
|
+ <if test="internalPerson != null and internalPerson != ''">internal_person = #{internalPerson},</if>
|
|
|
+ <if test="recordVideo != null and recordVideo != ''">record_video = #{recordVideo},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
|
|
+ <if test="updateBy !=null and updateBy != ''">update_by = #{updateBy},</if>
|
|
|
+ update_time = sysdate()
|
|
|
+ </set>
|
|
|
+ where desc_id = #{descId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteById" >
|
|
|
+ delete from lab_risk_plan_abnormal_desc where menu_id = #{descId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <select id="selectById" resultMap="BaseResult">
|
|
|
+ <include refid="selectBaseColumn"/>
|
|
|
+ where desc_id = #{descId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectByList" parameterType="com.zd.laboratory.domain.LabRiskPlanAbnormalDesc" resultMap="BaseResult">
|
|
|
+ <include refid="selectBaseColumn"/>
|
|
|
+ <where>
|
|
|
+ <if test="groupId != null and groupId != 0">AND group_id =#{groupId}</if>
|
|
|
+ <if test="riskReason != null and riskReason != ''">AND risk_reason = #{riskReason}</if>
|
|
|
+ <if test="riskLevel != null">AND risk_level = #{riskLevel}</if>
|
|
|
+ <if test="startDate != null">AND start_date = #{startDate}</if>
|
|
|
+ <if test="endDate != null">AND end_date = #{endDate}</if>
|
|
|
+ <if test="riskDuration != null and riskDuration != ''">AND risk_duration = #{riskDuration}</if>
|
|
|
+ <if test="handledPerson != null and handledPerson != ''">AND handled_person LIKE concat('%', #{handledPerson}, '%'),</if>
|
|
|
+ <if test="recordVideo != null and recordVideo != ''">AND record_video = #{recordVideo}</if>
|
|
|
+ <if test="createTime != null">AND create_time = #{createTime},</if>
|
|
|
+ <if test="createBy != null and createBy != ''">AND create_by = #{createBy}</if>
|
|
|
+ <if test="updateTime != null">AND update_time = #{updateTime}</if>
|
|
|
+ <if test="updateBy !=null and updateBy != ''">AND update_by = #{updateBy}</if>
|
|
|
+ </where>
|
|
|
+ ORDER BY desc_id desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|