123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- <?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.bz.smart_city.dao.InspectionIndexMapper">
- <!--auto generated Code-->
- <resultMap id="BaseResultMap" type="com.bz.smart_city.entity.InspectionIndex">
- <result column="id" property="id" jdbcType="INTEGER"/>
- <result column="index_name" property="indexName" jdbcType="VARCHAR"/>
- <result column="index_type" property="indexType" jdbcType="INTEGER"/>
- <result column="index_description" property="indexDescription" jdbcType="VARCHAR"/>
- <result column="index_value" property="indexValue" jdbcType="VARCHAR"/>
- <result column="index_unit" property="indexUnit" jdbcType="VARCHAR"/>
- <result column="site_id" property="siteId" jdbcType="INTEGER"/>
- <result column="standard" property="standard" jdbcType="INTEGER"/>
- <result column="status" property="status" jdbcType="INTEGER"/>
- <result column="date_create" property="dateCreate" jdbcType="TIMESTAMP"/>
- <result column="date_update" property="dateUpdate" jdbcType="TIMESTAMP"/>
- <result column="create_by" property="createBy" jdbcType="VARCHAR"/>
- <result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
- </resultMap>
- <!--auto generated Code-->
- <sql id="Base_Column_List">
- id,
- index_name,
- index_type,
- index_description,
- index_value,
- index_unit,
- site_id,
- standard,
- status,
- date_create,
- date_update,
- create_by,
- update_by
- </sql>
- <!--auto generated Code-->
- <insert id="insert" useGeneratedKeys="true" keyProperty="inspectionIndex.id">
- INSERT INTO sc_inspection_index (
- id,
- index_name,
- index_type,
- index_description,
- index_value,
- index_unit,
- site_id,
- standard,
- status,
- date_create,
- date_update,
- create_by,
- update_by
- ) VALUES (
- #{inspectionIndex.id,jdbcType=INTEGER},
- #{inspectionIndex.indexName,jdbcType=VARCHAR},
- #{inspectionIndex.indexType,jdbcType=INTEGER},
- #{inspectionIndex.indexDescription,jdbcType=VARCHAR},
- #{inspectionIndex.indexValue,jdbcType=VARCHAR},
- #{inspectionIndex.indexUnit,jdbcType=VARCHAR},
- #{inspectionIndex.siteId,jdbcType=INTEGER},
- #{inspectionIndex.standard,jdbcType=INTEGER},
- #{inspectionIndex.status,jdbcType=INTEGER},
- #{inspectionIndex.dateCreate,jdbcType=TIMESTAMP},
- #{inspectionIndex.dateUpdate,jdbcType=TIMESTAMP},
- #{inspectionIndex.createBy,jdbcType=VARCHAR},
- #{inspectionIndex.updateBy,jdbcType=VARCHAR}
- )
- </insert>
- <!--auto generated Code-->
- <insert id="insertSelective" useGeneratedKeys="true" keyProperty="inspectionIndex.id">
- INSERT INTO sc_inspection_index
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="inspectionIndex.id!=null"> id,</if>
- <if test="inspectionIndex.indexName!=null"> index_name,</if>
- <if test="inspectionIndex.indexType!=null"> index_type,</if>
- <if test="inspectionIndex.indexDescription!=null"> index_description,</if>
- <if test="inspectionIndex.indexValue!=null"> index_value,</if>
- <if test="inspectionIndex.indexUnit!=null"> index_unit,</if>
- <if test="inspectionIndex.siteId!=null"> site_id,</if>
- <if test="inspectionIndex.standard!=null"> standard,</if>
- <if test="inspectionIndex.status!=null"> status,</if>
- <if test="inspectionIndex.dateCreate!=null"> date_create,</if>
- <if test="inspectionIndex.dateUpdate!=null"> date_update,</if>
- <if test="inspectionIndex.createBy!=null"> create_by,</if>
- <if test="inspectionIndex.updateBy!=null"> update_by,</if>
- </trim>
- VALUES
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="inspectionIndex.id!=null">#{inspectionIndex.id,jdbcType=INTEGER},
- </if>
- <if test="inspectionIndex.indexName!=null">#{inspectionIndex.indexName,jdbcType=VARCHAR},
- </if>
- <if test="inspectionIndex.indexType!=null">#{inspectionIndex.indexType,jdbcType=INTEGER},
- </if>
- <if test="inspectionIndex.indexDescription!=null">#{inspectionIndex.indexDescription,jdbcType=VARCHAR},
- </if>
- <if test="inspectionIndex.indexValue!=null">#{inspectionIndex.indexValue,jdbcType=VARCHAR},
- </if>
- <if test="inspectionIndex.indexUnit!=null">#{inspectionIndex.indexUnit,jdbcType=VARCHAR},
- </if>
- <if test="inspectionIndex.siteId!=null">#{inspectionIndex.siteId,jdbcType=INTEGER},
- </if>
- <if test="inspectionIndex.standard!=null">#{inspectionIndex.standard,jdbcType=INTEGER},
- </if>
- <if test="inspectionIndex.status!=null">#{inspectionIndex.status,jdbcType=INTEGER},
- </if>
- <if test="inspectionIndex.dateCreate!=null">#{inspectionIndex.dateCreate,jdbcType=TIMESTAMP},
- </if>
- <if test="inspectionIndex.dateUpdate!=null">#{inspectionIndex.dateUpdate,jdbcType=TIMESTAMP},
- </if>
- <if test="inspectionIndex.createBy!=null">#{inspectionIndex.createBy,jdbcType=VARCHAR},
- </if>
- <if test="inspectionIndex.updateBy!=null">#{inspectionIndex.updateBy,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <!--auto generated Code-->
- <insert id="insertList">
- INSERT INTO sc_inspection_index (
- id,
- index_name,
- index_type,
- index_description,
- index_value,
- index_unit,
- site_id,
- standard,
- status,
- date_create,
- date_update,
- create_by,
- update_by
- )VALUES
- <foreach collection="inspectionIndexs" item="inspectionIndex" index="index" separator=",">
- (
- #{inspectionIndex.id,jdbcType=INTEGER},
- #{inspectionIndex.indexName,jdbcType=VARCHAR},
- #{inspectionIndex.indexType,jdbcType=INTEGER},
- #{inspectionIndex.indexDescription,jdbcType=VARCHAR},
- #{inspectionIndex.indexValue,jdbcType=VARCHAR},
- #{inspectionIndex.indexUnit,jdbcType=VARCHAR},
- #{inspectionIndex.siteId,jdbcType=INTEGER},
- #{inspectionIndex.standard,jdbcType=INTEGER},
- #{inspectionIndex.status,jdbcType=INTEGER},
- #{inspectionIndex.dateCreate,jdbcType=TIMESTAMP},
- #{inspectionIndex.dateUpdate,jdbcType=TIMESTAMP},
- #{inspectionIndex.createBy,jdbcType=VARCHAR},
- #{inspectionIndex.updateBy,jdbcType=VARCHAR}
- )
- </foreach>
- </insert>
- <!--auto generated Code-->
- <update id="updateByPrimaryKeySelective">
- UPDATE sc_inspection_index
- <set>
- <if test="inspectionIndex.indexName != null"> index_name= #{inspectionIndex.indexName,jdbcType=VARCHAR},</if>
- <if test="inspectionIndex.indexType != null"> index_type= #{inspectionIndex.indexType,jdbcType=INTEGER},</if>
- <if test="inspectionIndex.indexDescription != null"> index_description= #{inspectionIndex.indexDescription,jdbcType=VARCHAR},</if>
- <if test="inspectionIndex.indexValue != null"> index_value= #{inspectionIndex.indexValue,jdbcType=VARCHAR},</if>
- <if test="inspectionIndex.indexUnit != null"> index_unit= #{inspectionIndex.indexUnit,jdbcType=VARCHAR},</if>
- <if test="inspectionIndex.siteId != null"> site_id= #{inspectionIndex.siteId,jdbcType=INTEGER},</if>
- <if test="inspectionIndex.standard != null"> standard= #{inspectionIndex.standard,jdbcType=INTEGER},</if>
- <if test="inspectionIndex.status != null"> status= #{inspectionIndex.status,jdbcType=INTEGER},</if>
- <if test="inspectionIndex.dateCreate != null"> date_create= #{inspectionIndex.dateCreate,jdbcType=TIMESTAMP},</if>
- <if test="inspectionIndex.dateUpdate != null"> date_update= #{inspectionIndex.dateUpdate,jdbcType=TIMESTAMP},</if>
- <if test="inspectionIndex.createBy != null"> create_by= #{inspectionIndex.createBy,jdbcType=VARCHAR},</if>
- <if test="inspectionIndex.updateBy != null"> update_by= #{inspectionIndex.updateBy,jdbcType=VARCHAR}</if>
- </set>
- WHERE id = #{inspectionIndex.id,jdbcType=INTEGER}
- </update>
- <update id="deleteByStandardId">
- update sc_inspection_index set status=0,date_update=now(),update_by=#{updateBy} where status = 1 and standard = #{id}
- </update>
- <select id="getListByStandardId" resultMap="BaseResultMap">
- select <include refid="Base_Column_List"/> from sc_inspection_index where status = 1 and standard = #{standardId}
- </select>
- </mapper>
|