You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
I2client/src/main/resources/mappers/Data_Jsyhw_JyjcDao.xml

79 lines
3.1 KiB
XML

2 years ago
<?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.shxy.i2.dao.Data_Jsyhw_JyjcDao">
<resultMap id="BaseResultMap" type="com.shxy.i2.entity.Data_Jsyhw_Jyjc">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="eqmid" jdbcType="INTEGER" property="eqmid"/>
<result column="acquisitionTime" jdbcType="TIMESTAMP" property="acquisitiontime"/>
<result column="systemVoltage" jdbcType="REAL" property="systemvoltage"/>
<result column="totalCurrent" jdbcType="REAL" property="totalcurrent"/>
<result column="resistiveCurrent" jdbcType="REAL" property="resistivecurrent"/>
<result column="actionCount" jdbcType="REAL" property="actioncount"/>
<result column="lastActionTime" jdbcType="TIMESTAMP" property="lastactiontime"/>
<result column="isupload" jdbcType="INTEGER" property="isupload"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<sql id="Base_Column_List">
id, eqmid, acquisitionTime, systemVoltage, totalCurrent, resistiveCurrent, actionCount,
lastActionTime, isupload, create_time, update_time
</sql>
1 year ago
<select id="selectUploadById" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_jsyhw_jyjc
where id <![CDATA[>]]> #{maxid}
</select>
2 years ago
<select id="selectUpload" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from data_jsyhw_jyjc
where isupload is null or isupload = #{isupload} order by id desc limit 1
</select>
<update id="updateByPrimaryKey" parameterType="com.shxy.i2.entity.Data_Jsyhw_Jyjc">
update data_jsyhw_jyjc
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id <![CDATA[<=]]> #{maxid}
<if test="idlist = null and idlist.size > 0">
and id not in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</if>
</update>
<update id="updateList">
update data_jsyhw_jyjc
<set>
<if test="isupload != null">
isupload = #{isupload,jdbcType=INTEGER},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where
id in
<foreach collection="idlist" item="id" index="index" separator="," open="(" close=")">
#{id}
</foreach>
</update>
<delete id="deleteData" >
delete
from data_jsyhw_jyjc
where acquisitionTime <![CDATA[<]]> #{time}
</delete>
2 years ago
</mapper>