<?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.ruoyi.project.dc.emergencySupplies.mapper.EmergencySuppliesMapper">
|
|
<resultMap type="com.ruoyi.project.dc.emergencySupplies.domain.EmergencySupplies" id="EmergencySuppliesResult">
|
<result property="emergencySuppliesId" column="emergency_supplies_id" />
|
<result property="companyId" column="company_id"/>
|
<result property="createBy" column="create_by" />
|
<result property="createUserId" column="create_user_id" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateUserId" column="update_user_id" />
|
<result property="updateTime" column="update_time" />
|
<result property="remark" column="remark" />
|
<result property="isMiniatureFireStation" column="is_miniature_fire_station" />
|
<result property="materialName" column="material_name" />
|
<result property="quantity" column="quantity" />
|
<result property="storageLocation" column="storage_location" />
|
|
<result property="maintenance" column="maintenance" />
|
<result property="inspection" column="inspection" />
|
<result property="cycle" column="cycle" />
|
</resultMap>
|
|
<sql id="selectEmergencySuppliesVo">
|
select emergency_supplies_id, company_id,
|
create_by, create_user_id, create_time,
|
update_by, update_user_id, update_time, remark,
|
is_miniature_fire_station, material_name, quantity, storage_location,
|
maintenance,inspection,cycle
|
from dc_emergency_supplies
|
</sql>
|
|
<select id="selectEmergencySuppliesList" parameterType="EmergencySupplies" resultMap="EmergencySuppliesResult">
|
<include refid="selectEmergencySuppliesVo"/>
|
<where>
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
<if test="createUserId != null "> and create_user_id = #{createUserId}</if>
|
<if test="updateUserId != null "> and update_user_id = #{updateUserId}</if>
|
<if test="isMiniatureFireStation != null and isMiniatureFireStation != ''"> and is_miniature_fire_station = #{isMiniatureFireStation}</if>
|
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
<if test="quantity != null "> and quantity = #{quantity}</if>
|
<if test="storageLocation != null and storageLocation != ''"> and storage_location = #{storageLocation}</if>
|
|
<if test="maintenance != null and maintenance != ''"> and maintenance = #{maintenance}</if>
|
<if test="inspection != null and inspection != ''"> and inspection = #{inspection}</if>
|
<if test="cycle != null and cycle != ''"> and cycle = #{cycle}</if>
|
|
|
</where>
|
</select>
|
|
<select id="selectEmergencySuppliesById" parameterType="Long" resultMap="EmergencySuppliesResult">
|
<include refid="selectEmergencySuppliesVo"/>
|
where emergency_supplies_id = #{emergencySuppliesId}
|
</select>
|
|
<insert id="insertEmergencySupplies" parameterType="EmergencySupplies" useGeneratedKeys="true" keyProperty="emergencySuppliesId">
|
insert into dc_emergency_supplies
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createUserId != null ">create_user_id,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
<if test="updateUserId != null ">update_user_id,</if>
|
<if test="updateTime != null ">update_time,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
<if test="isMiniatureFireStation != null and isMiniatureFireStation != ''">is_miniature_fire_station,</if>
|
<if test="materialName != null and materialName != ''">material_name,</if>
|
<if test="quantity != null ">quantity,</if>
|
<if test="storageLocation != null and storageLocation != ''">storage_location,</if>
|
|
<if test="maintenance != null and maintenance != ''">maintenance,</if>
|
<if test="inspection != null and inspection != ''">inspection,</if>
|
<if test="cycle != null and cycle != ''">cycle,</if>
|
|
<if test="companyId != null ">company_id,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createUserId != null ">#{createUserId},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
<if test="updateUserId != null ">#{updateUserId},</if>
|
<if test="updateTime != null ">#{updateTime},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
<if test="isMiniatureFireStation != null and isMiniatureFireStation != ''">#{isMiniatureFireStation},</if>
|
<if test="materialName != null and materialName != ''">#{materialName},</if>
|
<if test="quantity != null ">#{quantity},</if>
|
<if test="storageLocation != null and storageLocation != ''">#{storageLocation},</if>
|
|
<if test="maintenance != null and maintenance != ''">#{maintenance},</if>
|
<if test="inspection != null and inspection != ''">#{inspection},</if>
|
<if test="cycle != null and cycle != ''">#{cycle},</if>
|
|
<if test="companyId != null ">#{companyId},</if>
|
</trim>
|
</insert>
|
|
<update id="updateEmergencySupplies" parameterType="EmergencySupplies">
|
update dc_emergency_supplies
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
<if test="createUserId != null ">create_user_id = #{createUserId},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="updateUserId != null ">update_user_id = #{updateUserId},</if>
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
<if test="isMiniatureFireStation != null and isMiniatureFireStation != ''">is_miniature_fire_station = #{isMiniatureFireStation},</if>
|
<if test="materialName != null and materialName != ''">material_name = #{materialName},</if>
|
<if test="quantity != null ">quantity = #{quantity},</if>
|
<if test="storageLocation != null and storageLocation != ''">storage_location = #{storageLocation},</if>
|
|
<if test="maintenance != null and maintenance != ''">maintenance = #{maintenance},</if>
|
<if test="inspection != null and inspection != ''">inspection = #{inspection},</if>
|
<if test="cycle != null and cycle != ''">storage_location = #{cycle},</if>
|
|
<if test="companyId != null ">company_id = #{companyId},</if>
|
</trim>
|
where emergency_supplies_id = #{emergencySuppliesId}
|
</update>
|
|
<delete id="deleteEmergencySuppliesById" parameterType="Long">
|
delete from dc_emergency_supplies where emergency_supplies_id = #{emergencySuppliesId}
|
</delete>
|
|
<delete id="deleteEmergencySuppliesByIds" parameterType="String">
|
delete from dc_emergency_supplies where emergency_supplies_id in
|
<foreach item="emergencySuppliesId" collection="array" open="(" separator="," close=")">
|
#{emergencySuppliesId}
|
</foreach>
|
</delete>
|
|
</mapper>
|