郑永安
2023-08-23 0a9ed7b7488de66a50799f79369d7806910ae00a
src/main/java/com/gk/hotwork/Mapper/mybatis/SafetyFacilityInspectionMapper.xml
@@ -8,18 +8,26 @@
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
    <result column="submit_date" property="submitDate" jdbcType="TIMESTAMP" />
    <result column="submit_date" property="submitDate" jdbcType="DATE" />
    <result column="type" property="type" jdbcType="INTEGER" />
    <result column="project_name" property="projectName" jdbcType="VARCHAR" />
    <result column="progress" property="progress" jdbcType="INTEGER" />
    <result column="expert" property="expert" jdbcType="VARCHAR" />
    <result column="contact" property="contact" jdbcType="VARCHAR" />
    <result column="telephone" property="telephone" jdbcType="VARCHAR" />
    <result column="company" property="company" jdbcType="VARCHAR" />
    <result column="accept_time" property="acceptTime" jdbcType="TIMESTAMP" />
    <result column="review_time" property="reviewTime" jdbcType="TIMESTAMP" />
    <result column="examine_time" property="examineTime" jdbcType="TIMESTAMP" />
    <result column="correctpdf" property="correctpdf" jdbcType="VARCHAR" />
    <result column="examine_pageno" property="examinePageno" jdbcType="VARCHAR" />
    <result column="examine_taketime" property="examineTaketime" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--          -->
    id, valid_flag, create_time, create_by, update_time, submit_date, type, project_name, 
    progress, expert, contact, telephone
    progress, expert, contact, telephone, company, accept_time, review_time, examine_time,
    correctpdf, examine_pageno, examine_taketime
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    <!--          -->
@@ -38,13 +46,17 @@
    insert into safety_facility_inspection (id, valid_flag, create_time, 
      create_by, update_time, submit_date, 
      type, project_name, progress, 
      expert, contact, telephone
      )
      expert, contact, telephone,
      company, accept_time, review_time,
      examine_time, correctpdf, examine_pageno,
      examine_taketime)
    values (#{id,jdbcType=BIGINT}, #{validFlag,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, 
      #{createBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{submitDate,jdbcType=TIMESTAMP},
      #{createBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{submitDate,jdbcType=DATE},
      #{type,jdbcType=INTEGER}, #{projectName,jdbcType=VARCHAR}, #{progress,jdbcType=INTEGER}, 
      #{expert,jdbcType=VARCHAR}, #{contact,jdbcType=VARCHAR}, #{telephone,jdbcType=VARCHAR}
      )
      #{expert,jdbcType=VARCHAR}, #{contact,jdbcType=VARCHAR}, #{telephone,jdbcType=VARCHAR},
      #{company,jdbcType=VARCHAR}, #{acceptTime,jdbcType=TIMESTAMP}, #{reviewTime,jdbcType=TIMESTAMP},
      #{examineTime,jdbcType=TIMESTAMP}, #{correctpdf,jdbcType=VARCHAR}, #{examinePageno,jdbcType=VARCHAR},
      #{examineTaketime,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.gk.hotwork.Domain.SafetyFacilityInspection" >
    <!--          -->
@@ -86,6 +98,27 @@
      <if test="telephone != null" >
        telephone,
      </if>
      <if test="company != null" >
        company,
      </if>
      <if test="acceptTime != null" >
        accept_time,
      </if>
      <if test="reviewTime != null" >
        review_time,
      </if>
      <if test="examineTime != null" >
        examine_time,
      </if>
      <if test="correctpdf != null" >
        correctpdf,
      </if>
      <if test="examinePageno != null" >
        examine_pageno,
      </if>
      <if test="examineTaketime != null" >
        examine_taketime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
@@ -104,7 +137,7 @@
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="submitDate != null" >
        #{submitDate,jdbcType=TIMESTAMP},
        #{submitDate,jdbcType=DATE},
      </if>
      <if test="type != null" >
        #{type,jdbcType=INTEGER},
