123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- <?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.BerthingPointConfigMapper">
- <resultMap type="com.ruoyi.system.domain.BerthingPointConfig" id="BerthingPointConfigMap">
- <result property="stopId" column="stop_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="berthingId" column="berthing_id" jdbcType="INTEGER"/>
- <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="wlevel" column="wlevel" jdbcType="NUMERIC"/>
- <result property="factors" column="factors" jdbcType="VARCHAR"/>
- <result property="siteName" column="site_name" jdbcType="VARBINARY"/>
- </resultMap>
- <!--查询单个-->
- <select id="queryById" resultMap="BerthingPointConfigMap">
- select
- stop_id, id, site_id, planid, berthing_id, positions, create_time, status, is_del, wlevel, factors
- from berthing_point_config
- where stop_id = #{stopId}
- </select>
- <!--查询单个-->
- <select id="queryByPlanid" resultMap="BerthingPointConfigMap">
- select
- stop_id, id, site_id, planid, berthing_id, positions, create_time, status, is_del, wlevel, factors
- from berthing_point_config
- where site_id = #{siteId} and planid = #{planid} and is_del = 0
- </select>
- <!--查询单个-->
- <select id="queryMaxPlanid" resultMap="BerthingPointConfigMap">
- select
- MAX(planid) as planid
- from berthing_point_config
- where site_id = #{siteId} and is_del = 0
- </select>
- <!--查询指定行数据-->
- <select id="queryAllByLimit" resultMap="BerthingPointConfigMap">
- select
- a.stop_id, a.id, a.site_id, a.planid, a.berthing_id, a.positions, a.create_time, a.status, a.is_del, a.wlevel, a.factors, b.site_name
- from berthing_point_config as a
- join site_info as b on a.site_id = b.site_id
- <where>
- <if test="stopPointQuery.stopId != null">
- and a.stop_id = #{stopPointQuery.stopId}
- </if>
- <if test="stopPointQuery.siteId != null">
- and a.site_id = #{stopPointQuery.siteId}
- </if>
- and a.is_del = 0
- </where>
- order by a.wlevel desc
- </select>
- <!--统计总行数-->
- <select id="count" resultType="java.lang.Long">
- select count(1)
- from berthing_point_config
- <where>
- <if test="stopId != null">
- and stop_id = #{stopId}
- </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="berthingId != null">
- and berthing_id = #{berthingId}
- </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="wlevel != null">
- and ROUND(wlevel,2) = #{wlevel}
- </if>
- <if test="factors != null and factors != ''">
- and factors = #{factors}
- </if>
- and is_del = 0
- </where>
- </select>
- <!--新增所有列-->
- <insert id="insert" keyProperty="stopId" useGeneratedKeys="true">
- insert into berthing_point_config (id, site_id, planid, berthing_id, positions, create_time, status, is_del, wlevel, factors)
- values (#{id}, #{siteId}, #{planid}, #{berthingId}, #{positions}, #{createTime}, #{status}, #{isDel}, #{wlevel}, #{factors})
- </insert>
- <insert id="insertBatch" keyProperty="stopId" useGeneratedKeys="true">
- insert into berthing_point_config(id, site_id, planid, berthing_id, positions, create_time, status, is_del, wlevel, factors)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.id}, #{entity.siteId}, #{entity.planid}, #{entity.berthingId}, #{entity.positions}, #{entity.createTime}, #{entity.status}, #{entity.isDel}, #{entity.wlevel}, #{entity.factors})
- </foreach>
- </insert>
- <insert id="insertOrUpdateBatch" keyProperty="stopId" useGeneratedKeys="true">
- insert into berthing_point_config(id, site_id, planid, berthing_id, positions, create_time, status, is_del, wlevel, factors)
- values
- <foreach collection="entities" item="entity" separator=",">
- (#{entity.id}, #{entity.siteId}, #{entity.planid}, #{entity.berthingId}, #{entity.positions}, #{entity.createTime}, #{entity.status}, #{entity.isDel}, #{entity.wlevel}, #{entity.factors})
- </foreach>
- on duplicate key update
- id = values(id),
- site_id = values(site_id),
- planid = values(planid),
- berthing_id = values(berthing_id),
- positions = values(positions),
- create_time = values(create_time),
- status = values(status),
- is_del = values(is_del),
- wlevel = values(wlevel),
- factors = values(factors)
- </insert>
- <!--通过主键修改数据-->
- <update id="update">
- update berthing_point_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="berthingId != null">
- berthing_id = #{berthingId},
- </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="wlevel != null">
- wlevel = #{wlevel},
- </if>
- <if test="factors != null and factors != ''">
- factors = #{factors},
- </if>
- </set>
- where stop_id = #{stopId}
- </update>
- <!--通过主键删除-->
- <update id="deleteById">
- update berthing_point_config set is_del = 1 where stop_id = #{stopId}
- </update>
- </mapper>
|