whycxzp
2021-12-25 38f167e7adbe060cfaa234a618ba56d374edef36
在线监测-历史数据管理
8个文件已添加
7个文件已修改
645 ■■■■ 已修改文件
src/main/java/com/whyc/constant/BattTestEnum.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/BaoJiGroupBattGroupController.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/BattInfController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/BattTestDataInf2Controller.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/PermitGroupUserController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/dto/BattTestDataCalcDTO.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/dto/BattTestDataDTO.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/BaoJiGroupBattGroupMapper.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/mapper/BattTestDataInf2Mapper.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/pojo/BattResDataInf.java 158 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BaoJiGroupBattGroupService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/service/BattTestDataInf2Service.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BaojiGroupBattGroupMapper.xml 246 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BattGroupStationUserMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BattTestDataInf2Mapper.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/constant/BattTestEnum.java
New file
@@ -0,0 +1,59 @@
package com.whyc.constant;
public enum BattTestEnum {
    /**电池测试类型*/
    TEST_TYPE_FLOAT("浮充",1),
    TEST_TYPE_CHARGE("充电",2),
    TEST_TYPE_DISCHARGE("放电",3),
    TEST_TYPE_JUN_CHARGE("均充",4),
    TEST_TYPE_RES("电阻测试",5),
    TEST_TYPE_SER("电导测试",6),
    TEST_TYPE_TEMP("温度测试",7),
    TEST_TYPE_CONN_RES("连接条测试",8),
    TEST_TYPE_MONITOR("在线监测",9),
    /**电池状态类型*/
    STATE_TYPE_FLOAT("浮充",1),
    STATE_TYPE_CHARGE("充电",2),
    STATE_TYPE_DISCHARGE("放电",3),
    STATE_TYPE_JUN_CHARGE("均充",4),
    /**电池测试负载类型*/
    TEST_LOADER_REAL_LOADER("实际负载",1),
    TEST_LOADER_FBI_IDCE("FBI IDCE负载",2),
    TEST_LOADER_FBS9100S("9100负载",3),
    /**放电计划状态*/
    DISCHARGE_PLAN_0("未放电",0),
    DISCHARGE_PLAN_1("放电延时",1),
    DISCHARGE_PLAN_2("放电完成",2),
    DISCHARGE_PLAN_3("放电进行中",3),
    DISCHARGE_PLAN_4("放电失败",4),
    ;
    private String name;
    private Integer value;
    BattTestEnum(String name, Integer value) {
        this.name = name;
        this.value = value;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Integer getValue() {
        return value;
    }
    public void setValue(Integer value) {
        this.value = value;
    }
}
src/main/java/com/whyc/controller/BaoJiGroupBattGroupController.java
@@ -81,4 +81,22 @@
        }
    }
    @GetMapping("stationInfo")
    @ApiOperation(tags = "在线监测-历史数据管理",value = "机房站点查询",notes = "原接口:User_battgroup_baojigroup_battgroupAction!serchStationNameInGroup")
    public Response getStationInfo(){
        Long uId = ActionUtil.getUser().getUId();
        List<Battinf> stationInfoList = service.getStationInfoList(uId);
        return new Response().set(1,stationInfoList);
    }
    @GetMapping("battGroupList")
    @ApiOperation(tags = "在线监测-历史数据管理",value = "电池组查询")
    public Response<List<Battinf>> getBattGroupList(){
        UserInf userInf = ActionUtil.getUser();
        userInf.setUNote("");
        userInf.setUName("");
        return service.searchBattGroupIdInGroup(userInf);
    }
}
src/main/java/com/whyc/controller/BattInfController.java
@@ -21,7 +21,7 @@
    private BattInfService service;
    @GetMapping("/searchAllStationName1")
    @ApiOperation("查询省")
    @ApiOperation(tags = "在线监测-历史数据管理",value="查询省",notes = "原接口:BattInfAction!serchAllStationName1")
    public Response searchAllStationName1(){
        UserInf userInf = (UserInf) ActionUtil.getUser();
        return service.searchAllStationName1(userInf.getUId().intValue());
src/main/java/com/whyc/controller/BattTestDataInf2Controller.java
New file
@@ -0,0 +1,44 @@
package com.whyc.controller;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.BattTestDataCalcDTO;
import com.whyc.dto.BattTestDataDTO;
import com.whyc.dto.Response;
import com.whyc.pojo.UserInf;
import com.whyc.service.BattTestDataInf2Service;
import com.whyc.util.ActionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("battTestData")
@Api(tags = "在线监测-历史数据管理")
public class BattTestDataInf2Controller {
    @Autowired
    private BattTestDataInf2Service service;
    @PostMapping("calcTestData")
    @ApiOperation(value = "电池组的历史测试数据查询并计算落后单体",notes = "原接口:BattTest_ResAction!serchByCondition")
    public Response<PageInfo<BattTestDataCalcDTO>> calcTestData(@RequestBody BattTestDataDTO paramDto,
                                                                @RequestParam Integer pageNum,
                                                                @RequestParam Integer pageSize){
        PageInfo<BattTestDataCalcDTO> page = service.calcTestData(paramDto,pageNum,pageSize);
        return new Response().set(1,page);
    }
    @GetMapping
    @ApiOperation(value = "维护区查询")
    public Response<List<String>>  getStationName1(){
        UserInf user = ActionUtil.getUser();
        List<String> stationName1List = service.getStationName1(user.getUId());
        return new Response<List<String>>().set(1,stationName1List);
    }
}
src/main/java/com/whyc/controller/PermitGroupUserController.java
@@ -3,7 +3,6 @@
import com.whyc.dto.Response;
import com.whyc.pojo.PermitGroup;
import com.whyc.pojo.PermitGroupUser;
import com.whyc.service.PermitGroupService;
import com.whyc.service.PermitGroupUserService;
import com.whyc.util.ActionUtil;
import io.swagger.annotations.Api;
@@ -11,9 +10,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.swing.*;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("permitGroupUser")
src/main/java/com/whyc/dto/BattTestDataCalcDTO.java
New file
@@ -0,0 +1,29 @@
package com.whyc.dto;
import java.util.Date;
/**
 * 电池组测试数据计算 传输类
 */
public class BattTestDataCalcDTO {
    private String stationName;
    private String battGroupName;
    private Date testTime;
    private Integer testType;
    /**测试电流*/
    private float testCurrent;
    private float testCap;
    /**落后单体数量*/
    private Integer capBehindMonNum;
    /**落后单体编号*/
    private String capBehindMonCode;
    /**落后单体电压*/
    private String capBehindMonVol;
    private float avgVol;
    private Integer lowestMonNum;
    private Integer lowestMonVol;
    private float realCap;
    private float restCap;
    private String capPercent;
}
src/main/java/com/whyc/dto/BattTestDataDTO.java
New file
@@ -0,0 +1,25 @@
package com.whyc.dto;
import java.util.Date;
/**
 * 电池组测试数据 传输类
 */
public class BattTestDataDTO {
    /**省*/
    private String stationName1;
    private Integer stationId;
    private String battGroupName;
    /**
     * 电池测试类型
     */
    private Integer type;
    private Date recordStartTime;
    private Date recordEndTime;
    /**
     * 放电类型
     */
    private Integer dischargeType;
}
src/main/java/com/whyc/mapper/BaoJiGroupBattGroupMapper.java
@@ -29,4 +29,5 @@
    void deleteStationList(List<BaojiGroupBattGroup> baoJiGroupBattGroupList);
    List<Battinf> getStationInfoList(Long uId);
}
src/main/java/com/whyc/mapper/BattTestDataInf2Mapper.java
New file
@@ -0,0 +1,9 @@
package com.whyc.mapper;
import java.util.List;
public interface BattTestDataInf2Mapper {
    public List<String> getStationName1(Long uId);
}
src/main/java/com/whyc/pojo/BattResDataInf.java
New file
@@ -0,0 +1,158 @@
package com.whyc.pojo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.apache.ibatis.type.Alias;
import java.util.Date;
/**
 * 电池电阻/电导数据
 */
