<?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.emergency.repository.EmergencySuppliesInfoRepository">
|
|
<resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoPageDO" id="emergencySuppliesInfoPageDOResult">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="name" property="name"/>
|
<result column="number" property="number"/>
|
<result column="department_id" property="departmentId"/>
|
<result column="classification" property="classification"/>
|
<result column="place" property="place"/>
|
<result column="count" property="count"/>
|
</resultMap>
|
|
<select id="selectEmergencySuppliesList" resultMap="emergencySuppliesInfoPageDOResult">
|
select id,`name`,`number`,`department_id`,`classification`,place ,`count` from emergency_supplies where del_flag = 0
|
<if test="query.name != null and query.name != ''">and `name` like concat('%', #{query.name}, '%')</if>
|
</select>
|
|
<insert id="addEmergencySupplies" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfo"
|
keyProperty="id" useGeneratedKeys="true">
|
insert into emergency_supplies
|
<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="productionDate != null ">production_date,</if>
|
<if test="useDate != null ">use_date,</if>
|
<if test="inspectDate != null ">inspect_date,</if>
|
<if test="nextInspectDate != null ">next_inspect_date,</if>
|
<if test="inspectPeriod != null ">inspect_period,</if>
|
<if test="count != null ">`count`,</if>
|
<if test="usePeriod != null ">use_period,</if>
|
<if test="departmentId != null ">department_id,</if>
|
<if test="principalUserUid != null ">`principal_user_uid`,</if>
|
<if test="principalUserName != null and principalUserName != ''">`principal_user_name`,</if>
|
<if test="status != null and status != ''">status,</if>
|
<if test="classification != null and classification != ''">`classification`,</if>
|
<if test="name != null and name != ''">`name`,</if>
|
<if test="number != null and number != ''">`number`,</if>
|
<if test="model != null and model != ''">`model`,</if>
|
<if test="longitude != null and longitude != ''">`longitude`,</if>
|
<if test="latitude != null and latitude != ''">`latitude`,</if>
|
<if test="use != null and use != ''">`use`,</if>
|
<if test="areaId != null ">`area_id`,</if>
|
<if test="place != null and place != ''">`place`,</if>
|
<if test="useExplain != null and useExplain != ''">`use_explain`,</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="productionDate != null ">#{productionDate},</if>
|
<if test="useDate != null ">#{useDate},</if>
|
<if test="inspectDate != null ">#{inspectDate},</if>
|
<if test="nextInspectDate != null ">#{nextInspectDate},</if>
|
<if test="inspectPeriod != null ">#{inspectPeriod},</if>
|
<if test="count != null ">#{count},</if>
|
<if test="usePeriod != null ">#{usePeriod},</if>
|
<if test="departmentId != null ">#{departmentId},</if>
|
<if test="principalUserUid != null ">#{principalUserUid},</if>
|
<if test="principalUserName != null and principalUserName != ''">#{principalUserName},</if>
|
<if test="status != null and status != ''">#{status},</if>
|
<if test="classification != null and classification != ''">#{classification},</if>
|
<if test="name != null and name != ''">#{name},</if>
|
<if test="number != null and number != ''">#{number},</if>
|
<if test="model != null and model != ''">#{model},</if>
|
<if test="longitude != null and longitude != ''">#{longitude},</if>
|
<if test="latitude != null and latitude != ''">#{latitude},</if>
|
<if test="use != null and use != ''">#{use},</if>
|
<if test="areaId != null ">#{areaId},</if>
|
<if test="place != null and place != ''">#{place},</if>
|
<if test="useExplain != null and useExplain != ''">#{useExplain},</if>
|
</trim>
|
</insert>
|
|
|
<resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfoDetailDO" id="emergencySuppliesInfoDetailDOResult">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="production_date" property="productionDate"/>
|
<result column="use_date" property="useDate"/>
|
<result column="inspect_date" property="inspectDate"/>
|
<result column="next_inspect_date" property="nextInspectDate"/>
|
<result column="inspect_period" property="inspectPeriod"/>
|
<result column="count" property="count"/>
|
<result column="use_period" property="usePeriod"/>
|
<result column="department_id" property="departmentId"/>
|
<result column="principal_user_uid" property="principalUserUid"/>
|
<result column="principal_user_name" property="principalUserName"/>
|
<result column="status" property="status"/>
|
<result column="classification" property="classification"/>
|
<result column="name" property="name"/>
|
<result column="number" property="number"/>
|
<result column="model" property="model"/>
|
<result column="longitude" property="longitude"/>
|
<result column="latitude" property="latitude"/>
|
<result column="use" property="use"/>
|
<result column="area_id" property="areaId"/>
|
<result column="place" property="place"/>
|
<result column="use_explain" property="useExplain"/>
|
</resultMap>
|
|
<select id="selectEmergencySuppliesById" resultMap="emergencySuppliesInfoDetailDOResult">
|
select id ,`production_date`,`use_date`,`inspect_date`,`next_inspect_date`,inspect_period ,`count` ,use_period ,department_id ,principal_user_uid ,principal_user_name,
|
status ,classification ,`name` ,`number` ,model ,longitude ,latitude ,`use` ,area_id ,place ,use_explain
|
from emergency_supplies where del_flag = 0 and id = #{id}
|
</select>
|
|
<select id="countEmergencySupplies" resultMap="emergencySuppliesInfoDetailDOResult">
|
select id,`name`,`count`,`production_date`,`use_period`,classification from emergency_supplies where del_flag = 0
|
<if test="query.classification != null and query.classification != ''">and `classification` = #{query.classification}</if>
|
</select>
|
|
<update id="updateEmergencySupplies" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfo">
|
update emergency_supplies
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="gmtModitify != null ">gmt_moditify = #{gmtModitify},</if>
|
<if test="updateUid != null ">update_uid = #{updateUid},</if>
|
<if test="productionDate != null ">production_date = #{productionDate},</if>
|
<if test="useDate != null ">use_date = #{useDate},</if>
|
<if test="inspectDate != null ">inspect_date = #{inspectDate},</if>
|
<if test="nextInspectDate != null ">next_inspect_date = #{nextInspectDate},</if>
|
<if test="inspectPeriod != null ">inspect_period = #{inspectPeriod},</if>
|
<if test="count != null ">`count` = #{count},</if>
|
<if test="usePeriod != null ">use_period = #{usePeriod},</if>
|
<if test="departmentId != null ">department_id = #{departmentId},</if>
|
<if test="principalUserUid != null ">`principal_user_uid` = #{principalUserUid},</if>
|
<if test="principalUserName != null and principalUserName != ''">principal_user_name = #{principalUserName},</if>
|
<if test="status != null and status != ''">status = #{status},</if>
|
<if test="classification != null and classification != ''">`classification` = #{classification},</if>
|
<if test="name != null and name != ''">`name` = #{name},</if>
|
<if test="number != null and number != ''">`number` = #{number},</if>
|
<if test="model != null and model != ''">`model` = #{model},</if>
|
<if test="longitude != null and longitude != ''">`longitude` = #{longitude},</if>
|
<if test="latitude != null and latitude != ''">`latitude` = #{latitude},</if>
|
<if test="use != null and use != ''">`use` = #{use},</if>
|
<if test="areaId != null ">`area_id` = #{areaId},</if>
|
<if test="place != null and place != ''">`place` = #{place},</if>
|
<if test="useExplain != null and useExplain != ''">`use_explain` = #{useExplain},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<update id="deleteEmergencySupplies">
|
update emergency_supplies set del_flag = 1 where id = #{id}
|
</update>
|
<select id="listByNoConditions" resultType="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfo">
|
select id,
|
name,
|
number,
|
model,
|
count,
|
classification,
|
place,
|
use_explain
|
from emergency_supplies
|
where del_flag = #{delFlag} and status = #{status}
|
</select>
|
<select id="listCountByIds" resultType="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfo">
|
select id,
|
count
|
from emergency_supplies
|
where del_flag = #{delFlag} and status = #{status} and id in
|
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
#{id}
|
</foreach>
|
</select>
|
<select id="getAllEmergencySupplies" resultType="com.gkhy.safePlatform.emergency.entity.EmergencySuppliesInfo">
|
select id,
|
name,
|
number,
|
model,
|
count,
|
classification,
|
place,
|
use_explain,
|
department_id
|
from emergency_supplies
|
where del_flag = 0
|
</select>
|
|
|
</mapper>
|