jhprjv2/yanzhu-jh/src/main/resources/mapper/device/PitmonitSouthsmosDataMapper...

151 lines
8.4 KiB
XML

<?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.yanzhu.jh.device.mapper.PitmonitSouthsmosDataMapper">
<resultMap type="DevPitmonitSouthsmosData" id="DevPitmonitSouthsmosDataResult">
<result property="id" column="id" />
<result property="cfgId" column="cfgId" />
<result property="dataType" column="dataType" />
<result property="dataId" column="dataId" />
<result property="spId" column="spId" />
<result property="spName" column="spName" />
<result property="collectTime" column="collectTime" />
<result property="changeRate" column="changeRate" />
<result property="changeRate2" column="changeRate2" />
<result property="displace" column="displace" />
<result property="displace2" column="displace2" />
<result property="totalize" column="totalize" />
<result property="totalize2" column="totalize2" />
<result property="variation" column="variation" />
<result property="variation2" column="variation2" />
<result property="state" column="state" />
<result property="remark" column="remark" />
<result property="isDel" column="is_del" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDevPitmonitSouthsmosDataVo">
select id, cfgId, dataType, dataId, spId, spName, collectTime, changeRate, changeRate2, displace, displace2, totalize, totalize2, variation, variation2, state, remark, is_del, create_by, create_time, update_by, update_time from dev_pitmonit_southsmos_data
</sql>
<select id="selectDevPitmonitSouthsmosDataList" parameterType="PitmonitSouthsmosData" resultMap="DevPitmonitSouthsmosDataResult">
<include refid="selectDevPitmonitSouthsmosDataVo"/>
<where>
<if test="cfgId != null "> and cfgId = #{cfgId}</if>
<if test="dataType != null and dataType != ''"> and dataType = #{dataType}</if>
<if test="dataId != null "> and dataId = #{dataId}</if>
<if test="spId != null "> and spId = #{spId}</if>
<if test="spName != null and spName != ''"> and spName like concat('%', #{spName}, '%')</if>
<if test="collectTime != null "> and collectTime = #{collectTime}</if>
<if test="changeRate != null "> and changeRate = #{changeRate}</if>
<if test="changeRate2 != null "> and changeRate2 = #{changeRate2}</if>
<if test="displace != null "> and displace = #{displace}</if>
<if test="displace2 != null "> and displace2 = #{displace2}</if>
<if test="totalize != null "> and totalize = #{totalize}</if>
<if test="totalize2 != null "> and totalize2 = #{totalize2}</if>
<if test="variation != null "> and variation = #{variation}</if>
<if test="variation2 != null "> and variation2 = #{variation2}</if>
<if test="state != null "> and state = #{state}</if>
<if test="isDel != null "> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectDevPitmonitSouthsmosDataById" parameterType="Long" resultMap="DevPitmonitSouthsmosDataResult">
<include refid="selectDevPitmonitSouthsmosDataVo"/>
where id = #{id}
</select>
<insert id="insertDevPitmonitSouthsmosData" parameterType="DevPitmonitSouthsmosData" useGeneratedKeys="true" keyProperty="id">
insert into dev_pitmonit_southsmos_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="cfgId != null">cfgId,</if>
<if test="dataType != null">dataType,</if>
<if test="dataId != null">dataId,</if>
<if test="spId != null">spId,</if>
<if test="spName != null">spName,</if>
<if test="collectTime != null">collectTime,</if>
<if test="changeRate != null">changeRate,</if>
<if test="changeRate2 != null">changeRate2,</if>
<if test="displace != null">displace,</if>
<if test="displace2 != null">displace2,</if>
<if test="totalize != null">totalize,</if>
<if test="totalize2 != null">totalize2,</if>
<if test="variation != null">variation,</if>
<if test="variation2 != null">variation2,</if>
<if test="state != null">state,</if>
<if test="remark != null">remark,</if>
<if test="isDel != null">is_del,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cfgId != null">#{cfgId},</if>
<if test="dataType != null">#{dataType},</if>
<if test="dataId != null">#{dataId},</if>
<if test="spId != null">#{spId},</if>
<if test="spName != null">#{spName},</if>
<if test="collectTime != null">#{collectTime},</if>
<if test="changeRate != null">#{changeRate},</if>
<if test="changeRate2 != null">#{changeRate2},</if>
<if test="displace != null">#{displace},</if>
<if test="displace2 != null">#{displace2},</if>
<if test="totalize != null">#{totalize},</if>
<if test="totalize2 != null">#{totalize2},</if>
<if test="variation != null">#{variation},</if>
<if test="variation2 != null">#{variation2},</if>
<if test="state != null">#{state},</if>
<if test="remark != null">#{remark},</if>
<if test="isDel != null">#{isDel},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDevPitmonitSouthsmosData" parameterType="PitmonitSouthsmosData">
update dev_pitmonit_southsmos_data
<trim prefix="SET" suffixOverrides=",">
<if test="cfgId != null">cfgId = #{cfgId},</if>
<if test="dataType != null">dataType = #{dataType},</if>
<if test="dataId != null">dataId = #{dataId},</if>
<if test="spId != null">spId = #{spId},</if>
<if test="spName != null">spName = #{spName},</if>
<if test="collectTime != null">collectTime = #{collectTime},</if>
<if test="changeRate != null">changeRate = #{changeRate},</if>
<if test="changeRate2 != null">changeRate2 = #{changeRate2},</if>
<if test="displace != null">displace = #{displace},</if>
<if test="displace2 != null">displace2 = #{displace2},</if>
<if test="totalize != null">totalize = #{totalize},</if>
<if test="totalize2 != null">totalize2 = #{totalize2},</if>
<if test="variation != null">variation = #{variation},</if>
<if test="variation2 != null">variation2 = #{variation2},</if>
<if test="state != null">state = #{state},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDevPitmonitSouthsmosDataById" parameterType="Long">
delete from dev_pitmonit_southsmos_data where id = #{id}
</delete>
<delete id="deleteDevPitmonitSouthsmosDataByIds" parameterType="String">
delete from dev_pitmonit_southsmos_data where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>