|
@@ -0,0 +1,233 @@
|
|
|
|
+<?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.ruoyi.system.mapper.TaskResultMapper">
|
|
|
|
+
|
|
|
|
+ <resultMap type="com.ruoyi.system.domain.TaskResult" id="TaskResultMap">
|
|
|
|
+ <result property="resultId" column="result_id" jdbcType="INTEGER"/>
|
|
|
|
+ <result property="id" column="id" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="type" column="type" jdbcType="INTEGER"/>
|
|
|
|
+ <result property="taskid" column="taskid" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="starttime" column="starttime" jdbcType="TIMESTAMP"/>
|
|
|
|
+ <result property="endtime" column="endtime" jdbcType="TIMESTAMP"/>
|
|
|
|
+ <result property="width" column="width" jdbcType="NUMERIC"/>
|
|
|
|
+ <result property="planid" column="planid" jdbcType="INTEGER"/>
|
|
|
|
+ <result property="acreagesum" column="acreagesum" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="flowsum" column="flowsum" jdbcType="NUMERIC"/>
|
|
|
|
+ <result property="positions" column="positions" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="elevations" column="elevations" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="acreages" column="acreages" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="waterlevels" column="waterlevels" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="wspeeds" column="wspeeds" jdbcType="NUMERIC"/>
|
|
|
|
+ <result property="flows" column="flows" jdbcType="VARCHAR"/>
|
|
|
|
+ <result property="siteId" column="site_id" jdbcType="INTEGER"/>
|
|
|
|
+ <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
|
+ <result property="status" column="status" jdbcType="INTEGER"/>
|
|
|
|
+ </resultMap>
|
|
|
|
+
|
|
|
|
+ <!--查询单个-->
|
|
|
|
+ <select id="queryById" resultMap="TaskResultMap">
|
|
|
|
+ select
|
|
|
|
+ result_id, id, type, taskid, starttime, endtime, width, planid, acreagesum, flowsum, positions, elevations, acreages, waterlevels, wspeeds, flows, site_id, create_time, status
|
|
|
|
+ from task_result
|
|
|
|
+ where result_id = #{resultId}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <!--查询单个-->
|
|
|
|
+ <select id="queryBySiteIdOne" resultMap="TaskResultMap">
|
|
|
|
+ select
|
|
|
|
+ result_id, id, type, taskid, starttime, endtime, width, planid, acreagesum, flowsum, positions, elevations, acreages, waterlevels, wspeeds, flows, site_id, create_time, status
|
|
|
|
+ from task_result
|
|
|
|
+ where site_id = #{siteId}
|
|
|
|
+ order by create_time desc
|
|
|
|
+ limit 1
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!--查询指定行数据-->
|
|
|
|
+ <select id="queryAllByLimit" resultMap="TaskResultMap">
|
|
|
|
+ select
|
|
|
|
+ result_id, id, type, taskid, starttime, endtime, width, planid, acreagesum, flowsum, positions, elevations, acreages, waterlevels, wspeeds, flows, site_id, create_time, status
|
|
|
|
+ from task_result
|
|
|
|
+ <where>
|
|
|
|
+ <if test="achievementQuery.siteId != null">
|
|
|
|
+ and site_id = #{achievementQuery.siteId}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ order by create_time desc
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!--统计总行数-->
|
|
|
|
+ <select id="count" resultType="java.lang.Long">
|
|
|
|
+ select count(1)
|
|
|
|
+ from task_result
|
|
|
|
+ <where>
|
|
|
|
+ <if test="resultId != null">
|
|
|
|
+ and result_id = #{resultId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="id != null and id != ''">
|
|
|
|
+ and id = #{id}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="type != null">
|
|
|
|
+ and type = #{type}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="taskid != null and taskid != ''">
|
|
|
|
+ and taskid = #{taskid}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="starttime != null">
|
|
|
|
+ and starttime = #{starttime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endtime != null">
|
|
|
|
+ and endtime = #{endtime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="width != null">
|
|
|
|
+ and width = #{width}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="planid != null">
|
|
|
|
+ and planid = #{planid}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="acreagesum != null and acreagesum != ''">
|
|
|
|
+ and acreagesum = #{acreagesum}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="flowsum != null">
|
|
|
|
+ and flowsum = #{flowsum}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="positions != null and positions != ''">
|
|
|
|
+ and positions = #{positions}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="elevations != null and elevations != ''">
|
|
|
|
+ and elevations = #{elevations}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="acreages != null and acreages != ''">
|
|
|
|
+ and acreages = #{acreages}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="waterlevels != null and waterlevels != ''">
|
|
|
|
+ and waterlevels = #{waterlevels}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="wspeeds != null">
|
|
|
|
+ and wspeeds = #{wspeeds}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="flows != null and flows != ''">
|
|
|
|
+ and flows = #{flows}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="siteId != null">
|
|
|
|
+ and site_id = #{siteId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
+ and create_time = #{createTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="status != null">
|
|
|
|
+ and status = #{status}
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!--新增所有列-->
|
|
|
|
+ <insert id="insert" keyProperty="resultId" useGeneratedKeys="true">
|
|
|
|
+ insert into task_result(id, type, taskid, starttime, endtime, width, planid, acreagesum, flowsum, positions, elevations, acreages, waterlevels, wspeeds, flows, site_id, create_time, status)
|
|
|
|
+ values (#{id}, #{type}, #{taskid}, #{starttime}, #{endtime}, #{width}, #{planid}, #{acreagesum}, #{flowsum}, #{positions}, #{elevations}, #{acreages}, #{waterlevels}, #{wspeeds}, #{flows}, #{siteId}, #{createTime}, #{status})
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <insert id="insertBatch" keyProperty="resultId" useGeneratedKeys="true">
|
|
|
|
+ insert into task_result(id, type, taskid, starttime, endtime, width, planid, acreagesum, flowsum, positions, elevations, acreages, waterlevels, wspeeds, flows, site_id, create_time, status)
|
|
|
|
+ values
|
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
|
+ (#{entity.id}, #{entity.type}, #{entity.taskid}, #{entity.starttime}, #{entity.endtime}, #{entity.width}, #{entity.planid}, #{entity.acreagesum}, #{entity.flowsum}, #{entity.positions}, #{entity.elevations}, #{entity.acreages}, #{entity.waterlevels}, #{entity.wspeeds}, #{entity.flows}, #{entity.siteId}, #{entity.createTime}, #{entity.status})
|
|
|
|
+ </foreach>
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <insert id="insertOrUpdateBatch" keyProperty="resultId" useGeneratedKeys="true">
|
|
|
|
+ insert into task_result(id, type, taskid, starttime, endtime, width, planid, acreagesum, flowsum, positions, elevations, acreages, waterlevels, wspeeds, flows, site_id, create_time, status)
|
|
|
|
+ values
|
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
|
+ (#{entity.id}, #{entity.type}, #{entity.taskid}, #{entity.starttime}, #{entity.endtime}, #{entity.width}, #{entity.planid}, #{entity.acreagesum}, #{entity.flowsum}, #{entity.positions}, #{entity.elevations}, #{entity.acreages}, #{entity.waterlevels}, #{entity.wspeeds}, #{entity.flows}, #{entity.siteId}, #{entity.createTime}, #{entity.status})
|
|
|
|
+ </foreach>
|
|
|
|
+ on duplicate key update
|
|
|
|
+id = values(id),
|
|
|
|
+type = values(type),
|
|
|
|
+taskid = values(taskid),
|
|
|
|
+starttime = values(starttime),
|
|
|
|
+endtime = values(endtime),
|
|
|
|
+width = values(width),
|
|
|
|
+planid = values(planid),
|
|
|
|
+acreagesum = values(acreagesum),
|
|
|
|
+flowsum = values(flowsum),
|
|
|
|
+positions = values(positions),
|
|
|
|
+elevations = values(elevations),
|
|
|
|
+acreages = values(acreages),
|
|
|
|
+waterlevels = values(waterlevels),
|
|
|
|
+wspeeds = values(wspeeds),
|
|
|
|
+flows = values(flows),
|
|
|
|
+site_id = values(site_id),
|
|
|
|
+create_time = values(create_time),
|
|
|
|
+status = values(status)
|
|
|
|
+ </insert>
|
|
|
|
+
|
|
|
|
+ <!--通过主键修改数据-->
|
|
|
|
+ <update id="update">
|
|
|
|
+ update task_result
|
|
|
|
+ <set>
|
|
|
|
+ <if test="id != null and id != ''">
|
|
|
|
+ id = #{id},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="type != null">
|
|
|
|
+ type = #{type},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="taskid != null and taskid != ''">
|
|
|
|
+ taskid = #{taskid},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="starttime != null">
|
|
|
|
+ starttime = #{starttime},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endtime != null">
|
|
|
|
+ endtime = #{endtime},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="width != null">
|
|
|
|
+ width = #{width},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="planid != null">
|
|
|
|
+ planid = #{planid},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="acreagesum != null and acreagesum != ''">
|
|
|
|
+ acreagesum = #{acreagesum},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="flowsum != null">
|
|
|
|
+ flowsum = #{flowsum},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="positions != null and positions != ''">
|
|
|
|
+ positions = #{positions},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="elevations != null and elevations != ''">
|
|
|
|
+ elevations = #{elevations},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="acreages != null and acreages != ''">
|
|
|
|
+ acreages = #{acreages},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="waterlevels != null and waterlevels != ''">
|
|
|
|
+ waterlevels = #{waterlevels},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="wspeeds != null">
|
|
|
|
+ wspeeds = #{wspeeds},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="flows != null and flows != ''">
|
|
|
|
+ flows = #{flows},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="siteId != null">
|
|
|
|
+ site_id = #{siteId},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="createTime != null">
|
|
|
|
+ create_time = #{createTime},
|
|
|
|
+ </if>
|
|
|
|
+ <if test="status != null">
|
|
|
|
+ status = #{status},
|
|
|
|
+ </if>
|
|
|
|
+ </set>
|
|
|
|
+ where result_id = #{resultId}
|
|
|
|
+ </update>
|
|
|
|
+
|
|
|
|
+ <!--通过主键删除-->
|
|
|
|
+ <delete id="deleteById">
|
|
|
|
+ delete from task_result where result_id = #{resultId}
|
|
|
|
+ </delete>
|
|
|
|
+
|
|
|
|
+</mapper>
|
|
|
|
+
|