|
@@ -0,0 +1,166 @@
|
|
|
+<?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.BerthingPointMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.ruoyi.system.domain.BerthingPoint" id="BerthingPointMap">
|
|
|
+ <result property="berthingId" column="berthing_id" jdbcType="INTEGER"/>
|
|
|
+ <result property="id" column="id" jdbcType="VARCHAR"/>
|
|
|
+ <result property="siteId" column="site_id" jdbcType="INTEGER"/>
|
|
|
+ <result property="berthingName" column="berthing_name" jdbcType="VARCHAR"/>
|
|
|
+ <result property="positions" column="positions" jdbcType="VARCHAR"/>
|
|
|
+ <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="factors" column="factors" jdbcType="VARCHAR"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!--查询单个-->
|
|
|
+ <select id="queryById" resultMap="BerthingPointMap">
|
|
|
+ select
|
|
|
+berthing_id, id, site_id, berthing_name, positions, create_time, status, is_del, factors
|
|
|
+ from berthing_point
|
|
|
+ where berthing_id = #{berthingId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--查询指定行数据-->
|
|
|
+ <select id="queryAllByLimit" resultMap="BerthingPointMap">
|
|
|
+ select
|
|
|
+berthing_id, id, site_id, berthing_name, positions, create_time, status, is_del, factors
|
|
|
+ from berthing_point
|
|
|
+ <where>
|
|
|
+ <if test="berthingId != null">
|
|
|
+ and berthing_id = #{berthingId}
|
|
|
+ </if>
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="siteId != null">
|
|
|
+ and site_id = #{siteId}
|
|
|
+ </if>
|
|
|
+ <if test="berthingName != null and berthingName != ''">
|
|
|
+ and berthing_name = #{berthingName}
|
|
|
+ </if>
|
|
|
+ <if test="positions != null and positions != ''">
|
|
|
+ and positions = #{positions}
|
|
|
+ </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="factors != null and factors != ''">
|
|
|
+ and factors = #{factors}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ limit #{pageable.offset}, #{pageable.pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--统计总行数-->
|
|
|
+ <select id="count" resultType="java.lang.Long">
|
|
|
+ select count(1)
|
|
|
+ from berthing_point
|
|
|
+ <where>
|
|
|
+ <if test="berthingId != null">
|
|
|
+ and berthing_id = #{berthingId}
|
|
|
+ </if>
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="siteId != null">
|
|
|
+ and site_id = #{siteId}
|
|
|
+ </if>
|
|
|
+ <if test="berthingName != null and berthingName != ''">
|
|
|
+ and berthing_name = #{berthingName}
|
|
|
+ </if>
|
|
|
+ <if test="positions != null and positions != ''">
|
|
|
+ and positions = #{positions}
|
|
|
+ </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="factors != null and factors != ''">
|
|
|
+ and factors = #{factors}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--新增所有列-->
|
|
|
+ <insert id="insert" keyProperty="berthingId" useGeneratedKeys="true">
|
|
|
+ insert into berthing_point(id, site_id, berthing_name, positions, create_time, status, is_del, factors)
|
|
|
+ values (#{id}, #{siteId}, #{berthingName}, #{positions}, #{createTime}, #{status}, #{isDel}, #{factors})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertBatch" keyProperty="berthingId" useGeneratedKeys="true">
|
|
|
+ insert into berthing_point(id, site_id, berthing_name, positions, create_time, status, is_del, factors)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.id}, #{entity.siteId}, #{entity.berthingName}, #{entity.positions}, #{entity.createTime}, #{entity.status}, #{entity.isDel}, #{entity.factors})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertOrUpdateBatch" keyProperty="berthingId" useGeneratedKeys="true">
|
|
|
+ insert into berthing_point(id, site_id, berthing_name, positions, create_time, status, is_del, factors)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.id}, #{entity.siteId}, #{entity.berthingName}, #{entity.positions}, #{entity.createTime}, #{entity.status}, #{entity.isDel}, #{entity.factors})
|
|
|
+ </foreach>
|
|
|
+ on duplicate key update
|
|
|
+id = values(id),
|
|
|
+site_id = values(site_id),
|
|
|
+berthing_name = values(berthing_name),
|
|
|
+positions = values(positions),
|
|
|
+create_time = values(create_time),
|
|
|
+status = values(status),
|
|
|
+is_del = values(is_del),
|
|
|
+factors = values(factors)
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!--通过主键修改数据-->
|
|
|
+ <update id="update">
|
|
|
+ update berthing_point
|
|
|
+ <set>
|
|
|
+ <if test="id != null and id != ''">
|
|
|
+ id = #{id},
|
|
|
+ </if>
|
|
|
+ <if test="siteId != null">
|
|
|
+ site_id = #{siteId},
|
|
|
+ </if>
|
|
|
+ <if test="berthingName != null and berthingName != ''">
|
|
|
+ berthing_name = #{berthingName},
|
|
|
+ </if>
|
|
|
+ <if test="positions != null and positions != ''">
|
|
|
+ positions = #{positions},
|
|
|
+ </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="factors != null and factors != ''">
|
|
|
+ factors = #{factors},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where berthing_id = #{berthingId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!--通过主键删除-->
|
|
|
+ <delete id="deleteById">
|
|
|
+ delete from berthing_point where berthing_id = #{berthingId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|
|
|
+
|