Commit 162ac3ef authored by zhuangzhuang's avatar zhuangzhuang

4.13-- 增加开始线路,结束线路

parent 47563980
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -16,6 +16,10 @@ public class CircuitMessageVo {
private String evaluate;
private String SN;
private String TDLSN;
private List<ResultCityVo> list;
private List<ResultAlarmLog> alarmLogList;
......@@ -23,13 +27,15 @@ public class CircuitMessageVo {
public CircuitMessageVo() {
}
public CircuitMessageVo(String transportationNo, String cargoNo, String startCity, String endCity, Integer circuitState, String evaluate, List<ResultAlarmLog> alarmLogList) {
public CircuitMessageVo(String transportationNo, String cargoNo, String startCity, String endCity, Integer circuitState, String evaluate, String SN, String TDLSN, List<ResultAlarmLog> alarmLogList) {
this.transportationNo = transportationNo;
this.cargoNo = cargoNo;
this.startCity = startCity;
this.endCity = endCity;
this.circuitState = circuitState;
this.evaluate = evaluate;
this.SN = SN;
this.TDLSN = TDLSN;
this.alarmLogList = alarmLogList;
}
......@@ -81,6 +87,22 @@ public class CircuitMessageVo {
this.evaluate = evaluate;
}
public String getSN() {
return SN;
}
public void setSN(String SN) {
this.SN = SN;
}
public String getTDLSN() {
return TDLSN;
}
public void setTDLSN(String TDLSN) {
this.TDLSN = TDLSN;
}
public List<ResultCityVo> getList() {
return list;
}
......
......@@ -19,6 +19,8 @@ public class HomePageDataVo {
private List<CircuitVo> circuitList;
private List<HistogramData> histogramDataList;
public Integer getSum() {
return sum;
}
......@@ -74,4 +76,12 @@ public class HomePageDataVo {
public void setCircuitList(List<CircuitVo> circuitList) {
this.circuitList = circuitList;
}
public List<HistogramData> getHistogramDataList() {
return histogramDataList;
}
public void setHistogramDataList(List<HistogramData> histogramDataList) {
this.histogramDataList = histogramDataList;
}
}
......@@ -47,7 +47,7 @@ public class LocationDataVo {
return "{" +
"\"time\""+":\"" + time + '\"' +
",\"lng\""+":" + lng +
",\" lat\""+":" + lat +
",\"lat\""+":" + lat +
", \"error\""+":" + error +
'}';
}
......
......@@ -17,15 +17,11 @@ public class ResultCircuitForAppVo {
private String transportationType;
private String remark;
private String SN;
public Long getStartTime() {
return startTime;
}
private String TDLSN;
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
private String remark;
public String getTransportationNo() {
return transportationNo;
......@@ -43,6 +39,14 @@ public class ResultCircuitForAppVo {
this.city = city;
}
public Long getStartTime() {
return startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public String getCargoNo() {
return cargoNo;
}
......@@ -83,6 +87,22 @@ public class ResultCircuitForAppVo {
this.transportationType = transportationType;
}
public String getSN() {
return SN;
}
public void setSN(String SN) {
this.SN = SN;
}
public String getTDLSN() {
return TDLSN;
}
public void setTDLSN(String TDLSN) {
this.TDLSN = TDLSN;
}
public String getRemark() {
return remark;
}
......
......@@ -23,6 +23,10 @@ public class ResultCircuitVo {
private String transportation;
private String SN;
private String TDLSN;
public String getTransportationNo() {
return transportationNo;
}
......@@ -110,4 +114,20 @@ public class ResultCircuitVo {
public void setTransportation(String transportation) {
this.transportation = transportation;
}
public String getSN() {
return SN;
}
public void setSN(String SN) {
this.SN = SN;
}
public String getTDLSN() {
return TDLSN;
}
public void setTDLSN(String TDLSN) {
this.TDLSN = TDLSN;
}
}
\ No newline at end of file
package com.example.tdl.domain.vo;
public class StartCircuitVo {
private Long startTime;
private String transportationNo;
public Long getStartTime() {
return startTime;
}
public void setStartTime(Long startTime) {
this.startTime = startTime;
}
public String getTransportationNo() {
return transportationNo;
}
public void setTransportationNo(String transportationNo) {
this.transportationNo = transportationNo;
}
}
package com.example.tdl.domain.vo;
public class TDLLogVo {
private String gSN;
private String gType;
private String TDLSN;
public String getgSN() {
return gSN;
}
public void setgSN(String gSN) {
this.gSN = gSN;
}
public String getgType() {
return gType;
}
public void setgType(String gType) {
this.gType = gType;
}
public String getTDLSN() {
return TDLSN;
}
public void setTDLSN(String TDLSN) {
this.TDLSN = TDLSN;
}
}
package com.example.tdl.domain.vo;
public class UpdateCircuitVo {
private Long endTime;
private String transportationNo;
......
......@@ -4,11 +4,14 @@ public class UserNameVo {
private String UserName;
private String time;
public UserNameVo() {
}
public UserNameVo(String userName) {
public UserNameVo(String userName, String time) {
UserName = userName;
this.time = time;
}
public String getUserName() {
......@@ -18,4 +21,12 @@ public class UserNameVo {
public void setUserName(String userName) {
UserName = userName;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
}
......@@ -21,6 +21,8 @@ public interface CircuitMapper {
int updateEndTime(UpdateCircuitVo updateCircuitVo);
int updateStartTime(StartCircuitVo startCircuitVo);
int delCircuit(String transportationNo);
ResultCircuitVo getByTransportationNo(@Param("transportationNo") String transportationNo,@Param("companyName") String companyName);
......
......@@ -26,6 +26,7 @@ public interface TDLDeviceMapper {
List<String> getByGatewaySN(@Param("SN") String SN, @Param("type") String type);
List<String> getTdlSN(@Param("SN") String SN, @Param("type") String type);
String getTdl(@Param("SN") String SN, @Param("type") String type);
}
package com.example.tdl.mapper;
import com.example.tdl.domain.vo.ResultGatewayVo;
import com.example.tdl.domain.vo.TDLLogVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface TDLLogMapper {
ResultGatewayVo getByNo(String transportationNo);
TDLLogVo getByTransportationNo(String transportationNo);
List<String> getTdlSN(String transportationNo);
}
......@@ -21,7 +21,7 @@ public interface UserMapper {
ResultUserVo getByEmail(@Param("email") String email,@Param("companyName") String companyName);
ResultUserVo getByUserNumber(@Param("userNumber") String userNumber,@Param("companyName") String companyName);
ResultUserVo getByUserNumber(String userNumber);
int addUser(AddUserVo addUserVo);
......
......@@ -39,6 +39,10 @@ public class CircuitService {
return circuitMapper.updateEndTime(updateCircuitVo);
}
public int updateStartTime(StartCircuitVo startCircuitVo){
return circuitMapper.updateStartTime(startCircuitVo);
}
public int delCircuit(String transportationNo){
return circuitMapper.delCircuit(transportationNo);
}
......
......@@ -46,4 +46,8 @@ public class TDLDeviceService {
public List<String> getTdlSN(String SN,String type){
return tdlDeviceMapper.getTdlSN(SN,type);
}
public String getTdl(String SN,String type){
return tdlDeviceMapper.getTdl(SN,type);
}
}
......@@ -2,10 +2,13 @@ package com.example.tdl.service;
import com.example.tdl.domain.vo.ResultGatewayVo;
import com.example.tdl.domain.vo.TDLLogVo;
import com.example.tdl.mapper.TDLLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class TDLLogService {
......@@ -16,4 +19,12 @@ public class TDLLogService {
return tdlLogMapper.getByNo(transportationNo);
}
public TDLLogVo getByTransportationNo(String transportationNo){
return tdlLogMapper.getByTransportationNo(transportationNo);
}
public List<String> getTdlSN(String transportationNo){
return tdlLogMapper.getTdlSN(transportationNo);
}
}
......@@ -46,8 +46,8 @@ public class UserService {
return userMapper.getByEmail(email,companyName);
}
public ResultUserVo getByUserNumber(String userNumber,String companyName){
return userMapper.getByUserNumber(userNumber,companyName);
public ResultUserVo getByUserNumber(String userNumber){
return userMapper.getByUserNumber(userNumber);
}
public int addUser(AddUserVo addUserVo){
......@@ -66,7 +66,6 @@ public class UserService {
return userMapper.updatePassword(updatePasswordVo);
}
//登录
public String getUser(LoginUserVo loginUserVo) {
//获取用户信息
......
......@@ -56,6 +56,12 @@ public class CircuitController {
@Autowired
private AlarmService alarmService;
@Autowired
private TDLLogService tdlLogService;
@Autowired
private ConfigService configService;
List<String> list = new ArrayList<String>(){{
add("T");
add("h");
......@@ -121,6 +127,8 @@ public class CircuitController {
" deliveryAddress:交付地点," +
" transportation:运输方式," +
" transportationType:运输类型," +
" SN:gateway序列号" +
" TDLSN:TDLSN序列号" +
" remark:备注")
@ApiImplicitParams({
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
......@@ -343,6 +351,18 @@ public class CircuitController {
fb.setMessage("途径地预计到达时间不能为空");
return gson.toJson(fb);
}
if (addCircuitVo.getAddressVoList().get(i).getCompTime() <=addCircuitVo.getAddressVoList().get(i).getExpTime()){
fb.setCode(0);
fb.setMessage("途径地预计到达时间不能小于途径地预计出发时间");
return gson.toJson(fb);
}
if(i<addCircuitVo.getAddressVoList().size()-1){
if (addCircuitVo.getAddressVoList().get(i).getCompTime() >=addCircuitVo.getAddressVoList().get(i +1).getExpTime()){
fb.setCode(0);
fb.setMessage("当前途径地预计到达时间不能大于下一个途径地预计出发时间");
return gson.toJson(fb);
}
}
countryVar=countryVar +addCircuitVo.getAddressVoList().get(i).getCountry() +" ";
cityVar=cityVar +addCircuitVo.getAddressVoList().get(i).getCity() +" ";
addressDetailVar =addressDetailVar +addCircuitVo.getAddressVoList().get(i).getAddressDetail() +" ";
......@@ -411,6 +431,11 @@ public class CircuitController {
fb.setMessage("目的地预计到达时间不能为空");
return gson.toJson(fb);
}
if(addCircuitVo.getEndAddressVo().getCompTime()<=addCircuitVo.getStartAddressVo().getExpTime()){
fb.setCode(0);
fb.setMessage("目的地预计到达时间不能小于出发地的预计出发时间");
return gson.toJson(fb);
}
if(StringUtils.isEmpty(addCircuitVo.getSN())){
fb.setCode(0);
fb.setMessage("网关序列号不能为空");
......@@ -448,7 +473,7 @@ public class CircuitController {
}
if(!StringUtils.isEmpty(tdlDeviceVo.getGatewaySN())){
fb.setCode(0);
fb.setMessage(addCircuitVo.getTdlAlarmList().get(j).getTDLSN() +"已经被使用");
fb.setMessage("序列号为"+addCircuitVo.getTdlAlarmList().get(j).getTDLSN() +"的TDL已经被使用");
return gson.toJson(fb);
}
......@@ -753,26 +778,56 @@ public class CircuitController {
}
if (StringUtils.isEmpty(updateCircuitVo.getTransportationNo())){
fb.setCode(0);
fb.setMessage("需要修改的运输编号不能为空");
fb.setMessage("运输编号不能为空");
return gson.toJson(fb);
}
if (updateCircuitVo.getEndTime()==null){
fb.setCode(0);
fb.setMessage("线路结束时间不能为空");
return gson.toJson(fb);
updateCircuitVo.setEndTime(System.currentTimeMillis());
}
if (circuitService.getByTransportationNo(updateCircuitVo.getTransportationNo(),user.getCompanyName()).getCircuitState()!=2){
if (circuitService.getByTransportationNo(updateCircuitVo.getTransportationNo(),user.getCompanyName()).getCircuitState() ==0){
fb.setCode(0);
fb.setMessage("线路未完成");
fb.setMessage("线路未开始");
return gson.toJson(fb);
}
int a = circuitService.updateEndTime(updateCircuitVo);
if (a>0){
//获取当前线路的gateway 和tdl信息
TDLLogVo tdlLogVo = tdlLogService.getByTransportationNo(updateCircuitVo.getTransportationNo());
List<String> dev = tdlLogService.getTdlSN(updateCircuitVo.getTransportationNo());
List<String> devList = tdlDeviceService.getByGatewaySN(tdlLogVo.getgSN(),tdlLogVo.getgType());
String tdl = tdlDeviceService.getTdl(tdlLogVo.getgSN(),tdlLogVo.getgType());
ConfigCMDVo configCMDVo;
ConfigVo configVo =configService.getConfig(tdlLogVo.getgSN(),tdlLogVo.getgType());
ConfigCMDVo config = gson.fromJson(configVo.getMessage(),ConfigCMDVo.class);
if(tdl.equals(tdlLogVo.getTDLSN())){
configCMDVo = new ConfigCMDVo();
}else{
devList.remove(dev);
configCMDVo = new ConfigCMDVo("config",config.getGpsPeriod(),config.getGprsPeriod(),devList,config.getMode(),System.currentTimeMillis()/1000l);
}
String TDLSN;
if(tdlLogVo.getTDLSN().contains(",")){
String[] tdlSNList = tdlLogVo.getTDLSN().split(",");
TDLSN = tdlSNList[0];
}else{
TDLSN = tdlLogVo.getTDLSN();
}
Map<Object,Object> map=new HashMap<>();
map.put("gSN",tdlLogVo.getgSN());
map.put("gType",tdlLogVo.getgType());
map.put("message",gson.toJson(configCMDVo));
map.put("untie",true);
map.put("TDLSN",TDLSN);
map.put("endTime",updateCircuitVo.getEndTime());
configService.updateConfig(map);
Map<Object,Object> msg=new HashMap<>();
msg.put("msg",map.get("msg"));
if (msg.get("msg").equals("解除网关成功")){
fb.setCode(1);
fb.setMessage("修改线路结束时间成功");
fb.setMessage(msg.get("msg").toString());
String key ="TDL/"+tdlLogVo.getgType()+"/" +tdlLogVo.getgSN() +"/Data";
alarmRedisService.delKey(key);
}else{
fb.setCode(0);
fb.setMessage("修改线路结束时间失败");
fb.setMessage(msg.get("msg").toString());
}
return gson.toJson(fb);
}
......@@ -924,6 +979,8 @@ public class CircuitController {
" endCity:目的城市" +
" circuitState:线路状态" +
" evaluate:评价" +
" SN:gateway序列号" +
" TDLSN:TDLSN序列号" +
" list:" +
" {city:城市" +
" time:到达时间/发车时间" +
......@@ -941,7 +998,7 @@ public class CircuitController {
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
})
@PostMapping("/getDetails")
public Object getDetails(@RequestBody String transportationNo,HttpServletRequest request){
public Object getDetails(@RequestBody String transportationNo,HttpServletRequest request) {
String token = request.getHeader("Account_token");
String datum = tokenRedisService.get("TOKEN_" +token);
UserRedisVo user = gson.fromJson(datum,UserRedisVo.class);
......@@ -950,7 +1007,7 @@ public class CircuitController {
//获取线路信息
ResultCircuitVo resultCircuitVo = circuitService.getByTransportationNo(transportationNo,user.getCompanyName());
List<ResultAlarmLog> alarmLogList= alarmLogService.getByTransportationNo(transportationNo);
CircuitMessageVo messageVo = new CircuitMessageVo(resultCircuitVo.getTransportationNo(),resultCircuitVo.getCargoNo(),resultCircuitVo.getStartCity(),resultCircuitVo.getEndCity(),resultCircuitVo.getCircuitState(),resultCircuitVo.getEvaluate(),alarmLogList);
CircuitMessageVo messageVo = new CircuitMessageVo(resultCircuitVo.getTransportationNo(),resultCircuitVo.getCargoNo(),resultCircuitVo.getStartCity(),resultCircuitVo.getEndCity(),resultCircuitVo.getCircuitState(),resultCircuitVo.getEvaluate(),resultCircuitVo.getSN(),resultCircuitVo.getTDLSN(),alarmLogList);
//获取线路情况
List<CircuitTransferVo> list =circuitTransferService.getCity(transportationNo);
List<ResultCityVo> cityVoList = new ArrayList<>();
......@@ -1047,6 +1104,51 @@ public class CircuitController {
return gson.toJson(messageVo);
}
//开始运输
@ApiOperation(value = "开始运输",notes = "开始运输")
@ApiImplicitParams({
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
})
@PostMapping("/startTransportation")
public Object startTransportation(@RequestBody StartCircuitVo startCircuitVo,HttpServletRequest request){
String token = request.getHeader("Account_token");
String datum = tokenRedisService.get("TOKEN_" +token);
UserRedisVo user = gson.fromJson(datum,UserRedisVo.class);
if (StringUtils.isEmpty(startCircuitVo.getTransportationNo())){
fb.setCode(0);
fb.setMessage("运输编号不能为空");
return gson.toJson(fb);
}
if (circuitService.getByTransportationNo(startCircuitVo.getTransportationNo(),user.getCompanyName())==null){
fb.setCode(0);
fb.setMessage("没有该线路");
return gson.toJson(fb);
}
if (startCircuitVo.getStartTime()==null){
fb.setCode(0);
fb.setMessage("线路开始时间不能为空");
return gson.toJson(fb);
}
//判断该线路是否绑定
ResultGatewayVo gatewayVo = tdlLogService.getByNo(startCircuitVo.getTransportationNo());
if(gatewayVo == null){
fb.setCode(0);
fb.setMessage("该线路未绑定tdl和gateway");
return gson.toJson(fb);
}
int a = circuitService.updateStartTime(startCircuitVo);
if (a>0){
fb.setCode(1);
fb.setMessage("线路开启成功");
}else{
fb.setCode(0);
fb.setMessage("线路开启失败");
}
return gson.toJson(fb);
}
//生成运输编号
public String getTransportNo(String transportation,String transportationType){
String transportationNo="";
......
......@@ -103,11 +103,11 @@ public class DataController {
return ret;
}
//获取gateway的信息
ResultGatewayVo gatewayVo = tdlLogService.getByNo(transportationNo);
if(gatewayVo==null){
TDLLogVo tdlLogVo = tdlLogService.getByTransportationNo(transportationNo);
if(tdlLogVo==null){
return gson.toJson(locationDataVoList);
}
String device = gatewayVo.getType() +"_" +gatewayVo.getSN();
String device = tdlLogVo.getgType() +"_" +tdlLogVo.getgSN();
String sql ="";
if(resultCircuitVo.getEndTime() != null && resultCircuitVo.getEndTime() != 0){
Long time = resultCircuitVo.getEndTime()*1000000l;
......@@ -116,7 +116,6 @@ public class DataController {
sql = "SELECT \"lng\",\"lat\" FROM \"tdl_policy\".\""+device+"\"where time >= "+startTime +" ORDER BY time ";
}
//获取tdl信息
QueryResult queryResult = influxDBTemplate.query(new Query(sql,database));
//解析经纬度数据
List<LocationDataVo> locationDataVos = new ArrayList<>();
......@@ -214,15 +213,15 @@ public class DataController {
if(resultCircuitVo.getEndTime() !=null && resultCircuitVo.getEndTime() !=0 && infoRedisService.hasHashKey("HistoryData",transportationNo)){
return infoRedisService.getHash("HistoryData",transportationNo);
}else{
ResultGatewayVo gatewayVo = tdlLogService.getByNo(transportationNo);
TDLLogVo gatewayVo = tdlLogService.getByTransportationNo(transportationNo);
if(gatewayVo == null){
fb.setCode(0);
fb.setMessage("该运输编号不存在");
return gson.toJson(fb);
}
String device = gatewayVo.getType() +"_" +gatewayVo.getSN();
String device = gatewayVo.getgType() +"_" +gatewayVo.getgSN();
//获取tdl信息
List<String> devList= tdlDeviceService.getByGatewaySN(gatewayVo.getSN(),gatewayVo.getType());
List<String> devList= tdlLogService.getTdlSN(transportationNo);
if(devList.size() == 0){
fb.setCode(0);
fb.setMessage("没有数据");
......@@ -245,7 +244,7 @@ public class DataController {
//String sql = "SELECT \"T\" FROM \"tdl_policy\".\"WTD93LG_17110198\" where \"tdl\"=\'TDL-1707010057708\' and time >=1522220659993000000 ORDER BY time ";
String sql="";
if(resultCircuitVo.getEndTime() !=null && resultCircuitVo.getEndTime() !=0){
sql = "SELECT "+list.get(j)+" FROM \"tdl_policy\".\""+device+"\" where \"tdl\"='"+devList.get(i)+"' and time >="+startTime + "and time<="+resultCircuitVo.getEndTime() *1000000l+" ORDER BY time ";
sql = "SELECT "+list.get(j)+" FROM \"tdl_policy\".\""+device+"\" where \"tdl\"='"+devList.get(i)+"' and time >="+startTime + " and time<="+resultCircuitVo.getEndTime() *1000000l+" ORDER BY time ";
}else{
sql = "SELECT "+list.get(j)+" FROM \"tdl_policy\".\""+device+"\" where \"tdl\"='"+devList.get(i)+"' and time >="+startTime + " ORDER BY time ";
}
......@@ -287,28 +286,27 @@ public class DataController {
JSONObject jsonObject= JSON.parseObject(transportationNo);
transportationNo=jsonObject.getString("transportationNo");
ResultCircuitVo resultCircuitVo = circuitService.getByTransportationNo(transportationNo,user.getCompanyName());
ResultGatewayVo gatewayVo = new ResultGatewayVo();
if(resultCircuitVo.getEndTime() == 0){
gatewayVo = circuitService.getByNo(transportationNo);
}else{
gatewayVo = tdlLogService.getByNo(transportationNo);
TDLLogVo gatewayVo = tdlLogService.getByTransportationNo(transportationNo);
if(gatewayVo == null){
fb.setCode(0);
fb.setMessage("该线路未绑定gateway和tdl");
return gson.toJson(fb);
}
String device = gatewayVo.getType() +"_" +gatewayVo.getSN();
String device = gatewayVo.getgType() +"_" +gatewayVo.getgSN();
//获取tdl信息
List<String> devList = tdlDeviceService.getByGatewaySN(gatewayVo.getSN(),gatewayVo.getType());
String devcie=gatewayVo.getType()+"_"+gatewayVo.getSN() ;
List<String> devList = tdlLogService.getTdlSN(transportationNo);
Long startTime = resultCircuitVo.getStartTime() *1000000l;
//SELECT "h" FROM "tdl_policy"."WTD93LG_20180314" WHERE "tdl" = 'tdl-0A0B0C0D0F' ORDER BY time DESC
if(devList.size() == 0){
fb.setCode(0);
fb.setMessage("没有数据");
fb.setMessage("该线路未绑定gateway和tdl");
return gson.toJson(fb);
}
List<Temperature> temperatures = new ArrayList<>();
for( int i =0;i<devList.size();i++){
Temperature temperature = new Temperature();
temperature.setTDLSN(devList.get(i));
String sql = "SELECT \"T\" FROM \"tdl_policy\".\""+devcie+"\" where \"tdl\"=\'"+devList.get(i)+"\' and time >="+startTime+" ORDER BY time ";
String sql = "SELECT \"T\" FROM \"tdl_policy\".\""+device+"\" where \"tdl\"=\'"+devList.get(i)+"\' and time >="+startTime+" ORDER BY time ";
QueryResult queryResult = influxDBTemplate.query(new Query(sql,database));
List<TemperatureDataVo> temperatureDataVos = new ArrayList<>();
if(queryResult.getResults().get(0).getSeries() != null){
......@@ -334,27 +332,27 @@ public class DataController {
JSONObject jsonObject= JSON.parseObject(transportationNo);
transportationNo=jsonObject.getString("transportationNo");
ResultCircuitVo resultCircuitVo = circuitService.getByTransportationNo(transportationNo,user.getCompanyName());
ResultGatewayVo gatewayVo = new ResultGatewayVo();
if(resultCircuitVo.getEndTime() == 0){
gatewayVo = circuitService.getByNo(transportationNo);
}else{
gatewayVo = tdlLogService.getByNo(transportationNo);
TDLLogVo gatewayVo = tdlLogService.getByTransportationNo(transportationNo);
if(gatewayVo == null){
fb.setCode(0);
fb.setMessage("该线路未绑定gateway和tdl");
return gson.toJson(fb);
}
String device = gatewayVo.getType() +"_" +gatewayVo.getSN();
Long startTime = resultCircuitVo.getStartTime() *1000000l;
String device = gatewayVo.getgType() +"_" +gatewayVo.getgSN();
//获取tdl信息
List<String> devList = tdlLogService.getTdlSN(transportationNo);
//获取tdl信息
List<String> devList = tdlDeviceService.getByGatewaySN(gatewayVo.getSN(),gatewayVo.getType());
String devcie=gatewayVo.getType()+"_"+gatewayVo.getSN() ;
if(devList.size() == 0){
fb.setCode(0);
fb.setMessage("没有数据");
return gson.toJson(fb);
}
Long startTime = resultCircuitVo.getStartTime() *1000000l;
List<Humidity> humidities = new ArrayList<>();
for( int i =0;i<devList.size();i++){
Humidity humidity = new Humidity();
humidity.setTDLSN(devList.get(i));
String sql = "SELECT \"h\" FROM \"tdl_policy\".\""+devcie+"\" where \"tdl\"=\'"+devList.get(i)+"\' and time >="+startTime+" ORDER BY time ";
String sql = "SELECT \"h\" FROM \"tdl_policy\".\""+device+"\" where \"tdl\"=\'"+devList.get(i)+"\' and time >="+startTime+" ORDER BY time ";
QueryResult queryResult = influxDBTemplate.query(new Query(sql,database));
List<HumidityDataVo> humidityDataVos = new ArrayList<>();
if(queryResult.getResults().get(0).getSeries() != null){
......@@ -380,17 +378,16 @@ public class DataController {
JSONObject jsonObject= JSON.parseObject(transportationNo);
transportationNo=jsonObject.getString("transportationNo");
ResultCircuitVo resultCircuitVo = circuitService.getByTransportationNo(transportationNo,user.getCompanyName());
ResultGatewayVo gatewayVo = new ResultGatewayVo();
if(resultCircuitVo.getEndTime() == 0){
gatewayVo = circuitService.getByNo(transportationNo);
}else{
gatewayVo = tdlLogService.getByNo(transportationNo);
}
String device = gatewayVo.getType() +"_" +gatewayVo.getSN();
Long startTime = resultCircuitVo.getStartTime() *1000000l;
TDLLogVo gatewayVo = tdlLogService.getByTransportationNo(transportationNo);
if(gatewayVo == null){
fb.setCode(0);
fb.setMessage("该线路未绑定gateway和tdl");
return gson.toJson(fb);
}
String device = gatewayVo.getgType() +"_" +gatewayVo.getgSN();
//获取tdl信息
List<String> devList = tdlDeviceService.getByGatewaySN(gatewayVo.getSN(),gatewayVo.getType());
String devcie=gatewayVo.getType()+"_"+gatewayVo.getSN() ;
List<String> devList = tdlLogService.getTdlSN(transportationNo);
if(devList.size() == 0){
fb.setCode(0);
fb.setMessage("没有数据");
......@@ -400,7 +397,7 @@ public class DataController {
for( int i =0;i<devList.size();i++){
TiltAngle tiltAngle = new TiltAngle();
tiltAngle.setTDLSN(devList.get(i));
String sql = "SELECT \"ta\" FROM \"tdl_policy\".\""+devcie+"\" where \"tdl\"=\'"+devList.get(i)+"\' and time >="+startTime+" ORDER BY time ";
String sql = "SELECT \"ta\" FROM \"tdl_policy\".\""+device+"\" where \"tdl\"=\'"+devList.get(i)+"\' and time >="+startTime+" ORDER BY time ";
QueryResult queryResult = influxDBTemplate.query(new Query(sql,database));
List<TiltAngleVo> tiltAngleVos = new ArrayList<>();
if(queryResult.getResults().get(0).getSeries() != null){
......@@ -426,17 +423,17 @@ public class DataController {
JSONObject jsonObject= JSON.parseObject(transportationNo);
transportationNo=jsonObject.getString("transportationNo");
ResultCircuitVo resultCircuitVo = circuitService.getByTransportationNo(transportationNo,user.getCompanyName());
ResultGatewayVo gatewayVo = new ResultGatewayVo();
if(resultCircuitVo.getEndTime() == 0){
gatewayVo = circuitService.getByNo(transportationNo);
}else{
gatewayVo = tdlLogService.getByNo(transportationNo);
TDLLogVo gatewayVo = tdlLogService.getByTransportationNo(transportationNo);
if(gatewayVo == null){
fb.setCode(0);
fb.setMessage("该线路未绑定gateway和tdl");
return gson.toJson(fb);
}
String device = gatewayVo.getType() +"_" +gatewayVo.getSN();
String device = gatewayVo.getgType() +"_" +gatewayVo.getgSN();
//获取tdl信息
List<String> devList = tdlLogService.getTdlSN(transportationNo);
Long startTime = resultCircuitVo.getStartTime() *1000000l;
//获取tdl信息
List<String> devList = tdlDeviceService.getByGatewaySN(gatewayVo.getSN(),gatewayVo.getType());
String devcie=gatewayVo.getType()+"_"+gatewayVo.getSN() ;
if(devList.size() == 0){
fb.setCode(0);
fb.setMessage("没有数据");
......@@ -446,7 +443,7 @@ public class DataController {
for( int i =0;i<devList.size();i++){
ShockEnergy shockEnergy = new ShockEnergy();
shockEnergy.setTDLSN(devList.get(i));
String sql = "SELECT \"a0\" FROM \"tdl_policy\".\""+devcie+"\" where \"tdl\"=\'"+devList.get(i)+"\' and time >="+startTime+" ORDER BY time ";
String sql = "SELECT \"a0\" FROM \"tdl_policy\".\""+device+"\" where \"tdl\"=\'"+devList.get(i)+"\' and time >="+startTime+" ORDER BY time ";
QueryResult queryResult = influxDBTemplate.query(new Query(sql,database));
List<ShockEnergyVo> shockEnergyVos = new ArrayList<>();
if(queryResult.getResults().get(0).getSeries() != null){
......
......@@ -168,7 +168,6 @@ public class EquipmentBindingController {
ConfigVo configVo =configService.getConfig(resultTDLDeviceVo.getGatewaySN(),resultTDLDeviceVo.getGatewayType());
ConfigCMDVo config = gson.fromJson(configVo.getMessage(),ConfigCMDVo.class);
ConfigCMDVo configCMDVo ;
Boolean untie = false;
if(devList.size()>1){
devList.remove(TDLSN);
configCMDVo = new ConfigCMDVo("config",config.getGpsPeriod(),config.getGprsPeriod(),devList,config.getMode(),System.currentTimeMillis()/1000l);
......@@ -179,6 +178,7 @@ public class EquipmentBindingController {
map.put("gSN",resultTDLDeviceVo.getGatewaySN());
map.put("gType",resultTDLDeviceVo.getGatewayType());
map.put("message",gson.toJson(configCMDVo));
map.put("untie",true);
map.put("TDLSN",TDLSN);
map.put("endTime",System.currentTimeMillis());
configService.updateConfig(map);
......
......@@ -62,7 +62,7 @@ public class GatewayController {
" type:网关类型," +
" state:网关状态," +
" bConfig:是否配置通道," +
" useScene:使用场景")
" useScene:使用场景(0为空闲,1为运输,2为仓库)")
@ApiImplicitParams({
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
})
......
......@@ -77,7 +77,10 @@ public class HomePageController {
"endTime:到达时间;" +
"lng:当前经度;" +
"lat:当前纬度;" +
"time:当前时间;}")
"time:当前时间;}" +
"histogramDataList{" +
" classify: 种类(1-温度,2-湿度,3-震动,4-倾角,5-延误,6-离线)" +
" count:数量}")
@PostMapping("/getAll")
@ApiImplicitParams({
@ApiImplicitParam(paramType="header", name = "Account_token", value = "token", required = true, dataType = "String"),
......@@ -92,12 +95,15 @@ public class HomePageController {
HomePageDataVo dataVo = new HomePageDataVo();
//获取所有的线路数量
dataVo.setSum(circuitService.getCount(time,user.getCompanyName()));//总数量
//获取近几天的线路信息
dataVo.setOnRoute(circuitService.getOnRoute(time,user.getCompanyName()));//在途数量
dataVo.setDelay(circuitService.getDelayCount(System.currentTimeMillis(),time,user.getCompanyName()));//延误数量
dataVo.setAlarmed( alarmLogServcie.getCount(time));//报警数量
dataVo.setBump(alarmLogServcie.getBumpCount(time)); //获取颠簸数量
dataVo.setAlarmLogVoList(alarmLogServcie.getAlarmLog(time));//报警列表
List<HistogramData> list = alarmLogServcie.getByCount(time);//获取报警柱状图
dataVo.setHistogramDataList(list);
//获取设备的当前位置
List<ResultCircuitVo> circuitVos = circuitService.getByTime(time,user.getCompanyName());
List<CircuitVo> circuitList = new ArrayList<>();
......
......@@ -43,7 +43,7 @@ public class TDLDeviceController {
" TDLSN:TDL序列号," +
" counts:使用次数," +
" lastTime:最后使用时间," +
" useScene:使用场景(0为空闲,1为仓库,2为运输)," +
" useScene:使用场景(0为空闲,1为运输,2为仓库)," +
" warehouseName:仓库名," +
" transportationNo:运输编号," +
" gatewaySN:网关序列号," +
......
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.example.tdl.domain.dto.CommFeedback;
import com.example.tdl.domain.vo.*;
import com.example.tdl.service.CompanyService;
import com.example.tdl.service.RoleHasPermissionService;
import com.example.tdl.service.RoleService;
......@@ -44,7 +45,8 @@ public class UserController {
@Autowired
private RoleService roleService;
@Autowired
private CompanyService companyService;
//获取所有用户信息
......@@ -176,6 +178,16 @@ public class UserController {
fb.setMessage("没有该角色");
return gson.toJson(fb);
}
if (StringUtils.isEmpty(userVo.getCompanyName())){
fb.setCode(0);
fb.setMessage("公司名不能为空");
return gson.toJson(fb);
}
if (companyService.getByCompanyName(userVo.getCompanyName())==null){
fb.setCode(0);
fb.setMessage("没有该公司");
return gson.toJson(fb);
}
String userNumber="U"+System.currentTimeMillis();
userVo.setUserNumber(userNumber);
userVo.setCreateTime(System.currentTimeMillis());
......@@ -207,7 +219,12 @@ public class UserController {
String token = request.getHeader("Account_token");
String datum = tokenRedisService.get("TOKEN_" +token);
UserRedisVo user = gson.fromJson(datum,UserRedisVo.class);
ResultUserVo userInfo=userService.getByUserNumber(userVo.getUserNumber(),user.getCompanyName());
if (StringUtils.isEmpty(userVo.getUserNumber())){
fb.setCode(0);
fb.setMessage("用户编号不能为空");
return gson.toJson(fb);
}
ResultUserVo userInfo=userService.getByUserNumber(userVo.getUserNumber());
if (StringUtils.isEmpty(userVo.getNickName())){
fb.setCode(0);
fb.setMessage("昵称不能为空");
......@@ -223,7 +240,7 @@ public class UserController {
fb.setMessage("手机号不规范");
return gson.toJson(fb);
}
if (userInfo!=null&&userInfo.getPhone().equals(userVo.getPhone())){
if (userInfo!=null&& !userInfo.getPhone().equals(userVo.getPhone()) && userService.getByPhone(user.getPhone(),userInfo.getCompanyName()) !=null){
fb.setCode(0);
fb.setMessage("该手机号已被注册");
return gson.toJson(fb);
......@@ -238,7 +255,7 @@ public class UserController {
fb.setMessage("邮箱格式不规范");
return gson.toJson(fb);
}
if (userInfo!=null&&userInfo.getEmail().equals(userVo.getEmail())){
if (userInfo!=null && !userInfo.getEmail().equals(userVo.getEmail()) && userService.getByEmail(userVo.getEmail(),userInfo.getCompanyName()) !=null){
fb.setCode(0);
fb.setMessage("该邮箱已被注册");
return gson.toJson(fb);
......@@ -248,11 +265,7 @@ public class UserController {
fb.setMessage("角色名不能为空");
return gson.toJson(fb);
}
if (StringUtils.isEmpty(userVo.getUserNumber())){
fb.setCode(0);
fb.setMessage("需要修改的用户编号不能为空");
return gson.toJson(fb);
}
if (roleService.getByRoleName(userVo.getRoleName())==0){
fb.setCode(0);
fb.setMessage("修改的角色名不存在");
......@@ -359,7 +372,7 @@ public class UserController {
public Object getUserName(HttpServletRequest request){
String token = request.getHeader("Account_token");
String datum = tokenRedisService.get("TOKEN_" +token);
return new UserNameVo(gson.fromJson(datum,UserRedisVo.class).getUserName());
return new UserNameVo(gson.fromJson(datum,UserRedisVo.class).getUserName(),System.currentTimeMillis()+"");
}
}
......@@ -49,7 +49,6 @@ tdl.mqtt.cacrt = ca.crt
tdl.mqtt.clientkey = witcd.pem
tdl.mqtt.clientcrt = witcd.crt
# InfluxDB
spring.influxdb.username=admin
spring.influxdb.password=37774020
......
......@@ -44,25 +44,22 @@
</select>
<select id = "getByCount" parameterType="String" resultType="com.example.tdl.domain.vo.HistogramData" >
SELECT classify,count(description) FROM alarm_log WHERE classify = "1"
SELECT ifnull(classify,"1") classify,count(description) count FROM alarm_log WHERE classify = "1"
AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s'))
UNION ALL
SELECT classify,count(description) FROM alarm_log WHERE classify = "3"
SELECT ifnull(classify,"2") classify,count(description) count FROM alarm_log WHERE classify = "2"
AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s'))
UNION ALL
SELECT classify,count(description) FROM alarm_log WHERE classify = "2"
SELECT ifnull(classify,"3") classify,count(description) count FROM alarm_log WHERE classify = "3"
AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s'))
UNION ALL
SELECT classify,count(description) FROM alarm_log WHERE classify = "5"
SELECT ifnull(classify,"4") classify,count(description) count FROM alarm_log WHERE classify = "4"
AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s'))
UNION ALL
SELECT classify,count(description) FROM alarm_log WHERE classify = "4"
SELECT ifnull(classify,"5") classify,count(description) count FROM alarm_log WHERE classify = "5"
AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s'))
UNION ALL
SELECT classify,count(description) FROM alarm_log WHERE classify = "6"
AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s'))
UNION ALL
SELECT classify,count(description) FROM alarm_log WHERE classify = "倾角"
SELECT ifnull(classify,"6") classify,count(description) count FROM alarm_log WHERE classify = "6"
AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(alarmTime/1000,'%Y-%m-%d %H:%i:%s'))
</select>
......
......@@ -152,6 +152,12 @@
WHERE transportationNo=#{transportationNo,jdbcType=VARCHAR}
</update>
<update id="updateStartTime" parameterType="com.example.tdl.domain.vo.StartCircuitVo">
UPDATE circuit set
startTime=#{startTime,jdbcType=BIGINT},circuitState=1
WHERE transportationNo=#{transportationNo,jdbcType=VARCHAR}
</update>
<!--删除线路-->
<delete id="delCircuit" parameterType="String">
UPDATE circuit set state=0
......@@ -163,8 +169,10 @@
SELECT c.transportationNo,cargoNo,(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id ORDER BY sequence LIMIT 1)) startCity,startTime,
(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id ORDER BY sequence DESC LIMIT 1)) endCity,endTime,circuitState,
(SELECT alarmType FROM alarm WHERE id IN (SELECT alarm_id from tdl_gateway_log WHERE transportationNo=c.transportationNo)) alarmType,
(select GROUP_CONCAT(DISTINCT classify) from alarm_log al where al.transportationNo = c.transportationNo) alarm,ifnull(evaluate,"") evaluate,transportation
from circuit c where c.state=1
(select GROUP_CONCAT(DISTINCT classify) from alarm_log al where al.transportationNo = c.transportationNo) alarm,ifnull(evaluate,"") evaluate,transportation,
(select gatewaySN FROM tdl_gateway_log WHERE transportationNo= #{transportationNo,jdbcType=VARCHAR} ) SN,(SELECT GROUP_CONCAT(TDLSN) FROM tdl_gateway_log WHERE transportationNo= #{transportationNo,jdbcType=VARCHAR}) TDLSN
from circuit c
where c.state=1
AND c.transportationNo=#{transportationNo,jdbcType=VARCHAR}
AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
</select>
......@@ -172,7 +180,7 @@
<!--根据线路编号获取线路信息 app-->
<select id="getByTransportationNoForApp" resultType="com.example.tdl.domain.vo.ResultCircuitForAppVo" parameterType="String">
SELECT c.transportationNo,CONCAT_WS("-",(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id AND sequence =LEFT(s.sequence,1))),(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id AND sequence=RIGHT(s.sequence,1)))) city,
cargoNo,plateNo,deliveryAddress,transportation,transportationType,remark
cargoNo,plateNo,deliveryAddress,transportation,transportationType,(select gatewaySN FROM tdl_gateway_log WHERE transportationNo= #{transportationNo,jdbcType=VARCHAR} ) SN,(SELECT GROUP_CONCAT(TDLSN) FROM tdl_gateway_log WHERE transportationNo= #{transportationNo,jdbcType=VARCHAR}) TDLSN,remark
from circuit c,(SELECT GROUP_CONCAT(sequence) sequence from circuit_transfer where circuit_id=(SELECT id from circuit where transportationNo=#{transportationNo,jdbcType=VARCHAR})) s
where c.state=1
AND c.transportationNo=#{transportationNo,jdbcType=VARCHAR}
......@@ -181,7 +189,7 @@
<!-- 运输中数量-->
<select id="getOnRoute" resultType="java.lang.Integer" parameterType="String">
select count(startTime) from circuit where circuitState=1
select count(startTime) from circuit where circuitState=1 AND state = 1
and DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(createTime/1000,'%Y-%m-%d %H:%i:%s'))
AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
</select>
......@@ -189,7 +197,8 @@
<!--延误数量-->
<select id="getDelayCount" resultType="java.lang.Integer" >
select count(id) from circuit where state =1
and endtime &lt;=compTime or compTime >= #{compTime,jdbcType=BIGINT}
and endtime &lt; compTime or compTime &lt; #{compTime,jdbcType=BIGINT}
and DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(createTime/1000,'%Y-%m-%d %H:%i:%s'))
AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
</select>
......@@ -198,6 +207,7 @@
select count(id) from circuit
where DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(createTime/1000,'%Y-%m-%d %H:%i:%s'))
AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
AND state =1
</select>
<!--根据车牌号查线路-->
......@@ -210,7 +220,6 @@
AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
</select>
<!--根据运输状态查询线路信息-->
<select id="getByCircuitState" resultType="com.example.tdl.domain.vo.ResultCircuitVo">
SELECT c.transportationNo,cargoNo,(SELECT city from city WHERE id =(SELECT city_id from circuit_transfer WHERE circuit_id=c.id ORDER BY sequence LIMIT 1)) startCity,startTime,
......@@ -245,6 +254,7 @@
(SELECT alarmType FROM alarm WHERE id IN (SELECT alarm_id from tdl_gateway_log WHERE transportationNo=c.transportationNo)) alarmType,
(select GROUP_CONCAT(DISTINCT classify) from alarm_log al where al.transportationNo = c.transportationNo) alarm,evaluate,transportation
from circuit c where c.state=1
and c.circuitState = 1
AND company_id=(SELECT id from company where companyName=#{companyName,jdbcType=VARCHAR})
AND DATE_SUB(CURDATE(), INTERVAL #{time,jdbcType=VARCHAR} DAY) &lt;= date(FROM_UNIXTIME(createTime/1000,'%Y-%m-%d %H:%i:%s'))
</select>
......
......@@ -46,6 +46,7 @@
#{gSN,mode=IN,jdbcType=VARCHAR},
#{gType,mode=IN,jdbcType=VARCHAR},
#{message,mode=IN,jdbcType=VARCHAR},
#{untie,mode=IN,jdbcType=INTEGER},
#{TDLSN,mode=IN,jdbcType=VARCHAR},
#{endTime,mode=IN,jdbcType=BIGINT},
#{msg,mode=OUT,jdbcType=VARCHAR}
......
......@@ -69,4 +69,11 @@
and g.SN =#{SN,jdbcType=VARCHAR}
and g.type=#{type,jdbcType=VARCHAR}
</select>
<select id="getTdl" parameterType="String" resultType="String">
select GROUP_CONCAT(TDLSN) from tdldevice t,gateway g
where t.gateway_id = g.id
and g.SN =#{SN,jdbcType=VARCHAR}
and g.type=#{type,jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
......@@ -6,4 +6,16 @@
where transportationNo = #{transportationNo,jdbcType=VARCHAR}
GROUP BY gatewaySN
</select>
<select id="getByTransportationNo" parameterType="String" resultType="com.example.tdl.domain.vo.TDLLogVo">
select gatewaySN gSN,gatewayType gType, GROUP_CONCAT(TDLSN) TDLSN
from tdl_gateway_log
where transportationNo = #{transportationNo,jdbcType=VARCHAR}
</select>
<select id="getTdlSN" parameterType="String" resultType="String">
select CONCAT("TDL-",TDLSN) TDLSN
from tdl_gateway_log
where transportationNo = #{transportationNo,jdbcType=VARCHAR}
</select>
</mapper>
\ No newline at end of file
......@@ -3,7 +3,7 @@
<mapper namespace="com.example.tdl.mapper.UserMapper">
<!--登录-->
<select id="login" parameterType="com.example.tdl.domain.vo.LoginUserVo" resultType="java.lang.Integer">
SELECT COUNT(*) from USER
SELECT COUNT(userName) from USER
WHERE userName=#{userName,jdbcType=VARCHAR}
AND password=#{password,jdbcType=VARCHAR}
AND state=1
......@@ -73,7 +73,6 @@
select userNumber, userName,password,nickName,phone,email,roleName,c.companyName
from company c,`user` u INNER JOIN role r ON u.role_id=r.id
WHERE u.company_id=c.id
AND c.companyName=#{companyName,jdbcType=VARCHAR}
AND userNumber=#{userNumber,jdbcType=VARCHAR}
AND u.state=1
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment