123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- <?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.zcxk.smartcity.data.access.dao.DeviceMeasuringPointMapper">
- <!--auto generated Code-->
- <resultMap id="BaseResultMap" type="com.zcxk.smartcity.data.access.entity.DeviceMeasuringPoint">
- <result column="id" property="id" jdbcType="INTEGER"/>
- <result column="measuring_point_name" property="measuringPointName" jdbcType="VARCHAR"/>
- <result column="code_name" property="codeName" jdbcType="VARCHAR"/>
- <result column="data_unit" property="dataUnit" jdbcType="VARCHAR"/>
- <result column="measuring_point_type" property="measuringPointType" jdbcType="INTEGER"/>
- <result column="status" property="status" jdbcType="INTEGER"/>
- <result column="create_date" property="createDate" jdbcType="TIMESTAMP"/>
- <result column="create_by" property="createBy" jdbcType="VARCHAR"/>
- <result column="update_date" property="updateDate" jdbcType="TIMESTAMP"/>
- <result column="update_by" property="updateBy" jdbcType="VARCHAR"/>
- </resultMap>
- <!--auto generated Code-->
- <sql id="Base_Column_List">
- id,
- measuring_point_name,
- code_name,
- data_unit,
- measuring_point_type,
- status,
- create_date,
- create_by,
- update_date,
- update_by
- </sql>
- <!--auto generated Code-->
- <insert id="insert" useGeneratedKeys="true" keyProperty="deviceMeasuringPoint.id">
- INSERT INTO sc_device_measuring_point (
- id,
- measuring_point_name,
- code_name,
- data_unit,
- measuring_point_type,
- status,
- create_date,
- create_by,
- update_date,
- update_by
- ) VALUES (
- #{deviceMeasuringPoint.id,jdbcType=INTEGER},
- #{deviceMeasuringPoint.measuringPointName,jdbcType=VARCHAR},
- #{deviceMeasuringPoint.codeName,jdbcType=VARCHAR},
- #{deviceMeasuringPoint.dataUnit,jdbcType=VARCHAR},
- #{deviceMeasuringPoint.measuringPointType,jdbcType=INTEGER},
- #{deviceMeasuringPoint.status,jdbcType=INTEGER},
- #{deviceMeasuringPoint.createDate,jdbcType=TIMESTAMP},
- #{deviceMeasuringPoint.createBy,jdbcType=VARCHAR},
- #{deviceMeasuringPoint.updateDate,jdbcType=TIMESTAMP},
- #{deviceMeasuringPoint.updateBy,jdbcType=VARCHAR}
- )
- </insert>
- <!--auto generated Code-->
- <insert id="insertSelective" useGeneratedKeys="true" keyProperty="deviceMeasuringPoint.id">
- INSERT INTO sc_device_measuring_point
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="deviceMeasuringPoint.id!=null"> id,</if>
- <if test="deviceMeasuringPoint.measuringPointName!=null"> measuring_point_name,</if>
- <if test="deviceMeasuringPoint.codeName!=null"> code_name,</if>
- <if test="deviceMeasuringPoint.dataUnit!=null"> data_unit,</if>
- <if test="deviceMeasuringPoint.measuringPointType!=null"> measuring_point_type,</if>
- <if test="deviceMeasuringPoint.status!=null"> status,</if>
- <if test="deviceMeasuringPoint.createDate!=null"> create_date,</if>
- <if test="deviceMeasuringPoint.createBy!=null"> create_by,</if>
- <if test="deviceMeasuringPoint.updateDate!=null"> update_date,</if>
- <if test="deviceMeasuringPoint.updateBy!=null"> update_by,</if>
- </trim>
- VALUES
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="deviceMeasuringPoint.id!=null">#{deviceMeasuringPoint.id,jdbcType=INTEGER},
- </if>
- <if test="deviceMeasuringPoint.measuringPointName!=null">#{deviceMeasuringPoint.measuringPointName,jdbcType=VARCHAR},
- </if>
- <if test="deviceMeasuringPoint.codeName!=null">#{deviceMeasuringPoint.codeName,jdbcType=VARCHAR},
- </if>
- <if test="deviceMeasuringPoint.dataUnit!=null">#{deviceMeasuringPoint.dataUnit,jdbcType=VARCHAR},
- </if>
- <if test="deviceMeasuringPoint.measuringPointType!=null">#{deviceMeasuringPoint.measuringPointType,jdbcType=INTEGER},
- </if>
- <if test="deviceMeasuringPoint.status!=null">#{deviceMeasuringPoint.status,jdbcType=INTEGER},
- </if>
- <if test="deviceMeasuringPoint.createDate!=null">#{deviceMeasuringPoint.createDate,jdbcType=TIMESTAMP},
- </if>
- <if test="deviceMeasuringPoint.createBy!=null">#{deviceMeasuringPoint.createBy,jdbcType=VARCHAR},
- </if>
- <if test="deviceMeasuringPoint.updateDate!=null">#{deviceMeasuringPoint.updateDate,jdbcType=TIMESTAMP},
- </if>
- <if test="deviceMeasuringPoint.updateBy!=null">#{deviceMeasuringPoint.updateBy,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <!--auto generated Code-->
- <insert id="insertList">
- INSERT INTO sc_device_measuring_point (
- id,
- measuring_point_name,
- code_name,
- data_unit,
- measuring_point_type,
- status,
- create_date,
- create_by,
- update_date,
- update_by
- )VALUES
- <foreach collection="deviceMeasuringPoints" item="deviceMeasuringPoint" index="index" separator=",">
- (
- #{deviceMeasuringPoint.id,jdbcType=INTEGER},
- #{deviceMeasuringPoint.measuringPointName,jdbcType=VARCHAR},
- #{deviceMeasuringPoint.codeName,jdbcType=VARCHAR},
- #{deviceMeasuringPoint.dataUnit,jdbcType=VARCHAR},
- #{deviceMeasuringPoint.measuringPointType,jdbcType=INTEGER},
- #{deviceMeasuringPoint.status,jdbcType=INTEGER},
- #{deviceMeasuringPoint.createDate,jdbcType=TIMESTAMP},
- #{deviceMeasuringPoint.createBy,jdbcType=VARCHAR},
- #{deviceMeasuringPoint.updateDate,jdbcType=TIMESTAMP},
- #{deviceMeasuringPoint.updateBy,jdbcType=VARCHAR}
- )
- </foreach>
- </insert>
- <!--auto generated Code-->
- <update id="updateByPrimaryKeySelective">
- UPDATE sc_device_measuring_point
- <set>
- <if test="deviceMeasuringPoint.measuringPointName != null"> measuring_point_name= #{deviceMeasuringPoint.measuringPointName,jdbcType=VARCHAR},</if>
- <if test="deviceMeasuringPoint.codeName != null"> code_name= #{deviceMeasuringPoint.codeName,jdbcType=VARCHAR},</if>
- <if test="deviceMeasuringPoint.dataUnit != null"> data_unit= #{deviceMeasuringPoint.dataUnit,jdbcType=VARCHAR},</if>
- <if test="deviceMeasuringPoint.measuringPointType != null"> measuring_point_type= #{deviceMeasuringPoint.measuringPointType,jdbcType=INTEGER},</if>
- <if test="deviceMeasuringPoint.status != null"> status= #{deviceMeasuringPoint.status,jdbcType=INTEGER},</if>
- <if test="deviceMeasuringPoint.createDate != null"> create_date= #{deviceMeasuringPoint.createDate,jdbcType=TIMESTAMP},</if>
- <if test="deviceMeasuringPoint.createBy != null"> create_by= #{deviceMeasuringPoint.createBy,jdbcType=VARCHAR},</if>
- <if test="deviceMeasuringPoint.updateDate != null"> update_date= #{deviceMeasuringPoint.updateDate,jdbcType=TIMESTAMP},</if>
- <if test="deviceMeasuringPoint.updateBy != null"> update_by= #{deviceMeasuringPoint.updateBy,jdbcType=VARCHAR}</if>
- </set>
- WHERE id = #{deviceMeasuringPoint.id,jdbcType=INTEGER}
- </update>
- <select id="findByDeviceTypeId" resultMap="BaseResultMap">
- SELECT
- measuring_id as id,
- measuring_code as code_name ,
- measuring_unit as data_unit,
- measuring_name as measuring_point_name
- FROM
- sc_tpl_measuring_desc
- WHERE
- device_type = #{deviceTypeId}
- AND `status` = 1
- </select>
- <select id="findByCodeAndName" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from
- sc_device_measuring_point
- where status = 1
- and measuring_point_name = #{name}
- and code_name = #{code}
- </select>
-
- </mapper>
|