gdg
2021-01-18 b02535c9a99324823812f6c2d08f066d8e1ba75f
src/main/java/com/nanometer/smartlab/dao/HazardousWasteMapper.xml
@@ -3,24 +3,29 @@
<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" />
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="acid" jdbcType="DECIMAL" property="acid" />
    <result column="alkali" jdbcType="DECIMAL" property="alkali" />
    <result column="organic" jdbcType="DECIMAL" property="organic" />
    <result column="solid" jdbcType="DECIMAL" property="solid" />
    <result column="medical" jdbcType="DECIMAL" property="medical" />
    <result column="apply_person" jdbcType="VARCHAR" property="applyPerson" />
    <result column="project" jdbcType="VARCHAR" property="project" />
    <result column="department" jdbcType="VARCHAR" property="department" />
    <result column="unit" jdbcType="VARCHAR" property="unit" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="tid" jdbcType="VARCHAR" property="tid" />
    <result column="status" jdbcType="VARCHAR" property="status" />
    <result column="creator" jdbcType="VARCHAR" property="creator" />
    <result column="updator" jdbcType="VARCHAR" property="updator" />
    <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--          -->
    id, acid, alkali, organic, solid, medical, apply_person, project, department, unit, 
    create_time
    create_time, tid, status, creator, updator, updatetime
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--          -->
    select 
    <include refid="Base_Column_List" />
@@ -37,11 +42,13 @@
    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},
      create_time, tid, status,
      creator,updator, updatetime)
    values (#{id,jdbcType=BIGINT}, #{acid,jdbcType=DECIMAL}, #{alkali,jdbcType=DECIMAL}, #{organic,jdbcType=DECIMAL},
      #{solid,jdbcType=DECIMAL}, #{medical,jdbcType=DECIMAL}, #{applyPerson,jdbcType=VARCHAR},
      #{project,jdbcType=VARCHAR}, #{department,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, 
      #{createTime,jdbcType=TIMESTAMP})
      #{createTime,jdbcType=TIMESTAMP}, #{tid,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
      #{creator,jdbcType=VARCHAR},#{updator,jdbcType=VARCHAR},#{updatetime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.nanometer.smartlab.entity.HazardousWaste" >
    <!--          -->
@@ -80,25 +87,40 @@
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="tid != null">
        tid,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="creator != null">
        creator,
      </if>
      <if test="updator != null">
        creator,
      </if>
      <if test="updatetime != null">
        updatetime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=BIGINT},
      </if>
      <if test="acid != null" >
        #{acid,jdbcType=REAL},
        #{acid,jdbcType=DECIMAL},
      </if>
      <if test="alkali != null" >
        #{alkali,jdbcType=REAL},
        #{alkali,jdbcType=DECIMAL},
      </if>
      <if test="organic != null" >
        #{organic,jdbcType=REAL},
        #{organic,jdbcType=DECIMAL},
      </if>
      <if test="solid != null" >
        #{solid,jdbcType=REAL},
        #{solid,jdbcType=DECIMAL},
      </if>
      <if test="medical != null" >
        #{medical,jdbcType=REAL},
        #{medical,jdbcType=DECIMAL},
      </if>
      <if test="applyPerson != null" >
        #{applyPerson,jdbcType=VARCHAR},
@@ -115,6 +137,21 @@
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="tid != null">
        #{tid,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="creator != null">
        #{creator,jdbcType=VARCHAR},
      </if>
      <if test="updator != null">
        #{updator,jdbcType=VARCHAR},
      </if>
      <if test="updatetime != null">
        #{updatetime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.nanometer.smartlab.entity.HazardousWaste" >
