feat:探测器新增查询Type属性,台站新增查询Type属性

This commit is contained in:
qiaoqinzheng 2023-05-23 09:49:15 +08:00
parent 21b73368dc
commit a0f8a237d2
10 changed files with 57 additions and 3 deletions

View File

@ -13,6 +13,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("gardsDetectors")
@Api(value = "监测器管理", tags = "监测器管理")
@ -35,6 +37,13 @@ public class GardsDetectorsController {
return result;
}
@GetMapping("findType")
@ApiOperation(value = "查询Type属性值", notes = "查询Type属性值")
public List<String> findType(){
List<String> result = gardsDetectorsService.findType();
return result;
}
@PostMapping("create")
@ApiOperation(value = "新增监测器信息", notes = "新增监测器信息")
public Result create(@RequestBody @Validated(value = InsertGroup.class) GardsDetectors gardsDetectors){

View File

@ -48,11 +48,18 @@ public class GardsStationsController {
return result;
}
@GetMapping("findType")
@ApiOperation(value = "查询Type属性值", notes = "查询Type属性值")
public List<String> findType(){
List<String> result = gardsStationsService.findType();
return result;
}
@GetMapping("findCountryCode")
@ApiOperation(value = "查询COUNTRY_CODE", notes = "查询COUNTRY_CODE")
public List<String> findCountryCode(){
List<String> countryCode = gardsStationsService.findCountryCode();
return countryCode;
List<String> result = gardsStationsService.findCountryCode();
return result;
}
/**

View File

@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.system.entity.GardsDetectors;
import java.util.List;
public interface GardsDetectorsMapper extends BaseMapper<GardsDetectors> {
Page<GardsDetectors> findPage(Page<GardsDetectors> page, GardsDetectors gardsDetectors);
List<String> findType();
}

View File

@ -7,6 +7,8 @@ import java.util.List;
public interface GardsStationsMapper extends BaseMapper<GardsStations> {
List<String> findType();
List<String> findCountryCode();
}

View File

@ -26,7 +26,7 @@
and DETECTOR_CODE like CONCAT('%',#{gardsDetectors.detectorCode},'%')
</if>
<if test="gardsDetectors.type != '' and gardsDetectors.type != null">
and RTRIM(TYPE, ' ') = #{gardsDetectors.type}
and TYPE = #{gardsDetectors.type}
</if>
<if test="gardsDetectors.status != '' and gardsDetectors.status != null">
and RTRIM(STATUS, ' ') = #{gardsDetectors.status}
@ -34,4 +34,8 @@
</where>
</select>
<select id="findType" resultType="java.lang.String">
SELECT DISTINCT TYPE FROM GARDS_DETECTORS
</select>
</mapper>

View File

@ -2,6 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.system.mapper.GardsStationsMapper">
<select id="findType" resultType="java.lang.String">
SELECT DISTINCT TYPE FROM GARDS_STATIONS
</select>
<select id="findCountryCode" resultType="java.lang.String">
SELECT DISTINCT COUNTRY_CODE FROM GARDS_STATIONS
</select>

View File

@ -24,6 +24,12 @@ public interface IGardsDetectorsService extends IService<GardsDetectors> {
*/
GardsDetectors findInfo(Integer id);
/**
* 查询Type属性值
* @return
*/
List<String> findType();
/**
* 新增监测器信息
* @param gardsDetectors

View File

@ -25,6 +25,12 @@ public interface IGardsStationsService extends IService<GardsStations> {
*/
GardsStations findInfo(Integer stationId);
/**
* 查询TYPE
* @return
*/
List<String> findType();
/**
* 查询COUNTRY_CODE
* @return

View File

@ -78,6 +78,12 @@ public class GardsDetectorsServiceImpl extends ServiceImpl<GardsDetectorsMapper,
return gardsDetectors;
}
@Override
public List<String> findType() {
List<String> type = this.baseMapper.findType();
return type;
}
@Override
public Result create(GardsDetectors gardsDetectors) {
Result result = new Result();

View File

@ -65,6 +65,12 @@ public class GardsStationsServiceImpl extends ServiceImpl<GardsStationsMapper, G
return stations;
}
@Override
public List<String> findType() {
List<String> type = this.baseMapper.findType();
return type;
}
@Override
public List<String> findCountryCode() {
List<String> countryCode = this.baseMapper.findCountryCode();