<?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.doublePrevention.repository.PreventReportRiskAnaUnitRepository">
|
|
<resultMap id="BaseResultMap" type="com.gkhy.safePlatform.doublePrevention.entity.PreventReportRiskAnaUnit">
|
<id column="index_id" property="indexId"/>
|
<result column="id" property="id"/>
|
<result column="company_code" property="companyCode"/>
|
<result column="deleted" property="deleted"/>
|
<result column="create_date" property="createDate"/>
|
<result column="create_by" property="createBy"/>
|
<result column="update_date" property="updateBy"/>
|
<result column="update_by" property="updateBy"/>
|
<result column="report_status" property="reportStatus"/>
|
<result column="report_time" property="reportTime"/>
|
<result column="data_source" property="dataSource"/>
|
<result column="risk_unit_name" property="riskUnitName"/>
|
<result column="hazard_code" property="hazardCode"/>
|
<result column="hazard_dep" property="hazardDep"/>
|
<result column="hazard_liable_person" property="hazardLiablePerson"/>
|
<result column="risk_unit_id" property="riskUnitId"/>
|
</resultMap>
|
|
<!--IPage<PreventRiskAnaUnit> getReportRiskUnitPage(Page<Object> page, PreReportRiskUnitQueryReqDTO queryReqDTO);-->
|
<select id="getReportRiskUnitPage" resultMap="BaseResultMap">
|
select * from
|
prevent_report_risk_ana_unit
|
<where>
|
1 = 1
|
<if test="queryReqDTO.riskUnitName != null">
|
and liable_person_id = #{queryReqDTO.riskUnitName}
|
</if>
|
<if test="queryReqDTO.hazardDep != null">
|
and liable_dep_id = #{queryReqDTO.hazardDep}
|
</if>
|
<if test="queryReqDTO.hazardLiablePerson != null">
|
and risk_unit_name = #{queryReqDTO.hazardLiablePerson}
|
</if>
|
</where>
|
order by create_by desc
|
</select>
|
|
<!--List<PreventReportRiskAnaUnit> listReportUnitDate();-->
|
<select id="listReportUnitDate" resultMap="BaseResultMap">
|
select * from prevent_report_risk_ana_unit
|
where report_status = 1
|
limit 200
|
</select>
|
|
<!--int updateReportStatus();-->
|
<update id="updateReportStatus">
|
update prevent_report_risk_ana_unit set
|
report_status = #{reportStatus},
|
report_time = #{reportTime}
|
where risk_unit_id = #{id}
|
</update>
|
|
|
<!--int saveList(List<PreventReportRiskAnaUnit> unitLists);-->
|
<insert id="saveList">
|
insert into prevent_report_risk_ana_unit
|
(
|
id,
|
risk_unit_name,
|
hazard_code,
|
hazard_dep,
|
hazard_liable_person,
|
company_code,
|
deleted,
|
create_date,
|
create_by,
|
update_date,
|
update_by,
|
data_source,
|
report_status,
|
report_time
|
)
|
values
|
<foreach collection="unitLists" item="unitList" separator="," >
|
(
|
#{unitList.id},
|
#{unitList.riskUnitName},
|
#{unitList.hazardDep},
|
#{unitList.hazardDep},
|
#{unitList.hazardLiablePerson},
|
#{unitList.companyCode},
|
#{unitList.deleted},
|
#{unitList.createDate},
|
#{unitList.createBy},
|
#{unitList.updateDate},
|
#{unitList.updateBy},
|
#{unitList.dataSource},
|
#{unitList.reportStatus},
|
#{unitList.reportTime}
|
)
|
</foreach>
|
</insert>
|
|
|
</mapper>
|