@Alias("BattResDataInf")
@TableName(schema = "db_batt_testdata", value = "tb_battresdata_inf")
public class BattResDataInf {
    @TableId
    private Long         num;
    @TableField(value = "BattGroupId")
    private Integer        battGroupId;
    private Integer        testRecordCount;
    private Integer        testRecordCountEx;
    private Integer        testType;
    private Integer        dataNew;
    private Integer        dataAvailable;
    @TableField(value = "test_starttime")
    private Date        testStartTime;
    @TableField(value = "test_starttime_ex")
    private Date        testStartTimeEx;
    @TableField(value = "test_devtype")
    private Integer        testDevType;
    private Date        recordTime;
    private Float        groupVol;
    private Float        testCurr;
    @TableField(value = "upload_usr_id")
    private Integer        uploadUserId;
    private Integer        uploadClientType;
    public Long getNum() {
        return num;
    }
    public void setNum(Long num) {
        this.num = num;
    }
    public Integer getBattGroupId() {
        return battGroupId;
    }
    public void setBattGroupId(Integer battGroupId) {
        this.battGroupId = battGroupId;
    }
    public Integer getTestRecordCount() {
        return testRecordCount;
    }
    public void setTestRecordCount(Integer testRecordCount) {
        this.testRecordCount = testRecordCount;
    }
    public Integer getTestRecordCountEx() {
        return testRecordCountEx;
    }
    public void setTestRecordCountEx(Integer testRecordCountEx) {
        this.testRecordCountEx = testRecordCountEx;
    }
    public Integer getTestType() {
        return testType;
    }
    public void setTestType(Integer testType) {
        this.testType = testType;
    }
    public Integer getDataNew() {
        return dataNew;
    }
    public void setDataNew(Integer dataNew) {
        this.dataNew = dataNew;
    }
    public Integer getDataAvailable() {
        return dataAvailable;
    }
    public void setDataAvailable(Integer dataAvailable) {
        this.dataAvailable = dataAvailable;
    }
    public Date getTestStartTime() {
        return testStartTime;
    }
    public void setTestStartTime(Date testStartTime) {
        this.testStartTime = testStartTime;
    }
    public Date getTestStartTimeEx() {
        return testStartTimeEx;
    }
    public void setTestStartTimeEx(Date testStartTimeEx) {
        this.testStartTimeEx = testStartTimeEx;
    }
    public Integer getTestDevType() {
        return testDevType;
    }
    public void setTestDevType(Integer testDevType) {
        this.testDevType = testDevType;
    }
    public Date getRecordTime() {
        return recordTime;
    }
    public void setRecordTime(Date recordTime) {
        this.recordTime = recordTime;
    }
    public Float getGroupVol() {
        return groupVol;
    }
    public void setGroupVol(Float groupVol) {
        this.groupVol = groupVol;
    }
    public Float getTestCurr() {
        return testCurr;
    }
    public void setTestCurr(Float testCurr) {
        this.testCurr = testCurr;
    }
    public Integer getUploadUserId() {
        return uploadUserId;
    }
    public void setUploadUserId(Integer uploadUserId) {
        this.uploadUserId = uploadUserId;
    }
    public Integer getUploadClientType() {
        return uploadClientType;
    }
    public void setUploadClientType(Integer uploadClientType) {
        this.uploadClientType = uploadClientType;
    }
}
src/main/java/com/whyc/service/BaoJiGroupBattGroupService.java
@@ -85,4 +85,8 @@
            mapper.deleteStationList(baoJiGroupBattGroupList);
        }
    }
    public List<Battinf> getStationInfoList(Long uId) {
        return mapper.getStationInfoList(uId);
    }
}
src/main/java/com/whyc/service/BattTestDataInf2Service.java
New file
@@ -0,0 +1,26 @@
package com.whyc.service;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.BattTestDataCalcDTO;
import com.whyc.dto.BattTestDataDTO;
import com.whyc.mapper.BattTestDataInf2Mapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class BattTestDataInf2Service {
    @Resource
    private BattTestDataInf2Mapper mapper;
    public PageInfo<BattTestDataCalcDTO> calcTestData(BattTestDataDTO paramDto, Integer pageNum, Integer pageSize) {
        return null;
    }
    public List<String> getStationName1(Long uId) {
        return mapper.getStationName1(uId);
    }
}
src/main/resources/mapper/BaojiGroupBattGroupMapper.xml
@@ -1,134 +1,144 @@
<?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.whyc.mapper.BaoJiGroupBattGroupMapper">
  <resultMap id="BaseResultMap" type="com.whyc.pojo.BaojiGroupBattGroup">
    <id column="num" jdbcType="BIGINT" property="num" />
    <result column="baoji_group_id" jdbcType="INTEGER" property="baojiGroupId" />
    <result column="StationId" jdbcType="INTEGER" property="stationId" />
    <result column="BattGroupId" jdbcType="INTEGER" property="battGroupId" />
  </resultMap>
  <sql id="Base_Column_List">
    num, baoji_group_id, StationId, BattGroupId
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from tb_user_battgroup_baojigroup_battgroup
    where num = #{num,jdbcType=BIGINT}
  </select>
  <select id="searchStationName1InGroup" resultType="java.lang.String">
    select distinct db_battinf.tb_battinf.stationname1 from db_battinf.tb_battinf left outer join
    db_user.tb_user_battgroup_baojigroup_battgroup on
    db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid left outer join
    db_user.tb_user_battgroup_baojigroup_usr on
    db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id
    left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid where
    db_user.tb_user_inf.uId=#{uId} ORDER BY db_battinf.tb_battinf.stationname1
    <resultMap id="BaseResultMap" type="com.whyc.pojo.BaojiGroupBattGroup">
        <id column="num" jdbcType="BIGINT" property="num"/>
        <result column="baoji_group_id" jdbcType="INTEGER" property="baojiGroupId"/>
        <result column="StationId" jdbcType="INTEGER" property="stationId"/>
        <result column="BattGroupId" jdbcType="INTEGER" property="battGroupId"/>
    </resultMap>
    <sql id="Base_Column_List">
        num, baoji_group_id, StationId, BattGroupId
    </sql>
    <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from tb_user_battgroup_baojigroup_battgroup
        where num = #{num,jdbcType=BIGINT}
    </select>
    <select id="searchStationName1InGroup" parameterType="com.whyc.pojo.UserInf" resultType="java.lang.String">
        select distinct db_battinf.tb_battinf.stationname1 from db_battinf.tb_battinf left outer join
        db_user.tb_user_battgroup_baojigroup_battgroup on
        db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid left outer join
        db_user.tb_user_battgroup_baojigroup_usr on
        db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id
        left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid where
        db_user.tb_user_inf.uId=#{uId} ORDER BY db_battinf.tb_battinf.stationname1
  </select>
  <select id="searchStationByStationName1" resultType="com.whyc.pojo.Battinf">
    select distinct db_battinf.tb_battinf.stationname,db_battinf.tb_battinf.stationid,db_battinf.tb_battinf.fBSDeviceId
    from db_battinf.tb_battinf left outer join db_user.tb_user_battgroup_baojigroup_battgroup on
    db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid left outer join
    db_user.tb_user_battgroup_baojigroup_usr on
    db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id
    left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid
    <where>
      db_user.tb_user_inf.uid=#{userId}
      <if test="stationName1!=null and stationName1!='' and stationName1!='null'">
        and db_battinf.tb_battinf.stationname1 like CONCAT('%',#{stationName1},'%')
      </if>
    </where>
    ORDER BY db_battinf.tb_battinf.stationname1,db_battinf.tb_battinf.BattGroupId
  </select>
  <select id="searchBattGroupIdInGroup" resultType="com.whyc.pojo.Battinf">
    select distinct
    db_battinf.tb_battinf.battgroupid,db_battinf.tb_battinf.stationName,db_battinf.tb_battinf.battgroupname,db_battinf.tb_battinf.moncount,db_battinf.tb_battinf.GroupIndexInFBSDevice,db_battinf.tb_battinf.FBSDeviceId
    from db_battinf.tb_battinf left outer join db_user.tb_user_battgroup_baojigroup_battgroup on
    db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId left outer join
    db_user.tb_user_battgroup_baojigroup_usr on
    db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id
    left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid where
    db_user.tb_user_inf.uid=#{uId} and db_battinf.tb_battinf.stationname1 like '%${uNote}%' and db_battinf.tb_battinf.stationname like '%${UName}%'
    ORDER BY db_battinf.tb_battinf.stationname1,db_battinf.tb_battinf.BattGroupId
    </select>
    <select id="searchStationByStationName1" resultType="com.whyc.pojo.Battinf">
        select distinct
        db_battinf.tb_battinf.stationname,db_battinf.tb_battinf.stationid,db_battinf.tb_battinf.fBSDeviceId
        from db_battinf.tb_battinf left outer join db_user.tb_user_battgroup_baojigroup_battgroup on
        db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid left outer join
        db_user.tb_user_battgroup_baojigroup_usr on
        db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id
        left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid
        <where>
            db_user.tb_user_inf.uid=#{userId}
            <if test="stationName1!=null and stationName1!='' and stationName1!='null'">
                and db_battinf.tb_battinf.stationname1 like CONCAT('%',#{stationName1},'%')
            </if>
        </where>
        ORDER BY db_battinf.tb_battinf.stationname1,db_battinf.tb_battinf.BattGroupId
    </select>
    <select id="searchBattGroupIdInGroup" resultType="com.whyc.pojo.Battinf">
        select distinct
        db_battinf.tb_battinf.battgroupid,db_battinf.tb_battinf.stationName,db_battinf.tb_battinf.battgroupname,db_battinf.tb_battinf.moncount,db_battinf.tb_battinf.GroupIndexInFBSDevice,db_battinf.tb_battinf.FBSDeviceId
        from db_battinf.tb_battinf left outer join db_user.tb_user_battgroup_baojigroup_battgroup on
        db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId left outer join
        db_user.tb_user_battgroup_baojigroup_usr on
        db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id
        left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid where
        db_user.tb_user_inf.uid=#{uId} and db_battinf.tb_battinf.stationname1 like '%${uNote}%' and
        db_battinf.tb_battinf.stationname like '%${UName}%'
        ORDER BY db_battinf.tb_battinf.stationname1,db_battinf.tb_battinf.BattGroupId
  </select>
    </select>
    <select id="getStationList" resultType="com.whyc.pojo.Battinf">
        select distinct b.StationId,b.StationName
        from
          db_user.tb_user_battgroup_baojigroup_battgroup bb,
          (select distinct StationId,StationName from ((select StationId,StationName from db_battinf.tb_battinf) union (select StationId,StationName from db_pwrdev_inf.tb_pwrdev_inf))temp) b
        db_user.tb_user_battgroup_baojigroup_battgroup bb,
        (select distinct StationId,StationName from ((select StationId,StationName from db_battinf.tb_battinf) union
        (select StationId,StationName from db_pwrdev_inf.tb_pwrdev_inf))temp) b
        where bb.StationId = b.StationId
        and bb.baoji_group_id = #{baoJiGroupId} order by b.StationName
    </select>
    <select id="getStationInfoList" resultType="com.whyc.pojo.Battinf">
        select distinct StationId,StationName from db_battinf.tb_battinf where StationId in
        (
        <include refid="com.whyc.mapper.BattGroupStationUserMapper.sql_stationListOfUser"/>
        )
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from tb_user_battgroup_baojigroup_battgroup
    where num = #{num,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.whyc.pojo.BaojiGroupBattGroup">
    insert into tb_user_battgroup_baojigroup_battgroup (num, baoji_group_id, StationId,
      BattGroupId)
    values (#{num,jdbcType=BIGINT}, #{baojiGroupId,jdbcType=INTEGER}, #{stationid,jdbcType=INTEGER},
      #{battgroupid,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="com.whyc.pojo.BaojiGroupBattGroup">
    insert into tb_user_battgroup_baojigroup_battgroup
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="num != null">
        num,
      </if>
      <if test="baojiGroupId != null">
        baoji_group_id,
      </if>
      <if test="stationid != null">
        StationId,
      </if>
      <if test="battgroupid != null">
        BattGroupId,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="num != null">
        #{num,jdbcType=BIGINT},
      </if>
      <if test="baojiGroupId != null">
        #{baojiGroupId,jdbcType=INTEGER},
      </if>
      <if test="stationid != null">
        #{stationid,jdbcType=INTEGER},
      </if>
      <if test="battgroupid != null">
        #{battgroupid,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.whyc.pojo.BaojiGroupBattGroup">
    update tb_user_battgroup_baojigroup_battgroup
    <set>
      <if test="baojiGroupId != null">
        baoji_group_id = #{baojiGroupId,jdbcType=INTEGER},
      </if>
      <if test="stationid != null">
        delete from tb_user_battgroup_baojigroup_battgroup
        where num = #{num,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.whyc.pojo.BaojiGroupBattGroup">
        insert into tb_user_battgroup_baojigroup_battgroup (num, baoji_group_id, StationId,
        BattGroupId)
        values (#{num,jdbcType=BIGINT}, #{baojiGroupId,jdbcType=INTEGER}, #{stationid,jdbcType=INTEGER},
        #{battgroupid,jdbcType=INTEGER})
    </insert>
    <insert id="insertSelective" parameterType="com.whyc.pojo.BaojiGroupBattGroup">
        insert into tb_user_battgroup_baojigroup_battgroup
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="num != null">
                num,
            </if>
            <if test="baojiGroupId != null">
                baoji_group_id,
            </if>
            <if test="stationid != null">
                StationId,
            </if>
            <if test="battgroupid != null">
                BattGroupId,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="num != null">
                #{num,jdbcType=BIGINT},
            </if>
            <if test="baojiGroupId != null">
                #{baojiGroupId,jdbcType=INTEGER},
            </if>
            <if test="stationid != null">
                #{stationid,jdbcType=INTEGER},
            </if>
            <if test="battgroupid != null">
                #{battgroupid,jdbcType=INTEGER},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.whyc.pojo.BaojiGroupBattGroup">
        update tb_user_battgroup_baojigroup_battgroup
        <set>
            <if test="baojiGroupId != null">
                baoji_group_id = #{baojiGroupId,jdbcType=INTEGER},
            </if>
            <if test="stationid != null">
                StationId = #{stationid,jdbcType=INTEGER},
            </if>
            <if test="battgroupid != null">
                BattGroupId = #{battgroupid,jdbcType=INTEGER},
            </if>
        </set>
        where num = #{num,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKey" parameterType="com.whyc.pojo.BaojiGroupBattGroup">
        update tb_user_battgroup_baojigroup_battgroup
        set baoji_group_id = #{baojiGroupId,jdbcType=INTEGER},
        StationId = #{stationid,jdbcType=INTEGER},
      </if>
      <if test="battgroupid != null">
        BattGroupId = #{battgroupid,jdbcType=INTEGER},
      </if>
    </set>
    where num = #{num,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.whyc.pojo.BaojiGroupBattGroup">
    update tb_user_battgroup_baojigroup_battgroup
    set baoji_group_id = #{baojiGroupId,jdbcType=INTEGER},
      StationId = #{stationid,jdbcType=INTEGER},
      BattGroupId = #{battgroupid,jdbcType=INTEGER}
    where num = #{num,jdbcType=BIGINT}
  </update>
  <delete id="deleteStationList">
      <foreach collection="list" item="item" separator=";" >
        delete from db_user.tb_user_battgroup_baojigroup_usr where baoji_group_id = #{item.baojiGroupId} and StationId = #{item.stationId}
      </foreach>
  </delete>
        BattGroupId = #{battgroupid,jdbcType=INTEGER}
        where num = #{num,jdbcType=BIGINT}
    </update>
    <delete id="deleteStationList">
        <foreach collection="list" item="item" separator=";">
            delete from db_user.tb_user_battgroup_baojigroup_usr where baoji_group_id = #{item.baojiGroupId} and
            StationId = #{item.stationId}
        </foreach>
    </delete>
</mapper>
src/main/resources/mapper/BattGroupStationUserMapper.xml
@@ -2,6 +2,18 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.whyc.mapper.BattGroupStationUserMapper" >
    <sql id="sql_stationListOfUser">
        SELECT
            DISTINCT inf.StationId
        FROM
            db_battinf.tb_battinf inf,
            db_user.tb_user_battgroup_baojigroup_battgroup bjbg,
            db_user.tb_user_battgroup_baojigroup_usr bju
        WHERE
            inf.StationId = bjbg.StationId
        AND bjbg.baoji_group_id = bju.baoji_group_id
        AND bju.uId = #{uId}
    </sql>
    <select id="getUserList" resultType="com.whyc.pojo.UserInf">
        SELECT
src/main/resources/mapper/BattTestDataInf2Mapper.xml
New file
@@ -0,0 +1,9 @@
<?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.whyc.mapper.BattTestDataInf2Mapper" >
    <select id="getStationName1" resultType="java.lang.String">
    </select>
</mapper>