@@ -122,19 +159,19 @@
    update sys_hazardous_waste
    <set >
      <if test="acid != null" >
        acid = #{acid,jdbcType=REAL},
        acid = #{acid,jdbcType=DECIMAL},
      </if>
      <if test="alkali != null" >
        alkali = #{alkali,jdbcType=REAL},
        alkali = #{alkali,jdbcType=DECIMAL},
      </if>
      <if test="organic != null" >
        organic = #{organic,jdbcType=REAL},
        organic = #{organic,jdbcType=DECIMAL},
      </if>
      <if test="solid != null" >
        solid = #{solid,jdbcType=REAL},
        solid = #{solid,jdbcType=DECIMAL},
      </if>
      <if test="medical != null" >
        medical = #{medical,jdbcType=REAL},
        medical = #{medical,jdbcType=DECIMAL},
      </if>
      <if test="applyPerson != null" >
        apply_person = #{applyPerson,jdbcType=VARCHAR},
@@ -151,26 +188,66 @@
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="tid != null">
        tid = #{tid,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=VARCHAR},
      </if>
      <if test="creator != null">
        creator = #{creator,jdbcType=VARCHAR},
      </if>
      <if test="updator != null">
        updator = #{updator,jdbcType=VARCHAR},
      </if>
      <if test="updatetime != null">
        updatetime = #{updatetime,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},
    set acid = #{acid,jdbcType=DECIMAL},
      alkali = #{alkali,jdbcType=DECIMAL},
      organic = #{organic,jdbcType=DECIMAL},
      solid = #{solid,jdbcType=DECIMAL},
      medical = #{medical,jdbcType=DECIMAL},
      apply_person = #{applyPerson,jdbcType=VARCHAR},
      project = #{project,jdbcType=VARCHAR},
      department = #{department,jdbcType=VARCHAR},
      unit = #{unit,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP}
      create_time = #{createTime,jdbcType=TIMESTAMP},
      tid = #{tid,jdbcType=VARCHAR},
      status = #{status,jdbcType=VARCHAR},
      creator = #{creator,jdbcType=VARCHAR},
      updator = #{updator,jdbcType=VARCHAR},
      updatetime = #{updatetime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="selectAll" resultMap="BaseResultMap" parameterType="java.util.Map" >
  <select id="setAllWasters" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from sys_hazardous_waste
    <where>
      1 = 1
      <if test="starttime != null and starttime != ''">
        and create_time &gt; #{starttime}
      </if>
      <if test="endtime != null and endtime != ''">
        and create_time &lt; #{endtime}
      </if>
      <if test="status != null and status != ''">
        and status = #{status}
      </if>
      <if test="applyPerson != null and applyPerson != ''">
        and apply_person = #{applyPerson}
      </if>
    </where>
    order by create_time desc
  </select>
  <select id="selectAll" parameterType="java.util.Map" resultMap="BaseResultMap">
    <!--          -->
    select
    <include refid="Base_Column_List" />
@@ -183,11 +260,26 @@
      <if test="endTime != null and endTime != ''" >
        and create_time &lt; #{endTime}
      </if>
      <if test="status != null and status != ''">
        and status = #{status}
      </if>
      <if test="applyPerson != null and applyPerson != ''">
        and apply_person = #{applyPerson}
      </if>
      <if test="project != null and project != ''">
        and project = #{project}
      </if>
      <if test="department != null and department != ''">
        and department = #{department}
      </if>
      <if test="tid != null and tid != ''">
        and tid = #{tid}
      </if>
    </where>
    order by create_time desc
    <if test="first != null and pageSize != null" >
      limit #{first},#{pageSize}
    </if>
    order by create_time
  </select>
  <select id="countAll"  resultType="java.lang.Integer" >
