123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <?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.InspectionResultMapper">
- <!--auto generated Code-->
- <resultMap id="BaseResultMap" type="com.bz.smart_city.entity.InspectionResult">
- <result column="id" property="id" jdbcType="INTEGER"/>
- <result column="site_id" property="siteId" jdbcType="INTEGER"/>
- <result column="instance_id" property="instanceId" jdbcType="INTEGER"/>
- <result column="plan_id" property="planId" jdbcType="INTEGER"/>
- <result column="object_id" property="objectId" jdbcType="INTEGER"/>
- <result column="index_id" property="indexId" jdbcType="INTEGER"/>
- <result column="index_value" property="indexValue" jdbcType="VARCHAR"/>
- <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"/>
- <result column="object_result_id" property="objectResultId" jdbcType="INTEGER"/>
- <result column="index_name" property="indexName" jdbcType="VARCHAR"/>
- <result column="index_type" property="indexType" jdbcType="INTEGER"/>
- <result column="index_definition_value" property="indexDefinitionValue" jdbcType="VARCHAR"/>
- </resultMap>
- <!--auto generated Code-->
- <sql id="Base_Column_List">
- id,
- site_id,
- instance_id,
- plan_id,
- object_id,
- index_id,
- index_value,
- status,
- date_create,
- date_update,
- create_by,
- update_by,
- object_result_id,
- index_name,
- index_type,
- index_definition_value
- </sql>
- <!--auto generated Code-->
- <insert id="insert" useGeneratedKeys="true" keyProperty="inspectionResult.id">
- INSERT INTO sc_inspection_result (
- id,
- site_id,
- instance_id,
- plan_id,
- object_id,
- index_id,
- index_value,
- status,
- date_create,
- date_update,
- create_by,
- update_by,
- object_result_id,
- index_name,
- index_type,
- index_definition_value
- ) VALUES (
- #{inspectionResult.id,jdbcType=INTEGER},
- #{inspectionResult.siteId,jdbcType=INTEGER},
- #{inspectionResult.instanceId,jdbcType=INTEGER},
- #{inspectionResult.planId,jdbcType=INTEGER},
- #{inspectionResult.objectId,jdbcType=INTEGER},
- #{inspectionResult.indexId,jdbcType=INTEGER},
- #{inspectionResult.indexValue,jdbcType=VARCHAR},
- #{inspectionResult.status,jdbcType=INTEGER},
- #{inspectionResult.dateCreate,jdbcType=TIMESTAMP},
- #{inspectionResult.dateUpdate,jdbcType=TIMESTAMP},
- #{inspectionResult.createBy,jdbcType=VARCHAR},
- #{inspectionResult.updateBy,jdbcType=VARCHAR},
- #{inspectionResult.objectResultId,jdbcType=INTEGER},
- #{inspectionResult.indexName,jdbcType=VARCHAR},
- #{inspectionResult.indexType,jdbcType=INTEGER},
- #{inspectionResult.indexDefinitionValue,jdbcType=VARCHAR}
- )
- </insert>
- <!--auto generated Code-->
- <insert id="insertSelective" useGeneratedKeys="true" keyProperty="inspectionResult.id">
- INSERT INTO sc_inspection_result
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="inspectionResult.id!=null"> id,</if>
- <if test="inspectionResult.siteId!=null"> site_id,</if>
- <if test="inspectionResult.instanceId!=null"> instance_id,</if>
- <if test="inspectionResult.planId!=null"> plan_id,</if>
- <if test="inspectionResult.objectId!=null"> object_id,</if>
- <if test="inspectionResult.indexId!=null"> index_id,</if>
- <if test="inspectionResult.indexValue!=null"> index_value,</if>
- <if test="inspectionResult.status!=null"> status,</if>
- <if test="inspectionResult.dateCreate!=null"> date_create,</if>
- <if test="inspectionResult.dateUpdate!=null"> date_update,</if>
- <if test="inspectionResult.createBy!=null"> create_by,</if>
- <if test="inspectionResult.updateBy!=null"> update_by,</if>
- <if test="inspectionResult.objectResultId!=null"> object_result_id,</if>
- <if test="inspectionResult.indexName!=null"> index_name,</if>
- <if test="inspectionResult.indexType!=null"> index_type,</if>
- <if test="inspectionResult.indexDefinitionValue!=null"> index_definition_value</if>
- </trim>
- VALUES
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="inspectionResult.id!=null"> #{inspectionResult.id,jdbcType=INTEGER},</if>
- <if test="inspectionResult.siteId!=null"> #{inspectionResult.siteId,jdbcType=INTEGER},</if>
- <if test="inspectionResult.instanceId!=null"> #{inspectionResult.instanceId,jdbcType=INTEGER},</if>
- <if test="inspectionResult.planId!=null"> #{inspectionResult.planId,jdbcType=INTEGER},</if>
- <if test="inspectionResult.objectId!=null"> #{inspectionResult.objectId,jdbcType=INTEGER},</if>
- <if test="inspectionResult.indexId!=null"> #{inspectionResult.indexId,jdbcType=INTEGER},</if>
- <if test="inspectionResult.indexValue!=null"> #{inspectionResult.indexValue,jdbcType=VARCHAR},</if>
- <if test="inspectionResult.status!=null"> #{inspectionResult.status,jdbcType=INTEGER},</if>
- <if test="inspectionResult.dateCreate!=null"> #{inspectionResult.dateCreate,jdbcType=TIMESTAMP},</if>
- <if test="inspectionResult.dateUpdate!=null"> #{inspectionResult.dateUpdate,jdbcType=TIMESTAMP},</if>
- <if test="inspectionResult.createBy!=null"> #{inspectionResult.createBy,jdbcType=VARCHAR},</if>
- <if test="inspectionResult.updateBy!=null"> #{inspectionResult.updateBy,jdbcType=VARCHAR},</if>
- <if test="inspectionResult.objectResultId!=null"> #{inspectionResult.objectResultId,jdbcType=INTEGER},</if>
- <if test="inspectionResult.indexName!=null"> #{inspectionResult.indexName,jdbcType=VARCHAR},</if>
- <if test="inspectionResult.indexType!=null"> #{inspectionResult.indexType,jdbcType=INTEGER},</if>
- <if test="inspectionResult.indexDefinitionValue!=null"> #{inspectionResult.indexDefinitionValue,jdbcType=VARCHAR}</if>
- </trim>
- </insert>
- <!--auto generated Code-->
- <insert id="insertList">
- INSERT INTO sc_inspection_result(
- id,
- site_id,
- instance_id,
- plan_id,
- object_id,
- index_id,
- index_value,
- status,
- date_create,
- date_update,
- create_by,
- update_by,
- object_result_id,
- index_name,
- index_type,
- index_definition_value
- )VALUES
- <foreach collection="inspectionResults" item="inspectionResult" index="index" separator=",">
- (
- #{inspectionResult.id,jdbcType=INTEGER},
- #{inspectionResult.siteId,jdbcType=INTEGER},
- #{inspectionResult.instanceId,jdbcType=INTEGER},
- #{inspectionResult.planId,jdbcType=INTEGER},
- #{inspectionResult.objectId,jdbcType=INTEGER},
- #{inspectionResult.indexId,jdbcType=INTEGER},
- #{inspectionResult.indexValue,jdbcType=VARCHAR},
- #{inspectionResult.status,jdbcType=INTEGER},
- #{inspectionResult.dateCreate,jdbcType=TIMESTAMP},
- #{inspectionResult.dateUpdate,jdbcType=TIMESTAMP},
- #{inspectionResult.createBy,jdbcType=VARCHAR},
- #{inspectionResult.updateBy,jdbcType=VARCHAR},
- #{inspectionResult.objectResultId,jdbcType=INTEGER},
- #{inspectionResult.indexName,jdbcType=VARCHAR},
- #{inspectionResult.indexType,jdbcType=INTEGER},
- #{inspectionResult.indexDefinitionValue,jdbcType=VARCHAR}
- )
- </foreach>
- </insert>
- <!--auto generated Code-->
- <update id="updateByPrimaryKeySelective">
- UPDATE sc_inspection_result
- <set>
- <if test="inspectionResult.id != null"> id = #{inspectionResult.id,jdbcType=INTEGER},</if>
- <if test="inspectionResult.siteId != null"> site_id = #{inspectionResult.siteId,jdbcType=INTEGER},</if>
- <if test="inspectionResult.instanceId != null"> instance_id = #{inspectionResult.instanceId,jdbcType=INTEGER},</if>
- <if test="inspectionResult.planId != null"> plan_id = #{inspectionResult.planId,jdbcType=INTEGER},</if>
- <if test="inspectionResult.objectId != null"> object_id = #{inspectionResult.objectId,jdbcType=INTEGER},</if>
- <if test="inspectionResult.indexId != null"> index_id = #{inspectionResult.indexId,jdbcType=INTEGER},</if>
- <if test="inspectionResult.indexValue != null"> index_value = #{inspectionResult.indexValue,jdbcType=VARCHAR},</if>
- <if test="inspectionResult.status != null"> status = #{inspectionResult.status,jdbcType=INTEGER},</if>
- <if test="inspectionResult.dateCreate != null"> date_create = #{inspectionResult.dateCreate,jdbcType=TIMESTAMP},</if>
- <if test="inspectionResult.dateUpdate != null"> date_update = #{inspectionResult.dateUpdate,jdbcType=TIMESTAMP},</if>
- <if test="inspectionResult.createBy != null"> create_by = #{inspectionResult.createBy,jdbcType=VARCHAR},</if>
- <if test="inspectionResult.updateBy != null"> update_by = #{inspectionResult.updateBy,jdbcType=VARCHAR},</if>
- <if test="inspectionResult.objectResultId != null"> object_result_id = #{inspectionResult.objectResultId,jdbcType=INTEGER},</if>
- <if test="inspectionResult.indexName != null"> index_name = #{inspectionResult.indexName,jdbcType=VARCHAR},</if>
- <if test="inspectionResult.indexType != null"> index_type = #{inspectionResult.indexType,jdbcType=INTEGER},</if>
- <if test="inspectionResult.indexDefinitionValue != null"> index_definition_value = #{inspectionResult.indexDefinitionValue,jdbcType=VARCHAR}</if>
- </set>
- WHERE id = #{inspectionResult.id,jdbcType=INTEGER}
- </update>
- <select id="getInspectionResultList" resultType="com.bz.smart_city.dto.InspectionResultDto">
- select sir.* from sc_inspection_result sir
- where sir.status = 1 and sir.object_result_id = #{objectResultId}
- </select>
- </mapper>
|