Commit 519c8750 authored by 张大伟's avatar 张大伟

Merge branch 'develop' of http://103.249.252.28:90/wangxiahui/zhny into develop

parents db402212 7b57ca45
...@@ -46,7 +46,7 @@ public class BusDeviceController extends PaginationController<BusDevice> { ...@@ -46,7 +46,7 @@ public class BusDeviceController extends PaginationController<BusDevice> {
@ApiOperation(value="添加设备", notes="添加设备") @ApiOperation(value="添加设备", notes="添加设备")
@PostMapping(value = "/add") @RequestMapping(value = "/add")
public Result add(@Valid BusDevice busDevice) { public Result add(@Valid BusDevice busDevice) {
PersistModel data = busDeviceServiceImpl.save(busDevice); PersistModel data = busDeviceServiceImpl.save(busDevice);
return Result.builder(data); return Result.builder(data);
...@@ -54,21 +54,21 @@ public class BusDeviceController extends PaginationController<BusDevice> { ...@@ -54,21 +54,21 @@ public class BusDeviceController extends PaginationController<BusDevice> {
@ApiOperation(value="修改设备", notes="修改设备") @ApiOperation(value="修改设备", notes="修改设备")
@PutMapping("/update") @RequestMapping("/update")
public Result update(@Valid BusDevice busDevice) { public Result update(@Valid BusDevice busDevice) {
PersistModel data = busDeviceServiceImpl.merge(busDevice); PersistModel data = busDeviceServiceImpl.merge(busDevice);
return Result.builder(data); return Result.builder(data);
} }
@ApiOperation(value="删除设备", notes="删除设备") @ApiOperation(value="删除设备", notes="删除设备")
@DeleteMapping("/delete") @RequestMapping("/delete")
public Result delete(@RequestParam String devid) { public Result delete(@RequestParam String devid) {
PersistModel data = busDeviceServiceImpl.delete(devid); PersistModel data = busDeviceServiceImpl.delete(devid);
return Result.builder(data); return Result.builder(data);
} }
@ApiOperation(value="查看单个设备", notes="查看单个设备") @ApiOperation(value="查看单个设备", notes="查看单个设备")
@GetMapping("/detail") @RequestMapping("/detail")
public Result detail(@RequestParam String devid) { public Result detail(@RequestParam String devid) {
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
...@@ -76,8 +76,17 @@ public class BusDeviceController extends PaginationController<BusDevice> { ...@@ -76,8 +76,17 @@ public class BusDeviceController extends PaginationController<BusDevice> {
busDeviceServiceImpl.findById(devid)); busDeviceServiceImpl.findById(devid));
} }
@ApiOperation(value="根据设备编号查看单个设备", notes="根据设备编号查看单个设备")
@RequestMapping("/detailByDevNum")
public Result detailByDevNum(@RequestParam String devNum) {
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
busDeviceServiceImpl.findByDevNum(devNum));
}
@ApiOperation(value="查看设备列表", notes="查看设备列表") @ApiOperation(value="查看设备列表", notes="查看设备列表")
@GetMapping(value = "/queryBusDeviceByPagination") @RequestMapping(value = "/queryBusDeviceByPagination")
public GridModel listByPagination(BusDevice busDevice) { public GridModel listByPagination(BusDevice busDevice) {
busDeviceServiceImpl.findAllByPagination(getPaginationUtility(), busDevice); busDeviceServiceImpl.findAllByPagination(getPaginationUtility(), busDevice);
return getGridModelResponse(); return getGridModelResponse();
...@@ -104,21 +113,19 @@ public class BusDeviceController extends PaginationController<BusDevice> { ...@@ -104,21 +113,19 @@ public class BusDeviceController extends PaginationController<BusDevice> {
busDeviceServiceImpl.getDevicesBySysId(sysId, proId)); busDeviceServiceImpl.getDevicesBySysId(sysId, proId));
} }
@ApiOperation(value = "通过项目id与子系统id导出子系统的设备清单excel文件") @ApiOperation(value = "通过项目id设备清单excel文件")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "sysId", value = "sysId", required = true,paramType = "path", dataType = "varchar"),
@ApiImplicitParam(name = "proId", value = "proId", required = true,paramType = "path", dataType = "varvhar") @ApiImplicitParam(name = "proId", value = "proId", required = true,paramType = "path", dataType = "varvhar")
}) })
@ResponseBody @ResponseBody
@RequestMapping(value = "/exportExcel/{proId}/{sysId}",method = RequestMethod.GET) @RequestMapping(value = "/exportExcel/{proId}",method = RequestMethod.GET)
public void exportExcel(HttpServletResponse response,@PathVariable("sysId") String sysId, public void exportExcel(HttpServletResponse response,
@PathVariable("proId") String proId) throws UnsupportedEncodingException { @PathVariable("proId") String proId) throws UnsupportedEncodingException {
System.out.println("参数:"+sysId+" "+proId);
List<DeviceAssetStatisticVo> deviceList = new ArrayList<>(); List<DeviceAssetStatisticVo> deviceList = new ArrayList<>();
//先获取数据库数据 //先获取数据库数据
deviceList = busDeviceServiceImpl.getDevicesBySysId(sysId, proId); deviceList = busDeviceServiceImpl.getDevicesBySysId(null, proId);
//通过项目id与系统id获取对应的名称组拼成文件名 //通过项目id获取对应的名称组拼成文件名
String filename = busDeviceServiceImpl.getProNameByProId(proId) + busDeviceServiceImpl.getSysNameBySysId(sysId)+"设备统计报表.xls"; String filename = busDeviceServiceImpl.getProNameByProId(proId) +"设备统计报表.xls";
//创建excel生成对象 //创建excel生成对象
HSSFWorkbook workbook = new HSSFWorkbook(); HSSFWorkbook workbook = new HSSFWorkbook();
......
...@@ -20,8 +20,12 @@ public interface BusDeviceRepository extends BaseMapper<BusDevice> { ...@@ -20,8 +20,12 @@ public interface BusDeviceRepository extends BaseMapper<BusDevice> {
* 分页查询 busDevice * 分页查询 busDevice
* *
*/ */
@Select("<script>select a.*,b.FAC_NM,DATE_FORMAT(a.install_date,'%Y-%m-%d %H:%i:%s') INSTALL_DAY from bus_device a left join bus_factory b on a.fac_id = b.fac_id where 1=1 and a.pro_id = #{proId} " + @Select("<script>select a.*,b.FAC_NM,DATE_FORMAT(a.install_date,'%Y-%m-%d %H:%i:%s') INSTALL_DAY,c.DEV_TP_NM from bus_device a left join bus_factory b on a.fac_id = b.fac_id" +
"<if test='devTpId != null'> and a.dev_tp_id = #{devTpId}</if>" " left join bus_device_tp c on a.dev_tp_id = c.dev_tp_id " +
" where 1=1" +
"<if test='proId != null'> and a.pro_id = #{proId}</if>" +
"<if test='devTpId != null'> and a.dev_tp_id = #{devTpId}</if>" +
"<if test='devNum != null'> and a.dev_num = #{devNum}</if>"
+ "</script>") + "</script>")
List<Map<String,Object>> queryBusDevices(BusDevice busDevice); List<Map<String,Object>> queryBusDevices(BusDevice busDevice);
......
...@@ -41,6 +41,13 @@ public interface BusDeviceService { ...@@ -41,6 +41,13 @@ public interface BusDeviceService {
*/ */
List<BusDevice> findById(String id); List<BusDevice> findById(String id);
/**
* 根据编号查询
* @param devNum
* @return
*/
public List<Map<String,Object>> findByDevNum(String devNum);
/** /**
* 分页查询 * 分页查询
* @param busDevice * @param busDevice
......
...@@ -132,6 +132,13 @@ public class BusDeviceServiceImpl implements BusDeviceService { ...@@ -132,6 +132,13 @@ public class BusDeviceServiceImpl implements BusDeviceService {
return busDeviceRepository.selectByExample(example); return busDeviceRepository.selectByExample(example);
} }
@Override
public List<Map<String,Object>> findByDevNum(String devNum){
BusDevice busDevice = new BusDevice();
busDevice.setDevNum(devNum);
return busDeviceRepository.queryBusDevices(busDevice);
}
/** /**
* 分页查询 busDevice * 分页查询 busDevice
* @param busDevice * @param busDevice
......
...@@ -27,6 +27,7 @@ public class BusDeviceInspect { ...@@ -27,6 +27,7 @@ public class BusDeviceInspect {
private Date inspTm; private Date inspTm;
private String inspContent; private String inspContent;
private String flag; private String flag;
private String devStatus;
public String getInsId() { public String getInsId() {
...@@ -91,4 +92,11 @@ public class BusDeviceInspect { ...@@ -91,4 +92,11 @@ public class BusDeviceInspect {
this.flag = flag; this.flag = flag;
} }
public String getDevStatus() {
return devStatus;
}
public void setDevStatus(String devStatus) {
this.devStatus = devStatus;
}
} }
package org.rcisoft.business.manage.controller;
import io.swagger.annotations.ApiOperation;
import org.rcisoft.business.device.maintenance.entity.BusDeviceInspect;
import org.rcisoft.business.manage.service.BusDeviceInspectService;
import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
@RestController
@RequestMapping("busdeviceminspect")
public class BusDeviceInspectController {
@Autowired
private BusDeviceInspectService busDeviceInspectService;
@ApiOperation(value="添加巡检记录", notes="添加巡检记录")
@PostMapping(value = "/add")
public Result add(@Valid BusDeviceInspect busDeviceInspect) {
PersistModel data = busDeviceInspectService.save(busDeviceInspect);
return Result.builder(data);
}
}
...@@ -53,13 +53,10 @@ public class BusDeviceTpController extends PaginationController<BusDeviceTp> { ...@@ -53,13 +53,10 @@ public class BusDeviceTpController extends PaginationController<BusDeviceTp> {
} }
@ApiOperation(value="删除设备类型", notes="删除设备类型") @ApiOperation(value="删除设备类型", notes="删除设备类型")
@PutMapping("/delete") @DeleteMapping("/delete")
public Result delete(@Valid BusDeviceTp busDeviceTp) { public Result delete(@Valid BusDeviceTp busDeviceTp) {
PersistModel data = busDeviceTpServiceImpl.delete(busDeviceTp); PersistModel data = busDeviceTpServiceImpl.delete(busDeviceTp);
return Result.builder(data, return Result.builder(data);
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
busDeviceTp);
} }
@ApiOperation(value="设备类型列表", notes="设备类型列表") @ApiOperation(value="设备类型列表", notes="设备类型列表")
......
package org.rcisoft.business.manage.dao;
import org.rcisoft.business.device.maintenance.entity.BusDeviceInspect;
import org.rcisoft.core.base.BaseMapper;
import org.springframework.stereotype.Repository;
@Repository
public interface BusDeviceInspectRepository extends BaseMapper<BusDeviceInspect>{
}
...@@ -60,8 +60,6 @@ public class BusProject{ ...@@ -60,8 +60,6 @@ public class BusProject{
private String topology; private String topology;
private BigDecimal shutPower;
private String bldNm; private String bldNm;
private String proType; private String proType;
...@@ -81,5 +79,7 @@ public class BusProject{ ...@@ -81,5 +79,7 @@ public class BusProject{
private String saveingCost; private String saveingCost;
private String saveingEnergy; private String saveingEnergy;
private String sysNm;
} }
package org.rcisoft.business.manage.service;
import org.rcisoft.business.device.maintenance.entity.BusDeviceInspect;
import org.rcisoft.core.model.PersistModel;
public interface BusDeviceInspectService {
/**
* 保存巡检记录
* @param busDeviceInspect
* @return
*/
PersistModel save(BusDeviceInspect busDeviceInspect);
/**
* 更新巡检记录状态
*/
int updateFlag(String devNum);
}
package org.rcisoft.business.manage.service.impl;
import org.rcisoft.business.device.maintenance.entity.BusDeviceInspect;
import org.rcisoft.business.manage.dao.BusDeviceInspectRepository;
import org.rcisoft.business.manage.service.BusDeviceInspectService;
import org.rcisoft.core.model.PersistModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import java.util.Date;
import java.util.UUID;
@Service
public class BusDeviceInspectServiceImpl implements BusDeviceInspectService {
@Autowired
private BusDeviceInspectRepository busDeviceInspectRepository;
@Transactional
@Override
public PersistModel save(BusDeviceInspect busDeviceInspect) {
busDeviceInspect.setInsId(UUID.randomUUID().toString().replace("-",""));
busDeviceInspect.setInspTm(new Date());
busDeviceInspect.setFlag("1");
updateFlag(busDeviceInspect.getDevNum());
int line = busDeviceInspectRepository.insertSelective(busDeviceInspect);
return new PersistModel(line);
}
@Override
public int updateFlag(String devNum) {
BusDeviceInspect bi = new BusDeviceInspect();
bi.setDevNum(devNum);
bi.setFlag("0");
Example ex = new Example(BusDeviceInspect.class);
Example.Criteria criteria = ex.createCriteria();
criteria.andEqualTo("devNum",devNum);
return busDeviceInspectRepository.updateByExampleSelective(bi,ex);
}
}
...@@ -57,15 +57,22 @@ public class BusDeviceTpServiceImpl implements BusDeviceTpService { ...@@ -57,15 +57,22 @@ public class BusDeviceTpServiceImpl implements BusDeviceTpService {
@Override @Override
public PersistModel delete(BusDeviceTp busDeviceTp) { public PersistModel delete(BusDeviceTp busDeviceTp) {
int line = 0; int line = 0;
String message = "";
Example example = new Example(BusDeviceTp.class); Example example = new Example(BusDeviceTp.class);
Example.Criteria criteria = example.createCriteria(); Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("devTpId", busDeviceTp.getDevTpId()); criteria.andEqualTo("devTpId", busDeviceTp.getDevTpId());
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("dev_tp_id",busDeviceTp.getDevTpId()); map.put("dev_tp_id",busDeviceTp.getDevTpId());
if(busDeviceTp.getDevTpId()!=null && !busDeviceTp.getDevTpId().equals("")){
if(busDeviceTpRepository.queryBuildTpParam(map)==null || busDeviceTpRepository.queryBuildTpParam(map).size()<1){ if(busDeviceTpRepository.queryBuildTpParam(map)==null || busDeviceTpRepository.queryBuildTpParam(map).size()<1){
line = busDeviceTpRepository.deleteByExample(example); line = busDeviceTpRepository.deleteByExample(example);
}else{
message = "关联模板不为空,无法删除";
} }
return new PersistModel(line); }else{
message = "ID为空,删除失败";
}
return new PersistModel(line,message);
} }
......
...@@ -72,6 +72,17 @@ public class LoginController extends PaginationController<SysUser> { ...@@ -72,6 +72,17 @@ public class LoginController extends PaginationController<SysUser> {
return Result.builder(new PersistModel(flag)); return Result.builder(new PersistModel(flag));
} }
@RequestMapping(value = "/loginWechat")
@ResponseBody
public Result loginWechat(@RequestBody SysUser user){
return Result.builder(userService.loginWechat(user));
}
@RequestMapping(value = "/openIdBindingFlag")
@ResponseBody
public Object openIdBindingFlag(@RequestParam String openId){
return userService.getUserByOpenId(openId);
}
......
...@@ -28,6 +28,14 @@ public interface UserRepository extends BaseMapper<SysUser>{ ...@@ -28,6 +28,14 @@ public interface UserRepository extends BaseMapper<SysUser>{
*/ */
List<Map<String,Object>> getUserInfo(@Param("userId") String userId); List<Map<String,Object>> getUserInfo(@Param("userId") String userId);
/**
* 根据openid查找用户信息,查看是否绑定
* @param openId
* @return
*/
@Select("<script>select * from sys_user where openid = #{openId}</script>")
List<Map<String,Object>> getUserByOpenId(@Param("openId") String openId);
/** /**
* 查询所有用户 * 查询所有用户
......
...@@ -33,6 +33,10 @@ public class SysUser { ...@@ -33,6 +33,10 @@ public class SysUser {
private String userTp; private String userTp;
private String userNickname;
private String openid;
/** /**
* 拥有角色列表 * 拥有角色列表
*/ */
......
package org.rcisoft.business.system.user.service; package org.rcisoft.business.system.user.service;
import org.apache.ibatis.annotations.Param;
import org.rcisoft.business.system.user.entity.*; import org.rcisoft.business.system.user.entity.*;
import org.rcisoft.core.aop.PageUtil; import org.rcisoft.core.aop.PageUtil;
import org.rcisoft.core.model.PersistModel; import org.rcisoft.core.model.PersistModel;
...@@ -41,6 +42,14 @@ public interface UserService { ...@@ -41,6 +42,14 @@ public interface UserService {
*/ */
int updateUser(SysUser sysUser, SysAdmins sysAdmins, SysOwner sysOwner,SysPrincipal sysPrincipal); int updateUser(SysUser sysUser, SysAdmins sysAdmins, SysOwner sysOwner,SysPrincipal sysPrincipal);
/**
* 更新用户openId
* @param userId 用户主键
* @param openId 微信openId
* @return
*/
int updateUserOpenid(String userId,String openId);
/** 根据userId删除用户 /** 根据userId删除用户
* @param userId * @param userId
* @return * @return
...@@ -96,5 +105,9 @@ public interface UserService { ...@@ -96,5 +105,9 @@ public interface UserService {
List<Map<String,Object>> listUserAllByPagination(PageUtil<SysUser> paginationUtility,String userTp); List<Map<String,Object>> listUserAllByPagination(PageUtil<SysUser> paginationUtility,String userTp);
PersistModel loginWechat(SysUser user);
boolean getUserByOpenId(@Param("openId") String openId);
} }
...@@ -27,6 +27,7 @@ import org.springframework.security.crypto.password.PasswordEncoder; ...@@ -27,6 +27,7 @@ import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
...@@ -133,6 +134,9 @@ public class UserServiceImpl implements UserService { ...@@ -133,6 +134,9 @@ public class UserServiceImpl implements UserService {
flag = 1; flag = 1;
} }
if(UserTpConstant.TP_INSPECTPERSON.equals(userTp)){
userRepository.insertSelective(sysUser);
}
return flag; return flag;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -178,6 +182,18 @@ public class UserServiceImpl implements UserService { ...@@ -178,6 +182,18 @@ public class UserServiceImpl implements UserService {
return flag; return flag;
} }
@Override
public int updateUserOpenid(String userId, String openId) {
SysUser user = new SysUser();
user.setUserId(userId);
user.setOpenid(openId);
Example example = new Example(SysUser.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("userId",userId);
int line = userRepository.updateByExampleSelective(user,example);
return line;
}
@Override @Override
public String deleteUser(String userId) { public String deleteUser(String userId) {
String result = "删除失败"; String result = "删除失败";
...@@ -334,6 +350,39 @@ public class UserServiceImpl implements UserService { ...@@ -334,6 +350,39 @@ public class UserServiceImpl implements UserService {
return list; return list;
} }
@Override
public PersistModel loginWechat(SysUser user) {
int line = 0;
String message = "";
List<SysUser> list = userRepository.listByUserName(user.getUserNm());
if(list!=null && list.size()==1){
SysUser su = list.get(0);
boolean flag = passwordEncoder.matches(user.getUserPwd(),su.getUserPwd());
if(flag){//登录成功后,关联微信openId
line = updateUserOpenid(su.getUserId(),user.getOpenid());
if(line<1){
message = "授权失败";
}else{
message = "授权成功";
}
}else{
message = "登录失败";
}
}else{
message = "登录异常";
}
return new PersistModel(line,message);
}
@Override
public boolean getUserByOpenId(String openId) {
List<Map<String,Object>> list = userRepository.getUserByOpenId(openId);
if(list!=null && list.size()>0){
return true;
}
return false;
}
public List<Map<String, Object>> handleMenu(List<Map<String, Object>> menuList){ public List<Map<String, Object>> handleMenu(List<Map<String, Object>> menuList){
List<Map<String, Object>> result = new ArrayList<>(); List<Map<String, Object>> result = new ArrayList<>();
for(Map<String, Object> tmap : menuList){ for(Map<String, Object> tmap : menuList){
......
...@@ -24,4 +24,8 @@ public class UserTpConstant { ...@@ -24,4 +24,8 @@ public class UserTpConstant {
* 团队负责人 * 团队负责人
*/ */
public static final String TP_PRINCIPAL = "4"; public static final String TP_PRINCIPAL = "4";
/**
* 设备巡检人员,(没有权限)
*/
public static final String TP_INSPECTPERSON = "5";
} }
...@@ -11,7 +11,7 @@ server: ...@@ -11,7 +11,7 @@ server:
# org.springframework.web: DEBUG # org.springframework.web: DEBUG
druid: druid:
url: jdbc:mysql://139.199.98.105:3336/zhny?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true url: jdbc:mysql://localhost:3306/zhny?useUnicode=true&characterEncoding=UTF-8&useSSL=false&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
username: root username: root
password: root password: root
initial-size: 1 initial-size: 1
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
<result column="PRO_ID" jdbcType="VARCHAR" property="proId"/> <result column="PRO_ID" jdbcType="VARCHAR" property="proId"/>
<result column="SYS_ID" jdbcType="VARCHAR" property="sysId"/> <result column="SYS_ID" jdbcType="VARCHAR" property="sysId"/>
<result column="OWN_ID" jdbcType="VARCHAR" property="ownId"/> <result column="OWN_ID" jdbcType="VARCHAR" property="ownId"/>
<result column="SHUT_POWER" jdbcType="DECIMAL" property="shutPower"/>
<result column="RUN_TM" jdbcType="DECIMAL" property="runTm"/>
</resultMap> </resultMap>
<resultMap id="DeviceAssetStatistics" type="org.rcisoft.business.device.assets.vo.DeviceAssetStatisticVo"> <resultMap id="DeviceAssetStatistics" type="org.rcisoft.business.device.assets.vo.DeviceAssetStatisticVo">
<result column="DEV_NM" jdbcType="VARCHAR" property="devNm"></result> <result column="DEV_NM" jdbcType="VARCHAR" property="devNm"></result>
...@@ -30,13 +28,12 @@ ...@@ -30,13 +28,12 @@
select dev.DEV_NM, dev.MODEL,dev.PARAM,dev.INSTALL_DATE,devtp.DEV_TP_NM,fac.FAC_NM select dev.DEV_NM, dev.MODEL,dev.PARAM,dev.INSTALL_DATE,devtp.DEV_TP_NM,fac.FAC_NM
from bus_device as dev,bus_device_tp as devtp,bus_factory as fac from bus_device as dev,bus_device_tp as devtp,bus_factory as fac
where dev.DEV_TP_ID=devtp.DEV_TP_ID and dev.FAC_ID=fac.FAC_ID where dev.DEV_TP_ID=devtp.DEV_TP_ID and dev.FAC_ID=fac.FAC_ID
AND
<if test="proId !='' and proId != null"> <if test="proId !='' and proId != null">
dev.PRO_ID = #{proId,jdbcType=VARCHAR} AND dev.PRO_ID = #{proId,jdbcType=VARCHAR}
</if> </if>
AND
<if test="sysId !='' and sysId != null"> <if test="sysId !='' and sysId != null">
dev.SYS_ID = #{sysId,jdbcType=VARCHAR} AND dev.SYS_ID = #{sysId,jdbcType=VARCHAR}
</if> </if>
ORDER BY INSTALL_DATE ORDER BY INSTALL_DATE
</select> </select>
......
...@@ -9,11 +9,13 @@ ...@@ -9,11 +9,13 @@
bd.DEV_NUM, bd.DEV_NUM,
bd.DEV_LOCAL, bd.DEV_LOCAL,
bdi.INSPECTOR, bdi.INSPECTOR,
DATE_FORMAT (bdi.INSP_TM,'%Y-%m-%d %H:%i:%S') AS INSP_TM DATE_FORMAT (bdi.INSP_TM,'%Y-%m-%d %H:%i:%S') AS INSP_TM,
su.USER_NICK_NAME
FROM FROM
bus_device bd bus_device bd
RIGHT JOIN bus_device_inspect bdi ON bd.DEV_ID = bdi.DEV_ID RIGHT JOIN bus_device_inspect bdi ON bd.DEV_NUM = bdi.DEV_NUM
LEFT JOIN bus_device_tp bdt ON bd.DEV_TP_ID = bdt.DEV_TP_ID LEFT JOIN bus_device_tp bdt ON bd.DEV_TP_ID = bdt.DEV_TP_ID
LEFT JOIN sys_user su ON su.OPENID = bdi.INSPECTOR
WHERE WHERE
bdi.FLAG = #{flag} bdi.FLAG = #{flag}
AND bd.PRO_ID = #{proId} AND bd.PRO_ID = #{proId}
...@@ -25,11 +27,13 @@ ...@@ -25,11 +27,13 @@
bd.DEV_NM, bd.DEV_NM,
bdi.INSP_PRINCIPAL, bdi.INSP_PRINCIPAL,
bdi.INSP_CONTENT, bdi.INSP_CONTENT,
DATE_FORMAT (bdi.INSP_TM,'%Y-%m-%d %H:%i:%S') AS INSP_TM DATE_FORMAT (bdi.INSP_TM,'%Y-%m-%d %H:%i:%S') AS INSP_TM,
su.USER_NICK_NAME
FROM FROM
bus_device bd bus_device bd
RIGHT JOIN bus_device_inspect bdi ON bd.DEV_ID = bdi.DEV_ID RIGHT JOIN bus_device_inspect bdi ON bd.DEV_NUM = bdi.DEV_NUM
LEFT JOIN bus_device_tp bdt ON bd.DEV_TP_ID = bdt.DEV_TP_ID LEFT JOIN bus_device_tp bdt ON bd.DEV_TP_ID = bdt.DEV_TP_ID
LEFT JOIN sys_user su ON su.OPENID = bdi.INSPECTOR
WHERE WHERE
bd.PRO_ID = #{proId} AND bd.DEV_NUM = #{devNum} bd.PRO_ID = #{proId} AND bd.DEV_NUM = #{devNum}
</select> </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