102 lines
4.9 KiB
XML
102 lines
4.9 KiB
XML
<?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.zhyc.module.biosafety.mapper.DisinfectMapper">
|
|
|
|
<resultMap type="Disinfect" id="DisinfectResult">
|
|
<result property="id" column="id" />
|
|
<result property="sheepfoldId" column="sheepfold_id" />
|
|
<result property="datetime" column="datetime" />
|
|
<result property="technician" column="technician" />
|
|
<result property="way" column="way" />
|
|
<result property="usageId" column="usage_id" />
|
|
<result property="ratio" column="ratio" />
|
|
<result property="comment" column="comment" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
</resultMap>
|
|
|
|
<sql id="selectDisinfectVo">
|
|
select id, sheepfold_id, datetime, technician, way, usage_id, ratio, comment, update_by, update_time, create_by, create_time from sw_disinfect
|
|
</sql>
|
|
|
|
<select id="selectDisinfectList" parameterType="Disinfect" resultMap="DisinfectResult">
|
|
<include refid="selectDisinfectVo"/>
|
|
<where>
|
|
<if test="sheepfoldId != null "> and sheepfold_id = #{sheepfoldId}</if>
|
|
<if test="datetime != null "> and datetime = #{datetime}</if>
|
|
<if test="technician != null and technician != ''"> and technician = #{technician}</if>
|
|
<if test="way != null and way != ''"> and way = #{way}</if>
|
|
<if test="usageId != null "> and usage_id = #{usageId}</if>
|
|
<if test="ratio != null and ratio != ''"> and ratio = #{ratio}</if>
|
|
<if test="comment != null and comment != ''"> and comment = #{comment}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectDisinfectById" parameterType="Long" resultMap="DisinfectResult">
|
|
<include refid="selectDisinfectVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertDisinfect" parameterType="Disinfect" useGeneratedKeys="true" keyProperty="id">
|
|
insert into sw_disinfect
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="sheepfoldId != null">sheepfold_id,</if>
|
|
<if test="datetime != null">datetime,</if>
|
|
<if test="technician != null">technician,</if>
|
|
<if test="way != null">way,</if>
|
|
<if test="usageId != null">usage_id,</if>
|
|
<if test="ratio != null">ratio,</if>
|
|
<if test="comment != null">comment,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="sheepfoldId != null">#{sheepfoldId},</if>
|
|
<if test="datetime != null">#{datetime},</if>
|
|
<if test="technician != null">#{technician},</if>
|
|
<if test="way != null">#{way},</if>
|
|
<if test="usageId != null">#{usageId},</if>
|
|
<if test="ratio != null">#{ratio},</if>
|
|
<if test="comment != null">#{comment},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateDisinfect" parameterType="Disinfect">
|
|
update sw_disinfect
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="sheepfoldId != null">sheepfold_id = #{sheepfoldId},</if>
|
|
<if test="datetime != null">datetime = #{datetime},</if>
|
|
<if test="technician != null">technician = #{technician},</if>
|
|
<if test="way != null">way = #{way},</if>
|
|
<if test="usageId != null">usage_id = #{usageId},</if>
|
|
<if test="ratio != null">ratio = #{ratio},</if>
|
|
<if test="comment != null">comment = #{comment},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteDisinfectById" parameterType="Long">
|
|
delete from sw_disinfect where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteDisinfectByIds" parameterType="String">
|
|
delete from sw_disinfect where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |