<?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.gkhy.safePlatform.incidentManage.repository.WorkInjuryDeclarationInfoRepository">
|
|
<resultMap type="com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationInfoPageDO" id="WorkInjuryDeclarationInfoPageDOResult">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="declare_user_name" property="declareUserName"/>
|
<result column="declare_department_id" property="declareDepartmentId"/>
|
<result column="accident_express_id" property="accidentExpressId"/>
|
<result column="work_injury_type" property="workInjuryType"/>
|
<result column="declare_date" property="declareDate"/>
|
<result column="visit_hospital" property="visitHospital"/>
|
</resultMap>
|
|
<select id="selectWorkInjuryDeclarationList" resultMap="WorkInjuryDeclarationInfoPageDOResult">
|
SELECT
|
a.id,
|
a.`declare_user_name`,
|
a.`declare_department_id`,
|
a.`accident_express_id`,
|
a.work_injury_type,
|
a.declare_date,
|
a.visit_hospital,
|
b.accident_name AS accidentName
|
FROM
|
work_injury_declaration a
|
LEFT JOIN accident_express b ON a.accident_express_id = b.id
|
WHERE
|
a.del_flag = 0
|
<if test="query.accidentExpressId != null">and a.`accident_express_id` = #{query.accidentExpressId}</if>
|
</select>
|
|
<insert id="addWorkInjuryDeclaration" parameterType="com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationInfo"
|
keyProperty="id" useGeneratedKeys="true">
|
insert into work_injury_declaration
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null ">id,</if>
|
<if test="delFlag != null ">del_flag,</if>
|
<if test="gmtCreate != null ">gmt_create,</if>
|
<if test="gmtModitify != null ">gmt_moditify,</if>
|
<if test="createUid != null ">create_uid,</if>
|
<if test="updateUid != null ">update_uid,</if>
|
<if test="declareUserName != null and declareUserName != ''">declare_user_name,</if>
|
<if test="declareUserGender != null ">declare_user_gender,</if>
|
<if test="declareDepartmentId != null ">declare_department_id,</if>
|
<if test="accidentExpressId != null ">accident_express_id,</if>
|
<if test="workInjuryType != null and workInjuryType != ''">work_injury_type,</if>
|
<if test="declareDate != null ">declare_date,</if>
|
<if test="lostTime != null ">lost_time,</if>
|
<if test="visitHospital != null and visitHospital != ''">visit_hospital,</if>
|
<if test="visitResult != null and visitResult != ''">visit_result,</if>
|
<if test="mattersNeedingAttention != null and mattersNeedingAttention != ''">matters_needing_attention,</if>
|
<if test="completeMaterials != null ">complete_materials,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null ">#{id},</if>
|
<if test="delFlag != null ">#{delFlag},</if>
|
<if test="gmtCreate != null ">#{gmtCreate},</if>
|
<if test="gmtModitify != null ">#{gmtModitify},</if>
|
<if test="createUid != null ">#{createUid},</if>
|
<if test="updateUid != null ">#{updateUid},</if>
|
<if test="declareUserName != null and declareUserName != ''">#{declareUserName},</if>
|
<if test="declareUserGender != null ">#{declareUserGender},</if>
|
<if test="declareDepartmentId != null ">#{declareDepartmentId},</if>
|
<if test="accidentExpressId != null ">#{accidentExpressId},</if>
|
<if test="workInjuryType != null and workInjuryType != ''">#{workInjuryType},</if>
|
<if test="declareDate != null ">#{declareDate},</if>
|
<if test="lostTime != null ">#{lostTime},</if>
|
<if test="visitHospital != null and visitHospital != ''">#{visitHospital},</if>
|
<if test="visitResult != null and visitResult != ''">#{visitResult},</if>
|
<if test="mattersNeedingAttention != null and mattersNeedingAttention != ''">#{mattersNeedingAttention},</if>
|
<if test="completeMaterials != null ">#{completeMaterials},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
</trim>
|
</insert>
|
|
|
<resultMap type="com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationInfoDetailDO" id="WorkInjuryDeclarationInfoDetailDOResult">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="declare_user_name" property="declareUserName"/>
|
<result column="declare_user_gender" property="declareUserGender"/>
|
<result column="declare_department_id" property="declareDepartmentId"/>
|
<result column="accident_express_id" property="accidentExpressId"/>
|
<result column="work_injury_type" property="workInjuryType"/>
|
<result column="declare_date" property="declareDate"/>
|
<result column="lost_time" property="lostTime"/>
|
<result column="visit_hospital" property="visitHospital"/>
|
<result column="visit_result" property="visitResult"/>
|
<result column="matters_needing_attention" property="mattersNeedingAttention"/>
|
<result column="complete_materials" property="completeMaterials"/>
|
<result column="remark" property="remark"/>
|
</resultMap>
|
|
<select id="selectWorkInjuryDeclarationById" resultMap="WorkInjuryDeclarationInfoDetailDOResult">
|
SELECT
|
a.id,
|
a.declare_user_name,
|
a.`declare_user_gender`,
|
a.`declare_department_id`,
|
a.`accident_express_id`,
|
a.`work_injury_type`,
|
a.declare_date,
|
a.lost_time,
|
a.`visit_hospital`,
|
a.`visit_result`,
|
a.`matters_needing_attention`,
|
a.`complete_materials`,
|
a.remark,
|
b.accident_name AS accidentName,
|
b.occurrence_time AS occurrenceTime
|
FROM
|
work_injury_declaration a
|
LEFT JOIN accident_express b ON a.accident_express_id = b.id
|
WHERE a.del_flag = 0 and a.id = #{id}
|
</select>
|
|
<update id="updateWorkInjuryDeclaration" parameterType="com.gkhy.safePlatform.incidentManage.entity.WorkInjuryDeclarationInfo">
|
update work_injury_declaration
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="gmtModitify != null ">gmt_moditify = #{gmtModitify},</if>
|
<if test="updateUid != null ">update_uid = #{updateUid},</if>
|
|
<if test="declareUserName != null and declareUserName != ''">declare_user_name = #{declareUserName},</if>
|
<if test="declareUserGender != null "> declare_user_gender = #{declareUserGender},</if>
|
<if test="declareDepartmentId != null ">declare_department_id = #{declareDepartmentId},</if>
|
<if test="accidentExpressId != null ">accident_express_id = #{accidentExpressId},</if>
|
<if test="workInjuryType != null and workInjuryType != ''">work_injury_type = #{workInjuryType},</if>
|
<if test="declareDate != null ">declare_date = #{declareDate},</if>
|
<if test="lostTime != null ">lost_time = #{lostTime},</if>
|
<if test="visitHospital != null and visitHospital != ''">visit_hospital = #{visitHospital},</if>
|
<if test="visitResult != null and visitResult != ''">visit_result = #{visitResult},</if>
|
<if test="mattersNeedingAttention != null and mattersNeedingAttention != ''">matters_needing_attention = #{mattersNeedingAttention},</if>
|
<if test="completeMaterials != null ">complete_materials = #{completeMaterials},</if>
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<update id="deleteWorkInjuryDeclarationById">
|
update work_injury_declaration set del_flag = 1 where id = #{id}
|
</update>
|
</mapper>
|