郑永安
2023-06-19 59e91a4e9ddaf23cebb12993c774aa899ab22d16
src/main/java/com/gk/firework/Mapper/mybatis/HiddenDangerReportDetailMapper.xml
对比新文件
@@ -0,0 +1,261 @@
<?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.gk.firework.Mapper.HiddenDangerReportDetailMapper" >
  <resultMap id="BaseResultMap" type="com.gk.firework.Domain.HiddenDangerReportDetail" >
    <!--          -->
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="resultid" property="resultid" jdbcType="BIGINT" />
    <result column="reportcode" property="reportcode" jdbcType="VARCHAR" />
    <result column="findtime" property="findtime" jdbcType="TIMESTAMP" />
    <result column="level" property="level" jdbcType="BIT" />
    <result column="memo" property="memo" jdbcType="VARCHAR" />
    <result column="rectifystatus" property="rectifystatus" jdbcType="BIT" />
    <result column="rectifydeadline" property="rectifydeadline" jdbcType="TIMESTAMP" />
    <result column="rectifycompletedate" property="rectifycompletedate" jdbcType="TIMESTAMP" />
    <result column="rectifymeasure" property="rectifymeasure" jdbcType="BIT" />
    <result column="rectifyprincipal" property="rectifyprincipal" jdbcType="VARCHAR" />
    <result column="url" property="url" jdbcType="VARCHAR" />
    <result column="validflag" property="validflag" jdbcType="BIT" />
    <result column="isqualified" property="isqualified" jdbcType="BIT" />
    <result column="checktypeid" property="checktypeid" jdbcType="BIGINT" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--          -->
    id, resultid, reportcode, findtime, level, memo, rectifystatus, rectifydeadline,
    rectifycompletedate, rectifymeasure, rectifyprincipal, url, validflag
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    <!--          -->
    select
    <include refid="Base_Column_List" />
    from hiddendangerreportdetail
    where id = #{id,jdbcType=BIGINT}
  </select>
  <select id="countOverDueByReportCode" resultType="java.lang.Integer">
    select  count(0)
    from hiddendangerreportdetail
    where reportcode = #{code}
    and validflag = 1
    and rectifystatus = 1
    and rectifydeadline is not null
    and rectifydeadline &lt; now()
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    <!--          -->
    delete from hiddendangerreportdetail
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insertSelective" parameterType="com.gk.firework.Domain.HiddenDangerReportDetail" >
    <!--          -->
    insert into hiddendangerreportdetail
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="resultid != null" >
        resultid,
      </if>
      <if test="reportcode != null" >
        reportcode,
      </if>
      <if test="findtime != null" >
        findtime,
      </if>
      <if test="level != null" >
        level,
      </if>
      <if test="memo != null" >
        memo,
      </if>
      <if test="rectifystatus != null" >
        rectifystatus,
      </if>
      <if test="rectifydeadline != null" >
        rectifydeadline,
      </if>
      <if test="rectifycompletedate != null" >
        rectifycompletedate,
      </if>
      <if test="rectifymeasure != null" >
        rectifymeasure,
      </if>
      <if test="rectifyprincipal != null" >
        rectifyprincipal,
      </if>
      <if test="url != null" >
        url,
      </if>
      <if test="validflag != null" >
        validflag,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=BIGINT},
      </if>
      <if test="resultid != null" >
        #{resultid,jdbcType=BIGINT},
      </if>
      <if test="reportcode != null" >
        #{reportcode,jdbcType=VARCHAR},
      </if>
      <if test="findtime != null" >
        #{findtime,jdbcType=TIMESTAMP},
      </if>
      <if test="level != null" >
        #{level,jdbcType=BIT},
      </if>
      <if test="memo != null" >
        #{memo,jdbcType=VARCHAR},
      </if>
      <if test="rectifystatus != null" >
        #{rectifystatus,jdbcType=BIT},
      </if>
      <if test="rectifydeadline != null" >
        #{rectifydeadline,jdbcType=TIMESTAMP},
      </if>
      <if test="rectifycompletedate != null" >
        #{rectifycompletedate,jdbcType=TIMESTAMP},
      </if>
      <if test="rectifymeasure != null" >
        #{rectifymeasure,jdbcType=BIT},
      </if>
      <if test="rectifyprincipal != null" >
        #{rectifyprincipal,jdbcType=VARCHAR},
      </if>
      <if test="url != null" >
        #{url,jdbcType=VARCHAR},
      </if>
      <if test="validflag != null" >
        #{validflag,jdbcType=BIT},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.gk.firework.Domain.HiddenDangerReportDetail" >
    <!--          -->
    update hiddendangerreportdetail
    <set >
      <if test="resultid != null" >
        resultid = #{resultid,jdbcType=BIGINT},
      </if>
      <if test="reportcode != null" >
        reportcode = #{reportcode,jdbcType=VARCHAR},
      </if>
      <if test="findtime != null" >
        findtime = #{findtime,jdbcType=TIMESTAMP},
      </if>
      <if test="level != null" >
        level = #{level,jdbcType=BIT},
      </if>
      <if test="memo != null" >
        memo = #{memo,jdbcType=VARCHAR},
      </if>
      <if test="rectifystatus != null" >
        rectifystatus = #{rectifystatus,jdbcType=BIT},
      </if>
      <if test="rectifydeadline != null" >
        rectifydeadline = #{rectifydeadline,jdbcType=TIMESTAMP},
      </if>
      <if test="rectifycompletedate != null" >
        rectifycompletedate = #{rectifycompletedate,jdbcType=TIMESTAMP},
      </if>
      <if test="rectifymeasure != null" >
        rectifymeasure = #{rectifymeasure,jdbcType=BIT},
      </if>
      <if test="rectifyprincipal != null" >
        rectifyprincipal = #{rectifyprincipal,jdbcType=VARCHAR},
      </if>
      <if test="url != null" >
        url = #{url,jdbcType=VARCHAR},
      </if>
      <if test="validflag != null" >
        validflag = #{validflag,jdbcType=BIT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.gk.firework.Domain.HiddenDangerReportDetail" >
    <!--          -->
    update hiddendangerreportdetail
    set resultid = #{resultid,jdbcType=BIGINT},
      reportcode = #{reportcode,jdbcType=VARCHAR},
      findtime = #{findtime,jdbcType=TIMESTAMP},
      level = #{level,jdbcType=BIT},
      memo = #{memo,jdbcType=VARCHAR},
      rectifystatus = #{rectifystatus,jdbcType=BIT},
      rectifydeadline = #{rectifydeadline,jdbcType=TIMESTAMP},
      rectifycompletedate = #{rectifycompletedate,jdbcType=TIMESTAMP},
      rectifymeasure = #{rectifymeasure,jdbcType=BIT},
      rectifyprincipal = #{rectifyprincipal,jdbcType=VARCHAR},
      url = #{url,jdbcType=VARCHAR},
      validflag = #{validflag,jdbcType=BIT}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="update2Qualified" parameterType="java.util.List">
    update hiddendangerreportdetail
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="findtime =case" suffix="end,">
        <foreach collection="list" item="item" index="index">
            when id=#{item.id} then null
        </foreach>
      </trim>
      <trim prefix="level =case" suffix="end,">
        <foreach collection="list" item="item" index="index">
          when id=#{item.id} then null
        </foreach>
      </trim>
      <trim prefix="memo =case" suffix="end,">
        <foreach collection="list" item="item" index="index">
          when id=#{item.id} then null
        </foreach>
      </trim>
      <trim prefix="rectifystatus =case" suffix="end,">
        <foreach collection="list" item="item" index="index">
          when id=#{item.id} then null
        </foreach>
      </trim>
      <trim prefix="rectifydeadline =case" suffix="end,">
        <foreach collection="list" item="item" index="index">
          when id=#{item.id} then null
        </foreach>
      </trim>
      <trim prefix="rectifycompletedate =case" suffix="end,">
        <foreach collection="list" item="item" index="index">
          when id=#{item.id} then null
        </foreach>
      </trim>
      <trim prefix="rectifyprincipal =case" suffix="end,">
        <foreach collection="list" item="item" index="index">
          when id=#{item.id} then null
        </foreach>
      </trim>
      <trim prefix="url =case" suffix="end,">
        <foreach collection="list" item="item" index="index">
          when id=#{item.id} then null
        </foreach>
      </trim>
      <trim prefix="resultid =case" suffix="end,">
        <foreach collection="list" item="item" index="index">
          when id=#{item.id} then #{item.resultid}
        </foreach>
      </trim>
      <trim prefix="isqualified =case" suffix="end,">
        <foreach collection="list" item="item" index="index">
          when id=#{item.id} then 1
        </foreach>
      </trim>
      <trim prefix="rectifymeasure =case" suffix="end,">
        <foreach collection="list" item="item" index="index">
          when id=#{item.id} then null
        </foreach>
      </trim>
    </trim>
    where id in
    <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
      #{item.id,jdbcType=BIGINT}
    </foreach>
  </update>
</mapper>