起重机械设备

This commit is contained in:
pengjie 2023-08-31 17:54:13 +08:00
parent 594f2af4a5
commit e472005fd5
17 changed files with 160 additions and 46 deletions

View File

@ -39,7 +39,7 @@ public class DataScopeInterceptor extends JsqlParserSupport implements InnerInte
if (sct == SqlCommandType.INSERT) {
Class<?> clazz = Class.forName(ms.getId().substring(0, ms.getId().lastIndexOf(StringPool.DOT)));
DataScope annotation = clazz.getAnnotation(DataScope.class);
if (annotation == null) {
if (annotation == null || annotation.type() == 2) {
return;
}
if (InterceptorIgnoreHelper.willIgnoreTenantLine(ms.getId())) return;

View File

@ -174,7 +174,7 @@ public class SystemUserAuthController {
if(user==null) {
result.error500("登录名或密码错误");
} else if(userInfo.getState() == 0) {
result.error500("账号已被禁用,请联系管理员");
result.error500("账号未启用,请联系管理员");
} else if(userInfo.getAccountType() != 1) {
Government government = governmentService.getGovByUser(userInfo.getAccountType(), userInfo.getSn());
if (government.getExpireTime() != null && DateUtil.endOfDay(government.getExpireTime()).before(new Date())) {
@ -187,7 +187,7 @@ public class SystemUserAuthController {
if (!userInfo.getIsManager()) {
Long roleId = systemRoleService.getByUserId(userInfo.getUserId());
if (roleId == null) {
result.error500("角色已被禁用,请联系管理员");
result.error500("角色未启用,请联系管理员");
}
}
userInfo.setProjectDateAuth(government.getProjectDateAuth());

View File

@ -7,10 +7,11 @@ import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.jeecg.common.util.PageUtil;
import com.zhgd.xmgl.modules.safety.dto.LiftingDeviceExamineDto;
import com.zhgd.xmgl.modules.safety.entity.LiftingDevice;
import com.zhgd.xmgl.modules.safety.entity.LiftingDeviceExamine;
import com.zhgd.xmgl.modules.safety.entity.LiftingDeviceUse;
import com.zhgd.xmgl.modules.safety.service.ILiftingDeviceService;
import com.zhgd.xmgl.modules.safety.vo.LiftingDeviceVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@ -85,35 +86,37 @@ public class EntLiftingDeviceController {
/**
* 添加
*
* @param liftingDevice
* @param liftingDeviceVo
* @return
*/
@OperLog(operModul = "起重机械设备管理", operType = "新增", operDesc = "设备产权备案申请")
@ApiOperation(value = " 设备产权备案申请", notes = "设备产权备案申请", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<Object> add(@RequestBody LiftingDevice liftingDevice) {
liftingDeviceService.saveInfo(liftingDevice);
public Result<Object> add(@RequestBody LiftingDeviceVo liftingDeviceVo) {
liftingDeviceService.saveInfo(liftingDeviceVo);
return Result.success("申请成功!");
}
/**
* 申请
* @param liftingDeviceExamine
* @param liftingDeviceExamineVo
* @return
*/
@OperLog(operModul = "起重机械设备管理", operType = "新增", operDesc = "设备提交审批申请")
@ApiOperation(value = " 设备提交审批申请", notes = "设备提交审批申请", httpMethod = "POST")
@PostMapping(value = "/apply")
public Result<Object> apply(@RequestBody LiftingDeviceExamine liftingDeviceExamine) {
public Result<Object> apply(@RequestBody LiftingDeviceExamineDto liftingDeviceExamineVo) {
Result<Object> result = new Result<Object>();
LiftingDevice liftingDevice = liftingDeviceService.getById(liftingDeviceExamine.getDeviceId());
LiftingDevice liftingDevice = liftingDeviceService.getById(liftingDeviceExamineVo.getDeviceId());
if (liftingDevice == null) {
result.error500("未找到对应实体");
return result;
}
if (liftingDevice.getIdentification() != 0) {
result.error500("有未通过的申请,请通过后再提交申请");
return result;
}
boolean apply = liftingDeviceService.apply(liftingDeviceExamine);
boolean apply = liftingDeviceService.apply(liftingDeviceExamineVo);
if (apply) {
result.success("修改成功!");
} else {
@ -218,4 +221,26 @@ public class EntLiftingDeviceController {
}
return result;
}
/**
* 通过id查询详细信息
*
* @return
*/
@OperLog(operModul = "起重机械设备管理", operType = "查询", operDesc = "通过id查询起重机械设备详细信息")
@ApiOperation(value = "通过id查询起重机械设备详细信息", notes = "通过id查询起重机械设备详细信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "项目工程表ID", paramType = "body", required = true, dataType = "Integer")
@PostMapping(value = "/queryDetailById")
public Result<LiftingDeviceVo> queryDetailById(@ApiIgnore @RequestBody LiftingDevice liftingDeviceEntity) {
Result<LiftingDeviceVo> result = new Result<LiftingDeviceVo>();
LiftingDevice liftingDevice = liftingDeviceService.getById(liftingDeviceEntity.getId());
if (liftingDevice == null) {
result.error500("未找到对应实体");
} else {
LiftingDeviceVo liftingDeviceVo = liftingDeviceService.queryDetailById(liftingDeviceEntity.getId());
result.setResult(liftingDeviceVo);
result.setSuccess(true);
}
return result;
}
}

View File

@ -14,6 +14,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -57,6 +58,9 @@ public class EntLiftingDeviceExamineController {
public Result<IPage<LiftingDeviceExamine>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
QueryWrapper<LiftingDeviceExamine> queryWrapper = QueryGenerator.initPageQueryWrapper(LiftingDeviceExamine.class, map);
Page<LiftingDeviceExamine> page = PageUtil.getPage(map);
if (MapUtils.getInteger(map, "type") == 6) {
queryWrapper.in("type", "6,7");
}
IPage<LiftingDeviceExamine> pageList = liftingDeviceExamineService.page(page, queryWrapper);
return Result.success(pageList);
}

View File

@ -225,6 +225,8 @@ public class GovAcceptInspectRecordController {
if (acceptInspectRecordEntity == null) {
result.error500("未找到对应实体");
} else {
acceptInspectRecord.setCheckAcceptId(acceptInspectRecordEntity.getCheckAcceptId());
acceptInspectRecord.setDeadline(acceptInspectRecordEntity.getDeadline());
boolean ok = acceptInspectRecordService.examine(acceptInspectRecord);
if (ok) {
result.success("审批成功!");

View File

@ -48,8 +48,8 @@ public class GovLifterController {
*
* @return
*/
@OperLog(operModul = "塔吊实时数据管理", operType = "分页查询", operDesc = "分页列表查询塔吊实时数据工程信息")
@ApiOperation(value = " 分页列表查询塔吊实时数据工程信息", notes = "分页列表查询塔吊实时数据工程信息", httpMethod = "POST")
@OperLog(operModul = "升降机管理", operType = "分页查询", operDesc = "分页列表查询升降机工程信息")
@ApiOperation(value = " 分页列表查询升降机工程信息", notes = "分页列表查询升降机工程信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "engineeringName", value = "工程名称", paramType = "body", dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"),
@ -65,8 +65,8 @@ public class GovLifterController {
*
* @return
*/
@OperLog(operModul = "塔吊实时数据管理", operType = "分页查询", operDesc = "分页列表查询塔吊实时数据项目信息")
@ApiOperation(value = " 分页列表查询塔吊实时数据项目信息", notes = "分页列表查询塔吊实时数据项目信息", httpMethod = "POST")
@OperLog(operModul = "升降机管理", operType = "分页查询", operDesc = "分页列表查询升降机项目信息")
@ApiOperation(value = " 分页列表查询升降机项目信息", notes = "分页列表查询升降机项目信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectName", value = "工程名称", paramType = "body", dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"),

View File

@ -14,6 +14,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -58,6 +59,9 @@ public class GovLiftingDeviceExamineController {
public Result<IPage<LiftingDeviceExamine>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
QueryWrapper<LiftingDeviceExamine> queryWrapper = QueryGenerator.initPageQueryWrapper(LiftingDeviceExamine.class, map);
Page<LiftingDeviceExamine> page = PageUtil.getPage(map);
if (MapUtils.getInteger(map, "type") == 6) {
queryWrapper.in("type", "6,7");
}
IPage<LiftingDeviceExamine> pageList = liftingDeviceExamineService.page(page, queryWrapper);
return Result.success(pageList);
}

View File

@ -46,8 +46,8 @@ public class GovTowerCraneController {
*
* @return
*/
@OperLog(operModul = "塔吊实时数据管理", operType = "分页查询", operDesc = "分页列表查询塔吊实时数据工程信息")
@ApiOperation(value = " 分页列表查询塔吊实时数据工程信息", notes = "分页列表查询塔吊实时数据工程信息", httpMethod = "POST")
@OperLog(operModul = "塔吊起重机管理", operType = "分页查询", operDesc = "分页列表查询塔吊工程信息")
@ApiOperation(value = " 分页列表查询塔吊工程信息", notes = "分页列表查询塔吊工程信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "engineeringName", value = "工程名称", paramType = "body", dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"),
@ -63,8 +63,8 @@ public class GovTowerCraneController {
*
* @return
*/
@OperLog(operModul = "塔吊实时数据管理", operType = "分页查询", operDesc = "分页列表查询塔吊实时数据项目信息")
@ApiOperation(value = " 分页列表查询塔吊实时数据项目信息", notes = "分页列表查询塔吊实时数据项目信息", httpMethod = "POST")
@OperLog(operModul = "塔吊起重机管理", operType = "分页查询", operDesc = "分页列表查询塔吊项目信息")
@ApiOperation(value = " 分页列表查询塔吊项目信息", notes = "分页列表查询塔吊项目信息", httpMethod = "POST")
@ApiImplicitParams({
@ApiImplicitParam(name = "projectName", value = "工程名称", paramType = "body", dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"),

View File

@ -72,6 +72,7 @@ public class GovTowerCraneCurrentDataController {
if (StringUtils.isNotBlank(MapUtils.getString(map, ParamConstants.PROJECT_SN))) {
queryWrapper.lambda().eq(TowerCraneCurrentData::getEngineeringSn, StrUtil.EMPTY);
}
queryWrapper.lambda().orderByDesc(TowerCraneCurrentData::getCreateTime);
IPage<TowerCraneCurrentData> pageList = towerCraneCurrentDataService.page(page, queryWrapper);
return Result.success(pageList);
}

View File

@ -0,0 +1,17 @@
package com.zhgd.xmgl.modules.safety.dto;
import com.zhgd.xmgl.modules.basicdata.entity.AnnexFile;
import com.zhgd.xmgl.modules.safety.entity.LiftingDeviceExamine;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel(value = "起重机械设备审批信息(DTO)", description = "LiftingDeviceExamineDto")
public class LiftingDeviceExamineDto extends LiftingDeviceExamine {
@ApiModelProperty(value="起重机械设备附件")
private List<AnnexFile> annexFiles;
}

View File

@ -395,4 +395,10 @@ public class LiftingDevice implements Serializable {
@Excel(name = "升降机区市负责人现场查看承诺书", width = 15)
@ApiModelProperty(value = "升降机区市负责人现场查看承诺书")
private String lifterPrincipalCommitment;
/**
* 许可证发放机关
*/
@Excel(name = "许可证发放机关", width = 15)
@ApiModelProperty(value = "许可证发放机关")
private String licensingAuthority;
}

View File

@ -12,7 +12,6 @@ import org.apache.ibatis.annotations.Mapper;
* @version V1.0
*/
@Mapper
@DataScope(type = 2)
public interface LiftingDeviceExamineMapper extends BaseMapper<LiftingDeviceExamine> {
}

View File

@ -1,10 +1,11 @@
package com.zhgd.xmgl.modules.safety.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhgd.xmgl.modules.safety.dto.LiftingDeviceExamineDto;
import com.zhgd.xmgl.modules.safety.entity.LiftingDevice;
import com.zhgd.xmgl.modules.safety.entity.LiftingDeviceExamine;
import com.zhgd.xmgl.modules.safety.entity.LiftingDeviceUse;
import com.zhgd.xmgl.modules.safety.vo.LiftingDeviceExamineVo;
import com.zhgd.xmgl.modules.safety.vo.LiftingDeviceVo;
/**
* @Description: 起重机械设备
@ -14,11 +15,13 @@ import com.zhgd.xmgl.modules.safety.vo.LiftingDeviceExamineVo;
*/
public interface ILiftingDeviceService extends IService<LiftingDevice> {
boolean saveInfo(LiftingDevice liftingDevice);
boolean saveInfo(LiftingDeviceVo liftingDeviceVo);
boolean examine(LiftingDevice liftingDevice, LiftingDeviceExamineVo liftingDeviceExamineVo);
boolean apply(LiftingDeviceExamine liftingDeviceExamine);
boolean apply(LiftingDeviceExamineDto liftingDeviceExamineVo);
boolean useApply(LiftingDeviceUse liftingDeviceUse);
LiftingDeviceVo queryDetailById(Long id);
}

View File

@ -4,18 +4,23 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.xmgl.modules.basicdata.entity.AnnexFile;
import com.zhgd.xmgl.modules.basicdata.entity.Enterprise;
import com.zhgd.xmgl.modules.basicdata.service.IAnnexFileService;
import com.zhgd.xmgl.modules.basicdata.service.IEnterpriseService;
import com.zhgd.xmgl.modules.safety.dto.LiftingDeviceExamineDto;
import com.zhgd.xmgl.modules.safety.entity.LiftingDevice;
import com.zhgd.xmgl.modules.safety.entity.LiftingDeviceExamine;
import com.zhgd.xmgl.modules.safety.entity.LiftingDeviceUse;
import com.zhgd.xmgl.modules.safety.mapper.LiftingDeviceMapper;
import com.zhgd.xmgl.modules.basicdata.service.IEnterpriseService;
import com.zhgd.xmgl.modules.safety.service.ILiftingDeviceExamineService;
import com.zhgd.xmgl.modules.safety.service.ILiftingDeviceService;
import com.zhgd.xmgl.modules.safety.service.ILiftingDeviceUseService;
import com.zhgd.xmgl.modules.safety.vo.LiftingDeviceExamineVo;
import com.zhgd.xmgl.modules.safety.vo.LiftingDeviceVo;
import com.zhgd.xmgl.security.SecurityUser;
import com.zhgd.xmgl.security.SecurityUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -42,15 +47,23 @@ public class LiftingDeviceServiceImpl extends ServiceImpl<LiftingDeviceMapper, L
@Autowired
private IEnterpriseService enterpriseService;
@Autowired
private IAnnexFileService annexFileService;
@Override
public boolean saveInfo(LiftingDevice liftingDevice) {
public boolean saveInfo(LiftingDeviceVo liftingDeviceVo) {
SecurityUser user = SecurityUtil.getUser();
liftingDevice.setIdentification(1);
liftingDevice.setEnterpriseSn(user.getSn());
liftingDevice.setEnterpriseName(enterpriseService.getOne(Wrappers.<Enterprise>lambdaQuery().eq(Enterprise::getEnterpriseSn, user.getSn())).getEnterpriseName());
this.save(liftingDevice);
liftingDeviceVo.setIdentification(1);
liftingDeviceVo.setEnterpriseSn(user.getSn());
liftingDeviceVo.setEnterpriseName(enterpriseService.getOne(Wrappers.<Enterprise>lambdaQuery().eq(Enterprise::getEnterpriseSn, user.getSn())).getEnterpriseName());
this.save(liftingDeviceVo);
List<AnnexFile> annexFiles = liftingDeviceVo.getAnnexFiles();
annexFiles.stream().forEach(a -> {
a.setRelevanceId(liftingDeviceVo.getId().toString());
});
annexFileService.saveBatch(annexFiles);
LiftingDeviceExamine liftingDeviceExamine = new LiftingDeviceExamine();
liftingDeviceExamine.setDeviceId(liftingDevice.getId());
liftingDeviceExamine.setDeviceId(liftingDeviceVo.getId());
liftingDeviceExamine.setApplyBy(user.getUserId());
liftingDeviceExamine.setApplyName(user.getRealName());
liftingDeviceExamine.setApplyTime(new Date());
@ -93,19 +106,27 @@ public class LiftingDeviceServiceImpl extends ServiceImpl<LiftingDeviceMapper, L
}
@Override
public boolean apply(LiftingDeviceExamine liftingDeviceExamine) {
public boolean apply(LiftingDeviceExamineDto liftingDeviceExamineVo) {
SecurityUser user = SecurityUtil.getUser();
if (liftingDeviceExamine.getType() == 1 && liftingDeviceExamine.getState() == 1) {
buildProjectInspectNumber(liftingDeviceExamine);
if (liftingDeviceExamineVo.getType() == 1) {
buildProjectInspectNumber(liftingDeviceExamineVo);
}
liftingDeviceExamineVo.setApplyBy(user.getUserId());
liftingDeviceExamineVo.setApplyName(user.getRealName());
liftingDeviceExamineVo.setApplyTime(new Date());
boolean flag = liftingDeviceExamineService.save(liftingDeviceExamineVo);
if (flag) {
LambdaUpdateWrapper<LiftingDevice> wrapper = Wrappers.<LiftingDevice>lambdaUpdate();
wrapper.set(LiftingDevice::getIdentification, liftingDeviceExamine.getType());
wrapper.eq(LiftingDevice::getId, liftingDeviceExamine.getDeviceId());
wrapper.set(LiftingDevice::getIdentification, liftingDeviceExamineVo.getType());
wrapper.eq(LiftingDevice::getId, liftingDeviceExamineVo.getDeviceId());
this.update(wrapper);
liftingDeviceExamine.setApplyBy(user.getUserId());
liftingDeviceExamine.setApplyName(user.getRealName());
liftingDeviceExamine.setApplyTime(new Date());
return liftingDeviceExamineService.save(liftingDeviceExamine);
List<AnnexFile> annexFiles = liftingDeviceExamineVo.getAnnexFiles();
annexFiles.stream().forEach(a -> {
a.setRelevanceId(liftingDeviceExamineVo.getId().toString());
});
annexFileService.saveBatch(annexFiles);
}
return flag;
}
@Override
@ -121,6 +142,15 @@ public class LiftingDeviceServiceImpl extends ServiceImpl<LiftingDeviceMapper, L
return liftingDeviceUseService.save(liftingDeviceUse);
}
@Override
public LiftingDeviceVo queryDetailById(Long id) {
LiftingDeviceVo liftingDeviceVo = new LiftingDeviceVo();
LiftingDevice liftingDevice = baseMapper.selectById(id);
BeanUtils.copyProperties(liftingDevice, liftingDeviceVo);
liftingDeviceVo.setAnnexFiles(annexFileService.list(Wrappers.<AnnexFile>lambdaQuery().eq(AnnexFile::getRelevanceId, liftingDeviceVo.getId())));
return liftingDeviceVo;
}
private Integer getEquipmentType(Integer examineType) {
Integer equipmentType = 1;
switch (examineType) {
@ -143,8 +173,8 @@ public class LiftingDeviceServiceImpl extends ServiceImpl<LiftingDeviceMapper, L
return equipmentType;
}
private void buildProjectInspectNumber(LiftingDeviceExamine liftingDeviceExamine) {
LiftingDevice liftingDevice = this.getById(liftingDeviceExamine.getDeviceId());
private void buildProjectInspectNumber(LiftingDeviceExamineDto liftingDeviceExamineVo) {
LiftingDevice liftingDevice = this.getById(liftingDeviceExamineVo.getDeviceId());
Long idss = liftingDevice.getId();
if (liftingDevice.getType() == 1) {
// 长期和零时the_nature

View File

@ -0,0 +1,17 @@
package com.zhgd.xmgl.modules.safety.vo;
import com.zhgd.xmgl.modules.basicdata.entity.AnnexFile;
import com.zhgd.xmgl.modules.safety.entity.LiftingDevice;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel(value = "起重机械设备详细信息(VO)", description = "LiftingDeviceVo")
public class LiftingDeviceVo extends LiftingDevice {
@ApiModelProperty(value="起重机械设备附件")
private List<AnnexFile> annexFiles;
}

View File

@ -171,6 +171,12 @@ public class Lifter implements Serializable {
@Excel(name = "升级机所在楼层总层数", width = 15)
@ApiModelProperty(value = "升级机所在楼层总层数")
private Integer totalFloor;
/**
* 在线状态(0:离线1:在线)
*/
@Excel(name = "在线状态(0:离线1:在线)", width = 15)
@ApiModelProperty(value = "在线状态(0:离线1:在线)")
private Integer online;
/**
* 创建时间
*/

View File

@ -5,7 +5,7 @@
"groupId" : "1f3d3e5b9fe340bab84de67b0de08f44",
"name" : "在建项目指标",
"createTime" : null,
"updateTime" : 1689678565388,
"updateTime" : 1693376503935,
"lock" : null,
"createBy" : null,
"updateBy" : "admin",
@ -34,4 +34,4 @@
"responseBodyDefinition" : null
}
================================
return db.selectOne("SELECT IFNULL(SUM(IF(major_project_type = 1 AND state = 1, 1, 0)), 0) importance, IFNULL(SUM(IF(project_type = 1 AND state = 1, 1, 0)), 0) bridge, IFNULL(SUM(IF(project_type = 2 AND state = 1, 1, 0)), 0) tunnel, IFNULL(SUM(IF(project_type = 3 AND state = 1, 1, 0)), 0) station, IFNULL(SUM(IF(build_status in (0,1) AND state = 1, 1, 0)), 0) newBuild, IFNULL(SUM(IF(build_status = 5, 1, 0)), 0) reBuild, IFNULL(SUM(IF(build_status = 6, 1, 0)), 0) extension, IFNULL(SUM(IF(build_status in (0, 1, 5, 6) AND state = 1, 1, 0)), 0) total, IFNULL(SUM(IF(build_status = 4, 1, 0)), 0) finished, IFNULL(SUM(IF(build_status = 2, 1, 0)), 0) shutdown, IFNULL(SUM(IF(build_status in (1, 2, 4), 1, 0)), 0) total1 FROM project WHERE #project ")
return db.selectOne("SELECT IFNULL(SUM(IF(is_important = 1 AND examine_state = 3, 1, 0)), 0) importance, IFNULL(SUM(IF(engineering_type = 2 AND state = 2 AND examine_state = 3, 1, 0)), 0) bridge, IFNULL(SUM(IF(engineering_type = 3 AND state = 2 AND examine_state = 3, 1, 0)), 0) tunnel, IFNULL(SUM(IF(engineering_type = 4 AND state = 2 AND examine_state = 3, 1, 0)), 0) station, IFNULL(SUM(IF(state = 8, 1, 0)), 0) reBuild, IFNULL(SUM(IF(state = 9, 1, 0)), 0) extension, IFNULL(SUM(IF(state IN(2, 8, 9), 1, 0)), 0) total, IFNULL(SUM(IF(state = 7, 1, 0)), 0) finished, IFNULL(SUM(IF(state in (3, 4), 1, 0)), 0) shutdown, IFNULL(SUM(IF(state in (2, 3, 4, 7), 1, 0)), 0) total1,(SELECT COUNT( * ) FROM engineering WHERE YEAR(examine_time) = YEAR(CURDATE()) AND examine_state = 3) newBuild FROM engineering WHERE #project ")