欣影管理平台线路和装置接口完善

jni
liuguijing 2 years ago
parent 4c8c44ae18
commit 6a7577b646

@ -0,0 +1,21 @@
package com.shxy.xymanager_common.entity;
import lombok.Data;
import java.io.Serializable;
@Data
public class Lines implements Serializable {
private Integer id;
private String name;
private String bsManufacturer;
private Byte dyLevel;
private Integer status;
private static final long serialVersionUID = 1L;
}

@ -0,0 +1,25 @@
package com.shxy.xymanager_dao.dao;
import com.shxy.xymanager_common.dto.LineAndTerminalDto;
import com.shxy.xymanager_common.entity.Lines;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
public interface LinesDao {
List<Lines> selectAll(@Param("status") Integer status);
List<LineAndTerminalDto> selectLineAndTerminalList(@Param("status") Integer status);
int insertList(@Param("list") List<Lines> record,@Param("status") Integer status,@Param("createat") Date create,@Param("updateat") Date update);
int deleteById(@Param("list") List<Lines> record, @Param("status") Integer status,@Param("updateat") Date update);
Lines selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(@Param("data") Lines record, @Param("updateat") Date update);
int updateByPrimaryKey(Lines record);
}

@ -0,0 +1,104 @@
<?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.xymanager_dao.dao.LinesDao">
<resultMap id="BaseResultMap" type="com.shxy.xymanager_common.entity.Lines">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="bs_manufacturer" jdbcType="VARCHAR" property="bsManufacturer"/>
<result column="dy_level" jdbcType="TINYINT" property="dyLevel"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<resultMap id="LineAndTerminalMap" type="com.shxy.xymanager_common.dto.LineAndTerminalDto">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="bs_manufacturer" jdbcType="VARCHAR" property="bsManufacturer"/>
<result column="dy_level" jdbcType="TINYINT" property="dyLevel"/>
<collection property="itemList" javaType="list" ofType="com.shxy.xymanager_common.entity.Terminals">
<result column="tower_id" jdbcType="INTEGER" property="towerid"/>
<result column="cmdid" jdbcType="VARCHAR" property="cmdid"/>
<result column="equip_name" jdbcType="VARCHAR" property="equipName"/>
<result column="display_name" jdbcType="VARCHAR" property="displayName"/>
<result column="model" jdbcType="VARCHAR" property="model"/>
</collection>
</resultMap>
<sql id="Base_Column_List">
id, name, bs_manufacturer, dy_level
</sql>
<select id="selectAll" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from `lines`
where status = #{status}
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from `lines`
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectLineAndTerminalList" resultMap="LineAndTerminalMap">
select x.id as id,
x.name as name,
x.bs_manufacturer as bs_manufacturer,
x.dy_level as dy_level,
y.tower_id as tower_id,
y.cmdid as cmdid,
y.equip_name as equip_name,
y.display_name as display_name,
y.model as model
from `lines` x,
terminals y
where x.id = y.line_id and x.status = #{status}
</select>
<insert id="insertList" parameterType="java.util.List">
insert into `lines`
(name,bs_manufacturer,dy_level,status,create_time,update_time)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.name},#{item.bsManufacturer},#{item.dyLevel},#{status},#{createat},#{updateat})
</foreach>
</insert>
<update id="deleteById">
update `lines`
set status = #{status},
update_time = #{updateat}
where id in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item.id}
</foreach>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.shxy.xymanager_common.entity.Lines">
update `lines`
<set>
<if test="data.name != null">
name = #{data.name,jdbcType=VARCHAR},
</if>
<if test="data.bsManufacturer != null">
bs_manufacturer = #{data.bsManufacturer,jdbcType=VARCHAR},
</if>
<if test="data.dyLevel != null">
dy_level = #{data.dyLevel,jdbcType=TINYINT},
</if>
<if test="updateat != null">
update_time = #{updateat,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.shxy.xymanager_common.entity.Lines">
update `lines`
set name = #{name,jdbcType=VARCHAR},
bs_manufacturer = #{bsManufacturer,jdbcType=VARCHAR},
dy_level = #{dyLevel,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
Loading…
Cancel
Save