DepotStatusMapper.xml 1.93 KB
<?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.service.mapper.DepotStatusMapper">

	<insert id="insert" parameterType="com.ruoyi.service.domain.DepotStatus">
		insert into depot_status(
		<if test="depotId != null and depotId != ''">depotId,</if>
		<if test="checkTime != null and checkTime != null">checkTime,</if>
		<if test="humidity != null and humidity != ''">humidity,</if>
		<if test="temperature != null and temperature != ''">temperature,</if>
		<if test="mark != null and mark != ''">mark,</if>
		createTime
		)values(
		<if test="depotId != null and depotId != ''">#{depotId},</if>
		<if test="checkTime != null and checkTime != null">#{checkTime},</if>
		<if test="humidity != null and humidity != ''">#{humidity},</if>
		<if test="temperature != null and temperature != ''">#{temperature},</if>
		<if test="mark != null and mark != ''">#{mark},</if>
		sysdate()
		)
	</insert>

	<update id="update" parameterType="com.ruoyi.service.domain.DepotStatus">
		update depot_status
		<set>
			<if test="depotId != null and depotId != ''">depotId = #{depotId},</if>
			<if test="checkTime != null and checkTime != null">checkTime = #{checkTime},</if>
			<if test="humidity != null and humidity != ''">humidity = #{humidity},</if>
			<if test="temperature != null and temperature != ''">temperature = #{temperature},</if>
			<if test="mark != null">mark = #{mark},</if>
			updateTime = sysdate()
		</set>
		where id = #{id}
	</update>

	<delete id="delete" parameterType="Long">
		delete from depot_status where id = #{id}
	</delete>

	<select id="selectList" resultType="com.ruoyi.service.domain.DepotStatus" parameterType="com.ruoyi.service.domain.DepotStatus">
		select a.*,b.depotName from depot_status a,depot b
		where a.depotId=b.id
		<if test="depotId != null and depotId != ''">
			AND depotId =#{depotId}
		</if>
	</select>


</mapper>