123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <?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.zhyc.xps.goaf.mapper.SensorMapMapper">
- <resultMap id="SensorMapMapper" type="com.zhyc.xps.goaf.entity.SensorMap">
- <id column="sensor_location_id" property="sensorLocationId" jdbcType="BIGINT"/>
- <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
- <result column="map_id" property="mapId" jdbcType="BIGINT"/>
- <result column="goaf_sensor_id" property="goafSensorId" jdbcType="BIGINT"/>
- <result column="goaf_sensor_name" property="goafSensorName" jdbcType="VARCHAR"/>
- <result column="sensor_qywzjd" property="sensorQywzjd" jdbcType="DECIMAL"/> <!--传感器部署经度-->
- <result column="sensor_qywzwd" property="sensorQywzwd" jdbcType="DECIMAL"/> <!--传感器部署纬度-->
- </resultMap>
- <select id="getByList" parameterType="java.util.Map" resultMap="SensorMapMapper">
- SELECT *
- FROM sensor_map
- <trim prefix="where" prefixOverrides="AND">
- <if test="ocId !=null">
- oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- <if test="mapId !=null">
- map_id = #{mapId ,jdbcType=BIGINT}
- </if>
- </trim>
- </select>
- <!--分页查询-->
- <select id="getByPage" parameterType="java.util.Map" resultMap="SensorMapMapper">
- SELECT *
- FROM sensor_map
- <trim prefix="where" prefixOverrides="AND">
- <if test="ocId !=null">
- oc_id = #{ocId ,jdbcType=BIGINT}
- </if>
- </trim>
- </select>
-
- <insert id="create" parameterType="com.zhyc.xps.goaf.entity.SensorMap">
- insert into sensor_map
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="sensorLocationId != null">
- sensor_location_id,
- </if>
- <if test="ocId != null">
- oc_id,
- </if>
- <if test="mapId != null">
- map_id,
- </if>
- <if test="goafSensorId != null">
- goaf_sensor_id,
- </if>
- <if test="goafSensorName != null and goafSensorName != ''">
- goaf_sensor_name,
- </if>
- <if test="sensorQywzjd != null">
- sensor_qywzjd,
- </if>
- <if test="sensorQywzwd != null">
- sensor_qywzwd,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="sensorLocationId != null">
- #{sensorLocationId, jdbcType=BIGINT},
- </if>
- <if test="ocId != null">
- #{ocId, jdbcType=BIGINT},
- </if>
- <if test="mapId != null">
- #{mapId, jdbcType=BIGINT},
- </if>
- <if test="goafSensorId != null">
- #{goafSensorId, jdbcType=BIGINT},
- </if>
- <if test="goafSensorName != null and goafSensorName != ''">
- #{goafSensorName, jdbcType=VARCHAR},
- </if>
- <if test="sensorQywzjd != null">
- #{sensorQywzjd, jdbcType=DECIMAL},
- </if>
- <if test="sensorQywzwd != null">
- #{sensorQywzwd, jdbcType=DECIMAL},
- </if>
- </trim>
- </insert>
- <!--Update更新-->
- <update id="update" parameterType="com.zhyc.xps.goaf.entity.SensorMap">
- UPDATE sensor_map
- <trim suffixOverrides=",">
- <set>
- <if test="sensorQywzjd != null">
- sensor_qywzjd = #{sensorQywzjd, jdbcType=DECIMAL},
- </if>
- <if test="sensorQywzwd != null">
- sensor_qywzwd = #{sensorQywzwd, jdbcType=DECIMAL},
- </if>
- </set>
- </trim>
- WHERE sensor_location_id = #{sensorLocationId, jdbcType=BIGINT}
- </update>
- <delete id="delete" >
- DELETE FROM sensor_map
- WHERE sensor_location_id = #{sensorLocationId, jdbcType=BIGINT}
- </delete>
- </mapper>
|