@@ -123,6 +156,27 @@
      </if>
      <if test="telephone != null" >
        #{telephone,jdbcType=VARCHAR},
      </if>
      <if test="company != null" >
        #{company,jdbcType=VARCHAR},
      </if>
      <if test="acceptTime != null" >
        #{acceptTime,jdbcType=TIMESTAMP},
      </if>
      <if test="reviewTime != null" >
        #{reviewTime,jdbcType=TIMESTAMP},
      </if>
      <if test="examineTime != null" >
        #{examineTime,jdbcType=TIMESTAMP},
      </if>
      <if test="correctpdf != null" >
        #{correctpdf,jdbcType=VARCHAR},
      </if>
      <if test="examinePageno != null" >
        #{examinePageno,jdbcType=VARCHAR},
      </if>
      <if test="examineTaketime != null" >
        #{examineTaketime,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
@@ -143,7 +197,7 @@
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="submitDate != null" >
        submit_date = #{submitDate,jdbcType=TIMESTAMP},
        submit_date = #{submitDate,jdbcType=DATE},
      </if>
      <if test="type != null" >
        type = #{type,jdbcType=INTEGER},
@@ -163,6 +217,27 @@
      <if test="telephone != null" >
        telephone = #{telephone,jdbcType=VARCHAR},
      </if>
      <if test="company != null" >
        company = #{company,jdbcType=VARCHAR},
      </if>
      <if test="acceptTime != null" >
        accept_time = #{acceptTime,jdbcType=TIMESTAMP},
      </if>
      <if test="reviewTime != null" >
        review_time = #{reviewTime,jdbcType=TIMESTAMP},
      </if>
      <if test="examineTime != null" >
        examine_time = #{examineTime,jdbcType=TIMESTAMP},
      </if>
      <if test="correctpdf != null" >
        correctpdf = #{correctpdf,jdbcType=VARCHAR},
      </if>
      <if test="examinePageno != null" >
        examine_pageno = #{examinePageno,jdbcType=VARCHAR},
      </if>
      <if test="examineTaketime != null" >
        examine_taketime = #{examineTaketime,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
@@ -173,19 +248,26 @@
      create_time = #{createTime,jdbcType=TIMESTAMP},
      create_by = #{createBy,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      submit_date = #{submitDate,jdbcType=TIMESTAMP},
      submit_date = #{submitDate,jdbcType=DATE},
      type = #{type,jdbcType=INTEGER},
      project_name = #{projectName,jdbcType=VARCHAR},
      progress = #{progress,jdbcType=INTEGER},
      expert = #{expert,jdbcType=VARCHAR},
      contact = #{contact,jdbcType=VARCHAR},
      telephone = #{telephone,jdbcType=VARCHAR}
      telephone = #{telephone,jdbcType=VARCHAR},
      company = #{company,jdbcType=VARCHAR},
      accept_time = #{acceptTime,jdbcType=TIMESTAMP},
      review_time = #{reviewTime,jdbcType=TIMESTAMP},
      examine_time = #{examineTime,jdbcType=TIMESTAMP},
      correctpdf = #{correctpdf,jdbcType=VARCHAR},
      examine_pageno = #{examinePageno,jdbcType=VARCHAR},
      examine_taketime = #{examineTaketime,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  
  <select id="selectPages" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    <include refid="Base_Column_List" />
    from safety_facility_inspection
    where valid_flag = 1 
    <if test="params.submitDateStartTime != null  and params.submitDateStartTime != ''">
@@ -194,12 +276,24 @@
    <if test="params.submitDateEndTime != null  and params.submitDateEndTime != ''">
      and submit_date &lt;=#{params.submitDateEndTime,jdbcType=VARCHAR} 
    </if>
    <if test="params.expert != null">
      and expert = #{params.expert,jdbcType=VARCHAR}
    <if test="params.expert != null  and params.expert != ''">
       and expert like concat("%",#{params.expert,jdbcType=VARCHAR},"%")
    </if>
    <if test="params.progress != null">
    <if test="params.progress != null ">
      and progress = #{params.progress,jdbcType=INTEGER}
    </if>
    <if test="params.type != null and params.type != ''">
      and type = #{params.type,jdbcType=INTEGER}
    </if>
      <if test="params.createBy != null and params.createBy != ''">
      and create_by = #{params.createBy,jdbcType=VARCHAR}
    </if>
    <if test="params.company != null and params.company.size > 0">
      and company in
      <foreach collection="params.company" index="index" item="item" open="(" separator="," close=")">
          #{item}
      </foreach>
     </if>
    ORDER BY
    type,
    create_time DESC