@@ -202,6 +294,148 @@
      <if test="endTime != null and endTime != ''" >
        and create_time &lt; #{endTime}
      </if>
      <if test="status != null and status != ''">
        and status = #{status}
      </if>
      <if test="applyPerson != null and applyPerson != ''">
        and apply_person = #{applyPerson}
      </if>
      <if test="project != null and project != ''">
        and project = #{project}
      </if>
      <if test="department != null and department != ''">
        and department = #{department}
      </if>
      <if test="tid != null and tid != ''">
        and tid = #{tid}
      </if>
    </where>
  </select>
  <select id="selectExportList" resultType="java.util.Map">
    select
    id, acid, alkali, organic, solid, medical, apply_person as applyPerson, project, department, unit,
    create_time as createTime, tid, status, creator
    from sys_hazardous_waste
    <where>
      1 = 1
      <if test="startTime != null and startTime != ''">
        and create_time &gt; #{startTime}
      </if>
      <if test="endTime != null and endTime != ''">
        and create_time &lt; #{endTime}
      </if>
      <if test="status != null and status != ''">
        and status = #{status}
      </if>
      <if test="applyPerson != null and applyPerson != ''">
        and apply_person = #{applyPerson}
      </if>
      <if test="project != null and project != ''">
        and project = #{project}
      </if>
      <if test="department != null and department != ''">
        and department = #{department}
      </if>
      <if test="tid != null and tid != ''">
        and tid = #{tid}
      </if>
    </where>
    order by create_time desc
  </select>
  <select id="countStatistics" resultType="java.lang.Integer">
    select count(0)
    from sys_hazardous_waste
    <where>
      1 = 1
      <if test="startTime != null and startTime != ''">
        and create_time &gt; #{startTime}
      </if>
      <if test="endTime != null and endTime != ''">
        and create_time &lt; #{endTime}
      </if>
      <if test="status != null and status != ''">
        and status = #{status}
      </if>
      <if test="applyPerson != null and applyPerson != ''">
        and apply_person = #{applyPerson}
      </if>
      <if test="project != null and project != ''">
        and project = #{project}
      </if>
      <if test="department != null and department != ''">
        and department = #{department}
      </if>
      group by project,department,unit
    </where>
  </select>
  <select id="selectStatistics" resultType="com.nanometer.smartlab.entity.HazardousWaste">
    select
    id, sum(acid) as acid,sum(alkali) as alkali, sum(organic) as organic,sum(solid) as solid,sum(medical) as medical,
    apply_person as applyPerson, project, department, unit,create_time as createTime, tid, status, creator
    from sys_hazardous_waste
    <where>
      1 = 1
      <if test="startTime != null and startTime != ''">
        and create_time &gt; #{startTime}
      </if>
      <if test="endTime != null and endTime != ''">
        and create_time &lt; #{endTime}
      </if>
      <if test="status != null and status != ''">
        and status = #{status}
      </if>
      <if test="applyPerson != null and applyPerson != ''">
        and apply_person = #{applyPerson}
      </if>
      <if test="project != null and project != ''">
        and project = #{project}
      </if>
      <if test="department != null and department != ''">
        and department = #{department}
      </if>
    </where>
    group by project,department,unit
    order by create_time desc
    <if test="first != null and pageSize != null">
      limit #{first},#{pageSize}
    </if>
  </select>
  <select id="selectStatisticsExportList" resultType="java.util.Map">
    select
    id, sum(acid) as acid,sum(alkali) as alkali, sum(organic) as organic,sum(solid) as solid,sum(medical) as medical,
    apply_person as applyPerson, project, department, unit,create_time as createTime, tid, status, creator
    from sys_hazardous_waste
    <where>
      1 = 1
      <if test="startTime != null and startTime != ''">
        and create_time &gt; #{startTime}
      </if>
      <if test="endTime != null and endTime != ''">
        and create_time &lt; #{endTime}
      </if>
      <if test="status != null and status != ''">
        and status = #{status}
      </if>
      <if test="applyPerson != null and applyPerson != ''">
        and apply_person = #{applyPerson}
      </if>
      <if test="project != null and project != ''">
        and project = #{project}
      </if>
      <if test="department != null and department != ''">
        and department = #{department}
      </if>
    </where>
    group by project,department,unit
    order by create_time desc
  </select>
  <select id="selectByTid" resultType="com.nanometer.smartlab.entity.HazardousWaste">
    select
    <include refid="Base_Column_List" />
    from sys_hazardous_waste
    <where>
      1 = 1
    and tid = #{tid}
    </where>
  </select>
</mapper>