<?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.nanometer.smartlab.dao.HazardousWasteMapper" >
|
<resultMap id="BaseResultMap" type="com.nanometer.smartlab.entity.HazardousWaste" >
|
<!-- -->
|
<id column="id" property="id" jdbcType="BIGINT" />
|
<result column="acid" property="acid" jdbcType="REAL" />
|
<result column="alkali" property="alkali" jdbcType="REAL" />
|
<result column="organic" property="organic" jdbcType="REAL" />
|
<result column="solid" property="solid" jdbcType="REAL" />
|
<result column="medical" property="medical" jdbcType="REAL" />
|
<result column="apply_person" property="applyPerson" jdbcType="VARCHAR" />
|
<result column="project" property="project" jdbcType="VARCHAR" />
|
<result column="department" property="department" jdbcType="VARCHAR" />
|
<result column="unit" property="unit" jdbcType="VARCHAR" />
|
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
</resultMap>
|
<sql id="Base_Column_List" >
|
<!-- -->
|
id, acid, alkali, organic, solid, medical, apply_person, project, department, unit,
|
create_time
|
</sql>
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
<!-- -->
|
select
|
<include refid="Base_Column_List" />
|
from sys_hazardous_waste
|
where id = #{id,jdbcType=BIGINT}
|
</select>
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
<!-- -->
|
delete from sys_hazardous_waste
|
where id = #{id,jdbcType=BIGINT}
|
</delete>
|
<insert id="insert" parameterType="com.nanometer.smartlab.entity.HazardousWaste" >
|
<!-- -->
|
insert into sys_hazardous_waste (id, acid, alkali, organic,
|
solid, medical, apply_person,
|
project, department, unit,
|
create_time)
|
values (#{id,jdbcType=BIGINT}, #{acid,jdbcType=REAL}, #{alkali,jdbcType=REAL}, #{organic,jdbcType=REAL},
|
#{solid,jdbcType=REAL}, #{medical,jdbcType=REAL}, #{applyPerson,jdbcType=VARCHAR},
|
#{project,jdbcType=VARCHAR}, #{department,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR},
|
#{createTime,jdbcType=TIMESTAMP})
|
</insert>
|
<insert id="insertSelective" parameterType="com.nanometer.smartlab.entity.HazardousWaste" >
|
<!-- -->
|
insert into sys_hazardous_waste
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
id,
|
</if>
|
<if test="acid != null" >
|
acid,
|
</if>
|
<if test="alkali != null" >
|
alkali,
|
</if>
|
<if test="organic != null" >
|
organic,
|
</if>
|
<if test="solid != null" >
|
solid,
|
</if>
|
<if test="medical != null" >
|
medical,
|
</if>
|
<if test="applyPerson != null" >
|
apply_person,
|
</if>
|
<if test="project != null" >
|
project,
|
</if>
|
<if test="department != null" >
|
department,
|
</if>
|
<if test="unit != null" >
|
unit,
|
</if>
|
<if test="createTime != null" >
|
create_time,
|
</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
<if test="id != null" >
|
#{id,jdbcType=BIGINT},
|
</if>
|
<if test="acid != null" >
|
#{acid,jdbcType=REAL},
|
</if>
|
<if test="alkali != null" >
|
#{alkali,jdbcType=REAL},
|
</if>
|
<if test="organic != null" >
|
#{organic,jdbcType=REAL},
|
</if>
|
<if test="solid != null" >
|
#{solid,jdbcType=REAL},
|
</if>
|
<if test="medical != null" >
|
#{medical,jdbcType=REAL},
|
</if>
|
<if test="applyPerson != null" >
|
#{applyPerson,jdbcType=VARCHAR},
|
</if>
|
<if test="project != null" >
|
#{project,jdbcType=VARCHAR},
|
</if>
|
<if test="department != null" >
|
#{department,jdbcType=VARCHAR},
|
</if>
|
<if test="unit != null" >
|
#{unit,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null" >
|
#{createTime,jdbcType=TIMESTAMP},
|
</if>
|
</trim>
|
</insert>
|
<update id="updateByPrimaryKeySelective" parameterType="com.nanometer.smartlab.entity.HazardousWaste" >
|
<!-- -->
|
update sys_hazardous_waste
|
<set >
|
<if test="acid != null" >
|
acid = #{acid,jdbcType=REAL},
|
</if>
|
<if test="alkali != null" >
|
alkali = #{alkali,jdbcType=REAL},
|
</if>
|
<if test="organic != null" >
|
organic = #{organic,jdbcType=REAL},
|
</if>
|
<if test="solid != null" >
|
solid = #{solid,jdbcType=REAL},
|
</if>
|
<if test="medical != null" >
|
medical = #{medical,jdbcType=REAL},
|
</if>
|
<if test="applyPerson != null" >
|
apply_person = #{applyPerson,jdbcType=VARCHAR},
|
</if>
|
<if test="project != null" >
|
project = #{project,jdbcType=VARCHAR},
|
</if>
|
<if test="department != null" >
|
department = #{department,jdbcType=VARCHAR},
|
</if>
|
<if test="unit != null" >
|
unit = #{unit,jdbcType=VARCHAR},
|
</if>
|
<if test="createTime != null" >
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
</if>
|
</set>
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
<update id="updateByPrimaryKey" parameterType="com.nanometer.smartlab.entity.HazardousWaste" >
|
<!-- -->
|
update sys_hazardous_waste
|
set acid = #{acid,jdbcType=REAL},
|
alkali = #{alkali,jdbcType=REAL},
|
organic = #{organic,jdbcType=REAL},
|
solid = #{solid,jdbcType=REAL},
|
medical = #{medical,jdbcType=REAL},
|
apply_person = #{applyPerson,jdbcType=VARCHAR},
|
project = #{project,jdbcType=VARCHAR},
|
department = #{department,jdbcType=VARCHAR},
|
unit = #{unit,jdbcType=VARCHAR},
|
create_time = #{createTime,jdbcType=TIMESTAMP}
|
where id = #{id,jdbcType=BIGINT}
|
</update>
|
|
<select id="selectAll" resultMap="BaseResultMap" parameterType="java.util.Map" >
|
<!-- -->
|
select
|
<include refid="Base_Column_List" />
|
from sys_hazardous_waste
|
<where>
|
1 = 1
|
<if test="startTime != null and startTime != ''" >
|
and create_time > #{startTime}
|
</if>
|
<if test="endTime != null and endTime != ''" >
|
and create_time < #{endTime}
|
</if>
|
</where>
|
<if test="first != null and pageSize != null" >
|
limit #{first},#{pageSize}
|
</if>
|
order by create_time
|
</select>
|
|
<select id="countAll" resultType="java.lang.Integer" >
|
<!-- -->
|
select count(0)
|
from sys_hazardous_waste
|
<where>
|
1 = 1
|
<if test="startTime != null and startTime != ''" >
|
and create_time > #{startTime}
|
</if>
|
<if test="endTime != null and endTime != ''" >
|
and create_time < #{endTime}
|
</if>
|
</where>
|
</select>
|
</mapper>
|