StaffSecurityInspectionMapper.xml 8.3 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.tianbo.warehouse.dao.StaffSecurityInspectionMapper" >
  <resultMap id="BaseResultMap" type="com.tianbo.warehouse.model.StaffSecurityInspection" >
    <id column="security_inspection_id" property="securityInspectionId" jdbcType="VARCHAR" />
    <result column="security_inspection_name" property="securityInspectionName" jdbcType="VARCHAR" />
    <result column="security_inspection_date" property="securityInspectionDate" jdbcType="TIMESTAMP" />
    <result column="fire_name" property="fireName" jdbcType="VARCHAR" />
    <result column="security_electro" property="securityElectro" jdbcType="VARCHAR" />
    <result column="fireproofing" property="fireproofing" jdbcType="VARCHAR" />
    <result column="doubtful_person" property="doubtfulPerson" jdbcType="VARCHAR" />
    <result column="violations_car" property="violationsCar" jdbcType="VARCHAR" />
    <result column="builders" property="builders" jdbcType="VARCHAR" />
    <result column="other_situations" property="otherSituations" jdbcType="VARCHAR" />
    <result column="user_id" property="userId" jdbcType="INTEGER" />
    <result column="realname" property="realname" jdbcType="VARCHAR" />
    <result column="opt_time" property="optTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    security_inspection_id, security_inspection_name, security_inspection_date, fire_name, 
    security_electro, fireproofing, doubtful_person, violations_car, builders, other_situations, 
    user_id, realname, opt_time
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from staff_security_inspection
    where security_inspection_id = #{securityInspectionId,jdbcType=VARCHAR}
  </select>

  <select id="findAll" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select
    <include refid="Base_Column_List" />
    from staff_security_inspection
    <if test="securityInspectionName != null and securityInspectionName!=''" >
      where security_inspection_name = #{securityInspectionName, jdbcType=VARCHAR}
    </if>
  </select>

  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from staff_security_inspection
    where security_inspection_id = #{securityInspectionId,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.tianbo.warehouse.model.StaffSecurityInspection" >
    insert into staff_security_inspection (security_inspection_id, security_inspection_name, 
      security_inspection_date, fire_name, security_electro, 
      fireproofing, doubtful_person, violations_car, 
      builders, other_situations, user_id, 
      realname, opt_time)
    values (#{securityInspectionId,jdbcType=VARCHAR}, #{securityInspectionName,jdbcType=VARCHAR}, 
      #{securityInspectionDate,jdbcType=TIMESTAMP}, #{fireName,jdbcType=VARCHAR}, #{securityElectro,jdbcType=VARCHAR}, 
      #{fireproofing,jdbcType=VARCHAR}, #{doubtfulPerson,jdbcType=VARCHAR}, #{violationsCar,jdbcType=VARCHAR}, 
      #{builders,jdbcType=VARCHAR}, #{otherSituations,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER}, 
      #{realname,jdbcType=VARCHAR}, #{optTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.tianbo.warehouse.model.StaffSecurityInspection" >
    insert into staff_security_inspection
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="securityInspectionId != null" >
        security_inspection_id,
      </if>
      <if test="securityInspectionName != null" >
        security_inspection_name,
      </if>
      <if test="securityInspectionDate != null" >
        security_inspection_date,
      </if>
      <if test="fireName != null" >
        fire_name,
      </if>
      <if test="securityElectro != null" >
        security_electro,
      </if>
      <if test="fireproofing != null" >
        fireproofing,
      </if>
      <if test="doubtfulPerson != null" >
        doubtful_person,
      </if>
      <if test="violationsCar != null" >
        violations_car,
      </if>
      <if test="builders != null" >
        builders,
      </if>
      <if test="otherSituations != null" >
        other_situations,
      </if>
      <if test="userId != null" >
        user_id,
      </if>
      <if test="realname != null" >
        realname,
      </if>
      <if test="optTime != null" >
        opt_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="securityInspectionId != null" >
        #{securityInspectionId,jdbcType=VARCHAR},
      </if>
      <if test="securityInspectionName != null" >
        #{securityInspectionName,jdbcType=VARCHAR},
      </if>
      <if test="securityInspectionDate != null" >
        #{securityInspectionDate,jdbcType=TIMESTAMP},
      </if>
      <if test="fireName != null" >
        #{fireName,jdbcType=VARCHAR},
      </if>
      <if test="securityElectro != null" >
        #{securityElectro,jdbcType=VARCHAR},
      </if>
      <if test="fireproofing != null" >
        #{fireproofing,jdbcType=VARCHAR},
      </if>
      <if test="doubtfulPerson != null" >
        #{doubtfulPerson,jdbcType=VARCHAR},
      </if>
      <if test="violationsCar != null" >
        #{violationsCar,jdbcType=VARCHAR},
      </if>
      <if test="builders != null" >
        #{builders,jdbcType=VARCHAR},
      </if>
      <if test="otherSituations != null" >
        #{otherSituations,jdbcType=VARCHAR},
      </if>
      <if test="userId != null" >
        #{userId,jdbcType=INTEGER},
      </if>
      <if test="realname != null" >
        #{realname,jdbcType=VARCHAR},
      </if>
      <if test="optTime != null" >
        #{optTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.warehouse.model.StaffSecurityInspection" >
    update staff_security_inspection
    <set >
      <if test="securityInspectionName != null" >
        security_inspection_name = #{securityInspectionName,jdbcType=VARCHAR},
      </if>
      <if test="securityInspectionDate != null" >
        security_inspection_date = #{securityInspectionDate,jdbcType=TIMESTAMP},
      </if>
      <if test="fireName != null" >
        fire_name = #{fireName,jdbcType=VARCHAR},
      </if>
      <if test="securityElectro != null" >
        security_electro = #{securityElectro,jdbcType=VARCHAR},
      </if>
      <if test="fireproofing != null" >
        fireproofing = #{fireproofing,jdbcType=VARCHAR},
      </if>
      <if test="doubtfulPerson != null" >
        doubtful_person = #{doubtfulPerson,jdbcType=VARCHAR},
      </if>
      <if test="violationsCar != null" >
        violations_car = #{violationsCar,jdbcType=VARCHAR},
      </if>
      <if test="builders != null" >
        builders = #{builders,jdbcType=VARCHAR},
      </if>
      <if test="otherSituations != null" >
        other_situations = #{otherSituations,jdbcType=VARCHAR},
      </if>
      <if test="userId != null" >
        user_id = #{userId,jdbcType=INTEGER},
      </if>
      <if test="realname != null" >
        realname = #{realname,jdbcType=VARCHAR},
      </if>
      <if test="optTime != null" >
        opt_time = #{optTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where security_inspection_id = #{securityInspectionId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.tianbo.warehouse.model.StaffSecurityInspection" >
    update staff_security_inspection
    set security_inspection_name = #{securityInspectionName,jdbcType=VARCHAR},
      security_inspection_date = #{securityInspectionDate,jdbcType=TIMESTAMP},
      fire_name = #{fireName,jdbcType=VARCHAR},
      security_electro = #{securityElectro,jdbcType=VARCHAR},
      fireproofing = #{fireproofing,jdbcType=VARCHAR},
      doubtful_person = #{doubtfulPerson,jdbcType=VARCHAR},
      violations_car = #{violationsCar,jdbcType=VARCHAR},
      builders = #{builders,jdbcType=VARCHAR},
      other_situations = #{otherSituations,jdbcType=VARCHAR},
      user_id = #{userId,jdbcType=INTEGER},
      realname = #{realname,jdbcType=VARCHAR},
      opt_time = #{optTime,jdbcType=TIMESTAMP}
    where security_inspection_id = #{securityInspectionId,jdbcType=VARCHAR}
  </update>
</mapper>