whycrzg
2021-02-01 f5efd5b6ea6a2a7f281542c1ea0774d7c925f5fa
update battInf.byBattGroupName
4个文件已修改
155 ■■■■ 已修改文件
src/main/java/com/fgkj/controller/BattInfController.java 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/mapper/impl/BattInfMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/services/BattInfServices.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/BattInfMapper.xml 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fgkj/controller/BattInfController.java
@@ -85,9 +85,11 @@
        return service.searchmaxId();
    }
    @GetMapping("byCondition")
    @PostMapping("byCondition")
    @ApiOperation(notes = "查capstdolstd/moncount/serstd",value="battgroupid查机房名称和电池组名称")
    public ServiceModelOnce serchByCondition(@RequestBody BattInf bif) {
    public ServiceModelOnce serchByCondition(@RequestParam Integer battGroupId) {
        BattInf bif =new BattInf();
        bif.setBattGroupId(battGroupId);
        return service.serchByCondition(bif);
    }
@@ -106,7 +108,9 @@
    //根据电池id查询电池的基本信息
    @GetMapping("byBattGroupId")
    @ApiOperation(notes = "",value="电池id查询电池的基本信息")
    public ServiceModel searchBattBybattgroupid(@RequestBody BattInf bif){
    public ServiceModel searchBattBybattgroupid(@RequestParam Integer battGroupId) {
        BattInf bif = new BattInf();
        bif.setBattGroupId(battGroupId);
        return service.searchBattBybattgroupid(bif);
    }
@@ -119,21 +123,30 @@
    }
    
//----------根据StationName1(维护区) 查不重复的BattGroupName(蓄电池组)
    @GetMapping("byStationName1")
    @ApiOperation(notes = "",value="StationName1(维护区) 查不重复的BattGroupName(蓄电池组)")
    public ServiceModelOnce serchByStationName1(@RequestBody BattInf bif){
    @PostMapping("byStationName1")
    @ApiOperation(notes = "stationName1如果无值传String类型的null,底层查询不同",value="StationName1(维护区) 查不重复的BattGroupName(蓄电池组)")
    public ServiceModelOnce serchByStationName1(@ApiParam(value = "维护区",required = false) @RequestParam String stationName1){
        BattInf bif = new BattInf();
//        System.out.println("bif ---= " + bif);
        if (stationName1!=null&&!stationName1.equals("null")) {
            bif.setStationName1(stationName1);
        }
        return service.serchByStationName1(bif);
    }
//----------根据StationName1(维护区) 查不重复的StationName(站点)
    @GetMapping("byStationName")
    @PostMapping("byStationName")
    @ApiOperation(notes = "",value="StationName1(维护区) 查不重复的StationName(站点)")
    public ServiceModelOnce serchByStationName(@RequestBody BattInf bif){
    public ServiceModelOnce serchByStationName(@RequestParam String stationName1) {
        BattInf bif = new BattInf();
        bif.setStationName1(stationName1);
        return service.serchByStationName(bif);
    }
    //----------根据StationName1(维护区) 查不重复的StationName(站点)不包含91000000一期设备
    @GetMapping("byStationNameWithout91")
    @PostMapping("byStationNameWithout91")
    @ApiOperation(notes = "",value="StationName1(维护区) 查不重复的StationName(站点)不包含91000000一期设备")
    public ServiceModelOnce serchByStationNameNot91(@RequestBody BattInf bif){
    public ServiceModelOnce serchByStationNameNot91(@RequestParam String stationName1) {
        BattInf bif = new BattInf();
        bif.setStationName1(stationName1);
        return service.serchByStationNameNot91(bif);
    }
//--查不重复的StationName1(维护区)
@@ -150,50 +163,65 @@
    }
    //-----------查询所有的省份
    @GetMapping("allStationName1")
    @ApiOperation(notes = "",value="查询所有的省份")
    @ApiOperation(notes = "需要session中的uId",value="查询所有的省份")
    public ServiceModel serchAllStationName1(){
        User_inf uinf=(User_inf) ActionUtil.getUser();
        return service.serchAllStationName1(uinf);
    }
    // ----------查询所有的市
    @GetMapping("allStationName2")
    @PostMapping("allStationName2")
    @ApiOperation(notes = "",value="查询所有的市")
    public ServiceModel serchAllStationName2(@RequestBody BattInf binf){
    public ServiceModel serchAllStationName2(@RequestParam String stationName1) {
        BattInf binf = new BattInf();
        User_inf uinf=(User_inf) ActionUtil.getUser();
        binf.setNum(uinf.getuId());
        binf.setStationName1(stationName1);
        return service.serchAllStationName2(binf);
    }
    //--查询所有的区县
    @GetMapping("allStationName5")
    @PostMapping("allStationName5")
    @ApiOperation(notes = "",value="查询所有的区县")
    public ServiceModel serchAllStationName5(@RequestBody BattInf binf){
        User_inf uinf=(User_inf) ActionUtil.getUser();
    public ServiceModel serchAllStationName5(@ApiParam(value = "省",required = true) @RequestParam String stationName1,@ApiParam(value = "市",required = true) @RequestParam String stationName2) {
        BattInf binf = new BattInf();
        User_inf uinf = (User_inf) ActionUtil.getUser();
        binf.setNum(uinf.getuId());
        binf.setStationName1(stationName1);
        binf.setStationName2(stationName2);
        return service.serchAllStationName5(binf);
    }
    //--查询所有的机房
    @GetMapping("allStationName")
    @PostMapping("allStationName")
    @ApiOperation(notes = "",value="查询所有的机房")
    public ServiceModel serchAllStationName(@RequestBody BattInf binf){
        User_inf uinf=(User_inf) ActionUtil.getUser();
    public ServiceModel serchAllStationName(@ApiParam(value = "省",required = true) @RequestParam String stationName1,@ApiParam(value = "市",required = true) @RequestParam String stationName2,@ApiParam(value = "区",required = true) @RequestParam String stationName5) {
        BattInf binf = new BattInf();
        User_inf uinf = (User_inf) ActionUtil.getUser();
        binf.setNum(uinf.getuId());
        binf.setStationName1(stationName1);
        binf.setStationName2(stationName2);
        binf.setStationName5(stationName5);
        return service.serchAllStationName(binf);
    }
    //--查询电池组信息
    @GetMapping("allBattInf")
    @ApiOperation(notes = "",value="查询电池组信息")
    public ServiceModel serchAllBattinf(@RequestBody BattInf binf){
    @PostMapping("allBattInf")
    @ApiOperation(notes = "参数s1、s2、s5 模糊查询参数",value="查询电池组信息")
    public ServiceModel serchAllBattinf(@ApiParam(value = "省",required = true) @RequestParam String stationName1,@ApiParam(value = "市",required = true) @RequestParam String stationName2,@ApiParam(value = "区",required = true) @RequestParam String stationName5,@ApiParam(value = "机房",required = true) @RequestParam String stationName3) {
        BattInf binf = new BattInf();
        binf.setStationName1(stationName1);
        binf.setStationName2(stationName2);
        binf.setStationName5(stationName5);
        binf.setStationName3(stationName3);
        return service.serchAllBattinf(binf);
    }
    
    //----------根据StationName(站点) 查不重复的BattGroupName(蓄电池组)
    @GetMapping("byBattGroupName")
    @ApiOperation(notes = "",value="根据StationName(站点) 查不重复的BattGroupName(蓄电池组)")
    public ServiceModelOnce serchByBattGroupName(@RequestBody BattInf bif){
        return service.serchByBattGroupName(bif);
    @PostMapping("byBattGroupName")
    @ApiOperation(notes = "",value="StationName(站点) 查不重复的BattGroupName(蓄电池组)")
    public ServiceModelOnce serchByBattGroupName(@ApiParam(value = "地址",required = true) @RequestParam String stationName,@ApiParam(value = "省",required = true) @RequestParam String stationName1){
        BattInf binf = new BattInf();
        binf.setStationName(stationName);
        binf.setStationName1(stationName1);
        return service.serchByBattGroupName(binf);
    }
    //查电池品牌
    @GetMapping("battProducer")
src/main/java/com/fgkj/mapper/impl/BattInfMapper.java
@@ -92,8 +92,6 @@
    List<BattInf> serchByStationName1plus(BattInf bif);
    // 根据StationName(站点) 查不重复的BattGroupName(蓄电池组)
    @Select("select DISTINCT(StationName),FBSDeviceId,StationId,battgroupname,moncount,BattGroupId,StationName,battproducer,moncapstd,monvolstd,battproductdate,battinusedate,GroupIndexInFBSDevice " +
            "from db_battinf.tb_battinf  where stationname1=#{stationName1} ORDER BY StationName1,battgroupId")
    public List<BattInf> serchByBattGroupName(BattInf obj);
@@ -101,7 +99,7 @@
    public List<BattInf> serchByStationName(BattInf obj);
    // 根据StationName1(维护区) 查不重复的StationName(站点)不包含91000000一期设备
    public List<BattInf> serchByStationNameNot91(Object obj);
    public List<BattInf> serchByStationNameNot91(BattInf obj);
    // 查不重复的StationName1(维护区)
    @Select("select DISTINCT(StationName1) from db_battinf.tb_battinf ORDER BY StationName1,battgroupId")
src/main/java/com/fgkj/services/BattInfServices.java
@@ -270,12 +270,12 @@
        return model;
    }
    public ServiceModelOnce serchByCondition(BattInf bif) {
        List<BattInf> list=mapper.serchByCondition(bif);
        ServiceModelOnce model=new ServiceModelOnce();
        ServiceModelOnce model = new ServiceModelOnce();
        List<BattInf> list = mapper.serchByCondition(bif);
        if (list != null && list.size() > 0) {
            model.setCode(1);
            model.setData(list);
             model.setSum(list.size());
            model.setSum(list.size());
        }
        return model;
    }
@@ -313,7 +313,7 @@
    public ServiceModelOnce serchByStationName1(BattInf bif) {
        ServiceModelOnce model = new ServiceModelOnce();
        List list = null;
        if (bif==null || bif.getStationName1() == null) {
        if (bif.getStationName1() == null&&!bif.getStationName1().equals("null")) {
            list = mapper.serchByStationName1(bif);
        }else{
            list = mapper.serchByStationName1plus(bif);
@@ -537,14 +537,14 @@
        return model;
    }
    public ServiceModelOnce serchByBattGroupName(BattInf obj) {
        ServiceModelOnce model=new ServiceModelOnce();
        List list=mapper.serchByBattGroupName(obj);
        ServiceModelOnce model = new ServiceModelOnce();
        List list = mapper.serchByBattGroupName(obj);
        if (list != null && list.size() > 0) {
            model.setCode(1);
            model.setData(list);
             model.setSum(list.size());
            model.setSum(list.size());
            model.setMsg("查询成功!");
        }else{
        } else {
            model.setCode(0);
            model.setMsg("查询失败!");
        }
src/main/resources/mapper/BattInfMapper.xml
@@ -72,6 +72,22 @@
        </association>
    </resultMap>
    <resultMap id="BaseResultMapBattInf2" type="BattInf">
        <result column="battGroupName" property="battGroupName"></result>
        <result column="stationName" property="stationName"></result>
        <result column="stationid" property="stationId"></result>
        <result column="monCount" property="monCount"></result>
        <result column="fbsdeviceid" property="fbsDeviceId"></result>
        <result column="groupIndexInFBSDevice" property="groupIndexInFBSDevice"></result>
        <result column="BattGroupId" property="battGroupId"></result>
        <result column="battProducer" property="battProducer"></result>
        <result column="monCapStd" property="monCapStd"></result>
        <result column="monVolStd" property="monVolStd"></result>
        <result column="battProductDate" property="battProductDate"></result>
        <result column="battInUseDate" property="battInUseDate"></result>
    </resultMap>
    <!--
    //添加新的电池组(多个)
    public boolean add(Object obj) {
@@ -4339,7 +4355,40 @@
    <select id="serchBatt" resultType="java.util.List"></select>
    <select id="findMenu" resultType="java.util.List"></select>
<!--    <select id="serchByStationName1" resultType="java.util.List">/</select>-->
<!--    <select id="serchByBattGroupName" resultType="java.util.List"></select>-->
    <select id="serchByBattGroupName" resultMap="BaseResultMapBattInf2">
        <if test="stationName==''">
            <if test="stationName1!=''">
                select DISTINCT(StationName), FBSDeviceId, StationId, battgroupname, moncount, BattGroupId, StationName,
                battproducer, moncapstd, monvolstd, battproductdate, battinusedate, GroupIndexInFBSDevice
                from db_battinf.tb_battinf
                where stationname1 = #{stationName1}
                ORDER BY StationName1, battgroupId
            </if>
            <if test="bif.stationName1==''">
                select
                DISTINCT(StationName),FBSDeviceId,StationId,battgroupname,moncount,BattGroupId,StationName,battproducer,moncapstd,monvolstd,battproductdate,battinusedate,GroupIndexInFBSDevice
                from db_battinf.tb_battinf ORDER BY StationName1,battgroupId
            </if>
        </if>
        <if test="stationName!=''">
            <if test="stationName1==''">
                select DISTINCT(StationName), FBSDeviceId, StationId, battgroupname, moncount, BattGroupId, StationName,
                battproducer, moncapstd, monvolstd, battproductdate, battinusedate, GroupIndexInFBSDevice
                from db_battinf.tb_battinf
                where stationname = #{stationName}
                ORDER BY StationName1, battgroupId
            </if>
            <if test="stationName1!=''">
                select
                DISTINCT(battgroupname),FBSDeviceId,StationId,moncount,BattGroupId,StationName,battproducer,moncapstd,monvolstd,battproductdate,battinusedate,GroupIndexInFBSDevice
                from db_battinf.tb_battinf where StationName=#{stationName} and stationname1=#{stationName1} ORDER BY
                StationName1,battgroupId
            </if>
        </if>
    </select>
    <select id="serchByStationName" resultType="BattInf">
        select DISTINCT(StationName), stationid, fbsdeviceid
        from db_battinf.tb_battinf