|
@@ -0,0 +1,154 @@
|
|
|
+<?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.BerthingTimeConfigMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.ruoyi.system.domain.BerthingTimeConfig" id="BerthingTimeConfigMap">
|
|
|
+ <result property="timeId" column="time_id" jdbcType="INTEGER"/>
|
|
|
+ <result property="id" column="id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="siteId" column="site_id" jdbcType="INTEGER"/>
|
|
|
+ <result property="planid" column="planid" jdbcType="INTEGER"/>
|
|
|
+ <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="status" column="status" jdbcType="INTEGER"/>
|
|
|
+ <result property="isDel" column="is_del" jdbcType="INTEGER"/>
|
|
|
+ <result property="wlevel" column="wlevel" jdbcType="NUMERIC"/>
|
|
|
+ <result property="times" column="times" jdbcType="VARCHAR"/>
|
|
|
+ <result property="type" column="type" jdbcType="INTEGER"/>
|
|
|
+ <result property="siteName" column="site_name" jdbcType="VARBINARY"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!--查询单个-->
|
|
|
+ <select id="queryById" resultMap="BerthingTimeConfigMap">
|
|
|
+ select
|
|
|
+time_id, id, site_id, planid, create_time, status, is_del, wlevel, times, type
|
|
|
+ from berthing_time_config
|
|
|
+ where time_id = #{timeId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--查询指定行数据-->
|
|
|
+ <select id="queryAllByLimit" resultMap="BerthingTimeConfigMap">
|
|
|
+ select
|
|
|
+ a.time_id, a.id, a.site_id, a.planid, a.create_time, a.status, a.is_del, a.wlevel, a.times, a.type, b.site_name
|
|
|
+ from berthing_time_config as a
|
|
|
+ join site_info as b on a.site_id = b.site_id
|
|
|
+ <where>
|
|
|
+ <if test="timePointQuery.timeId != null">
|
|
|
+ and a.time_id = #{timePointQuery.timeId}
|
|
|
+ </if>
|
|
|
+ <if test="timePointQuery.siteId != null">
|
|
|
+ and a.site_id = #{timePointQuery.siteId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--统计总行数-->
|
|
|
+ <select id="count" resultType="java.lang.Long">
|
|
|
+ select count(1)
|
|
|
+ from berthing_time_config
|
|
|
+ <where>
|
|
|
+ <if test="timeId != null">
|
|
|
+ and time_id = #{timeId}
|
|
|
+ </if>
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="siteId != null">
|
|
|
+ and site_id = #{siteId}
|
|
|
+ </if>
|
|
|
+ <if test="planid != null">
|
|
|
+ and planid = #{planid}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ and status = #{status}
|
|
|
+ </if>
|
|
|
+ <if test="isDel != null">
|
|
|
+ and is_del = #{isDel}
|
|
|
+ </if>
|
|
|
+ <if test="wlevel != null">
|
|
|
+ and wlevel = #{wlevel}
|
|
|
+ </if>
|
|
|
+ <if test="times != null and times != ''">
|
|
|
+ and times = #{times}
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ and type = #{type}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--新增所有列-->
|
|
|
+ <insert id="insert" keyProperty="timeId" useGeneratedKeys="true">
|
|
|
+ insert into berthing_time_config(id, site_id, planid, create_time, status, is_del, wlevel, times, type)
|
|
|
+ values (#{id}, #{siteId}, #{planid}, #{createTime}, #{status}, #{isDel}, #{wlevel}, #{times}, #{type})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertBatch" keyProperty="timeId" useGeneratedKeys="true">
|
|
|
+ insert into berthing_time_config(id, site_id, planid, create_time, status, is_del, wlevel, times, type)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.id}, #{entity.siteId}, #{entity.planid}, #{entity.createTime}, #{entity.status}, #{entity.isDel}, #{entity.wlevel}, #{entity.times}, #{entity.type})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertOrUpdateBatch" keyProperty="timeId" useGeneratedKeys="true">
|
|
|
+ insert into berthing_time_config(id, site_id, planid, create_time, status, is_del, wlevel, times, type)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.id}, #{entity.siteId}, #{entity.planid}, #{entity.createTime}, #{entity.status}, #{entity.isDel}, #{entity.wlevel}, #{entity.times}, #{entity.type})
|
|
|
+ </foreach>
|
|
|
+ on duplicate key update
|
|
|
+id = values(id),
|
|
|
+site_id = values(site_id),
|
|
|
+planid = values(planid),
|
|
|
+create_time = values(create_time),
|
|
|
+status = values(status),
|
|
|
+is_del = values(is_del),
|
|
|
+wlevel = values(wlevel),
|
|
|
+times = values(times),
|
|
|
+type = values(type)
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!--通过主键修改数据-->
|
|
|
+ <update id="update">
|
|
|
+ update berthing_time_config
|
|
|
+ <set>
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ id = #{id},
|
|
|
+ </if>
|
|
|
+ <if test="siteId != null">
|
|
|
+ site_id = #{siteId},
|
|
|
+ </if>
|
|
|
+ <if test="planid != null">
|
|
|
+ planid = #{planid},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ status = #{status},
|
|
|
+ </if>
|
|
|
+ <if test="isDel != null">
|
|
|
+ is_del = #{isDel},
|
|
|
+ </if>
|
|
|
+ <if test="wlevel != null">
|
|
|
+ wlevel = #{wlevel},
|
|
|
+ </if>
|
|
|
+ <if test="times != null and times != ''">
|
|
|
+ times = #{times},
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ type = #{type},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where time_id = #{timeId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!--通过主键删除-->
|
|
|
+ <delete id="deleteById">
|
|
|
+ delete from berthing_time_config where time_id = #{timeId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|
|
|
+
|