SafetyMapper.xml 1.9 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.SafetyMapper">

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

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

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

	<select id="selectList" resultType="com.ruoyi.service.domain.Safety" parameterType="com.ruoyi.service.domain.Safety">
		select * from safety
		<where>
			<if test="depotId != null and depotId != ''">
				AND depotId =#{depotId}
			</if>
			<if test="type != null and type != ''">
				AND type =#{type}
			</if>
		</where>
	</select>


</mapper>