Compare commits

...

2 Commits

17 changed files with 772 additions and 29 deletions

View File

@ -101,6 +101,10 @@ public class HttpStatus
*iot设备定位地址
*/
public static final String LAST_POSITION_URL = "http://gps51.com/webapi?action=lastposition&token=";
/**
*iot设备获取地址
*/
public static final String REPORT_OF_FLINE = "http://gps51.com/webapi?action=reportoffline&token=";
/**
*iot查询行程地址

View File

@ -147,6 +147,8 @@ public class BmProjectLot {
private String latitude;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "省份")
private String province;
/** 导出选中列表 */
private List<Long> dataCondition;

View File

@ -6,6 +6,7 @@ import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import com.bonus.sgzb.largeScreen.domain.*;
import com.bonus.sgzb.largeScreen.service.ILargeScreenService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
@ -68,11 +69,16 @@ public class LargeScreenController extends BaseController {
}
}
@Log(title = "设备分布图",businessType = BusinessType.QUERY)
@PostMapping("getEquipmentDisByMap")
@Log(title = "获取省份信息",businessType = BusinessType.QUERY)
@GetMapping("getEquipmentDisByMap")
public AjaxResult getEquipmentDisByMap(ParamsDto dto) {
return service.getEquipmentDisByMap(dto);
}
@Log(title = "获取工程经纬度、地址",businessType = BusinessType.QUERY)
@GetMapping("getEquipmentDis")
public AjaxResult getEquipmentDis(ParamsDto dto) {
return service.getEquipmentDis(dto);
}
@Log(title = "施工机具/安全工器具总保有量",businessType = BusinessType.QUERY)
@PostMapping("getTotalOwnership")
@ -233,8 +239,40 @@ public class LargeScreenController extends BaseController {
@Log(title = "获取iot编码绑定设备", businessType = BusinessType.QUERY)
@GetMapping("getIotMaCodeMachine")
public AjaxResult getIotMaCodeMachine() {
List<IotMaCodeMachine> iotMaCodeMachine = service.getIotMaCodeMachine();
public AjaxResult getIotMaCodeMachine(String province) {
List<IotMaCodeMachine> iotMaCodeMachine = service.getIotMaCodeMachine(province);
return AjaxResult.success(iotMaCodeMachine);
}
/**
* 领料记录列表
*/
@ApiOperation(value = "大屏二级页面--领料记录列表")
@GetMapping("/getLeaseRecordListByLotId")
public AjaxResult getLeaseRecordListByLotId(LeaseRecord leaseRecord) {
startPage();
List<LeaseRecord> list = service.getLeaseRecordList(leaseRecord);
return AjaxResult.success(getDataTable(list));
}
/**
* 领料记录列表
*/
@ApiOperation(value = "大屏二级页面--退料记录列表")
@GetMapping("/getBackRecordListByLotId")
public AjaxResult getBackRecordListByLotId(BackRecord backRecord) {
startPage();
List<BackRecord> list = service.getBackRecordListByLotId(backRecord);
return AjaxResult.success(getDataTable(list));
}
/**
* 领料记录列表
*/
@ApiOperation(value = "大屏二级页面--查询工程在用设备数量")
@GetMapping("/getUseNumByLotId")
public AjaxResult getUseNumByLotId(LeaseRecord leaseRecord) {
LeaseRecord leaseRecords = service.getUseNumByLotId(leaseRecord);
return AjaxResult.success(leaseRecords);
}
}

View File

@ -0,0 +1,185 @@
package com.bonus.sgzb.largeScreen.domain;
import com.bonus.sgzb.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @description 综合查询--退料查询
* @author hay
* @date 2024/2/26 14:51
*/
@Data
public class BackRecord {
private static final long serialVersionUID = 2227217051604273598L;
@ApiModelProperty(value = "")
private Integer id;
/**
* 类型名称
*/
@ApiModelProperty(value = "类型名称")
@Excel(name = "机具名称")
private String typeName;
/**
* 规格ID
*/
@ApiModelProperty(value = "规格ID")
private Integer typeId;
/**
* 规格型号
*/
@ApiModelProperty(value = "规格型号")
@Excel(name = "机具规格")
private String typeModelName;
/**
* 退料单号
*/
@ApiModelProperty(value = "退料单号")
@Excel(name = "退料单号")
private String code;
/**
* 协议号
*/
@ApiModelProperty(value = "协议号")
private String agreementCode;
/**
* 设备编码
*/
@ApiModelProperty(value = "设备编码")
@Excel(name = "设备编码")
private String maCode;
/**
* 计量单位
*/
@ApiModelProperty(value = "计量单位")
private String unit;
/**
* 退料数量
*/
@ApiModelProperty(value = "退料数量")
@Excel(name = "退料数量",cellType = Excel.ColumnType.NUMERIC)
private Double backNum;
/**
* 退料人
*/
@ApiModelProperty(value = "退料人")
@Excel(name = "退料人")
private String backPerson;
/**
* 创建者
*/
@ApiModelProperty(value = "创建者")
private String createBy;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "退料日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 更新者
*/
@ApiModelProperty(value = "更新者")
private String updateBy;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间 ")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/**
* 退料单位Id
*/
@ApiModelProperty(value = "退料单位Id")
private Integer unitId;
/**
* 退料单位
*/
@ApiModelProperty(value = "退料单位")
@Excel(name = "退料单位")
private String unitName;
/**
* 退料工程Id
*/
@ApiModelProperty(value = "退料工程Id")
private Integer lotId;
/**
* 退料工程
*/
@ApiModelProperty(value = "退料工程")
@Excel(name = "退料工程")
private String proName;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remark;
/**
* 关键字
*/
@ApiModelProperty(value = "关键字")
private String keyWord;
@ApiModelProperty(value="开始时间")
private String startTime;
@ApiModelProperty(value="结束时间")
private String endTime;
/**
* 设备所属类型
*/
@ApiModelProperty(value = "数据所属组织")
private Integer companyId;
/**
* 装备管理方式(0编号 1计数)
*/
@ApiModelProperty(value = "装备管理方式")
private int manageType;
/**
* 装备管理方式(0编号 1计数)
*/
@ApiModelProperty(value = "装备管理方式名称")
private String manageTypeName;
/**
* 实时库存
*/
@ApiModelProperty(value = "实时库存")
private Double num;
}

View File

@ -0,0 +1,22 @@
package com.bonus.sgzb.largeScreen.domain;
import lombok.Data;
import java.util.List;
/**
* @author 10488
* 设备分布-VO
*/
@Data
public class EquipmentDis {
/**
* 省份
*/
private String province;
/**
* 工程数量
*/
private Integer num;
}

View File

@ -2,6 +2,8 @@ package com.bonus.sgzb.largeScreen.domain;
import lombok.Data;
import java.util.List;
/**
* @author 10488
* 设备分布-VO
@ -9,15 +11,41 @@ import lombok.Data;
@Data
public class EquipmentDisVo {
/** 经度*/
/**
* 经度
*/
private String lon;
/** 维度*/
/**
* 维度
*/
private String lat;
/** 工程名称*/
/**
* 工程名称
*/
private String lotName;
/**
* 工程id
*/
private Integer lotId;
/** 机具类型名称*/
/**
* 机具类型名称
*/
private String typeName;
/**
* 省份
*/
private String province;
/**
* 工程数量
*/
private Integer num;
private String longitude;
private String latitude;
private String address;
List<EquipmentDisVo> EquipmentDisList;
}

View File

@ -45,8 +45,17 @@ public class IotMaCodeMachine {
* 绑定状态
*/
private String bindStatus;
/**
* 省份
*/
private String province;
/**
* 协议id
*/
private String agreementId;
/**
* 当前位置
*/
private IotLocationVo iotLocationVo;
private IotLocationVo iotLocationVo1;
}

View File

@ -0,0 +1,205 @@
package com.bonus.sgzb.largeScreen.domain;
import com.bonus.sgzb.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @author hay
* @date 2024/2/26 14:51
*/
@Data
public class LeaseRecord {
private static final long serialVersionUID = 2227217051604273598L;
@ApiModelProperty(value = "")
private Integer id;
/**
* 类型名称
*/
@ApiModelProperty(value = "类型名称")
@Excel(name = "机具名称")
private String typeName;
/**
* 规格ID
*/
@ApiModelProperty(value = "规格ID")
private Integer typeId;
/**
* 规格型号
*/
@ApiModelProperty(value = "规格型号")
@Excel(name = "机具规格")
private String typeModelName;
/**
* 协议号
*/
@ApiModelProperty(value = "协议号")
@Excel(name = "协议号")
private String agreementCode;
/**
* 设备编码
*/
@ApiModelProperty(value = "设备编码")
@Excel(name = "设备编码")
private String maCode;
/**
* 领料单号
*/
@ApiModelProperty(value = "领料单号")
@Excel(name = "领料单号")
private String code;
/**
* 车牌号
*/
@ApiModelProperty(value = "车牌号")
@Excel(name = "车牌号")
private String carCode;
/**
* 计量单位
*/
@ApiModelProperty(value = "计量单位")
@Excel(name = "单位")
private String unit;
/**
* 预领料数
*/
@ApiModelProperty(value = "预领料数")
@Excel(name = "领料数量", cellType = Excel.ColumnType.NUMERIC)
private Double preNum;
/**
* 领料人
*/
@ApiModelProperty(value = "领料人")
@Excel(name = "领料人")
private String leasePerson;
/**
* 创建者
*/
@ApiModelProperty(value = "创建者")
private String createBy;
/**
* 创建时间
*/
@ApiModelProperty(value = "创建时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "领料日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 更新者
*/
@ApiModelProperty(value = "更新者")
private String updateBy;
/**
* 更新时间
*/
@ApiModelProperty(value = "更新时间 ")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
/**
* 领料单位Id
*/
@ApiModelProperty(value = "领料单位Id")
private Integer unitId;
/**
* 领料单位
*/
@ApiModelProperty(value = "领料单位")
@Excel(name = "领料单位")
private String unitName;
/**
* 领料工程Id
*/
@ApiModelProperty(value = "领料工程Id")
private Integer lotId;
/**
* 领料工程
*/
@ApiModelProperty(value = "领料工程")
@Excel(name = "领料工程")
private String proName;
/**
* 备注
*/
@ApiModelProperty(value = "备注")
private String remark;
/**
* 关键字
*/
@ApiModelProperty(value = "关键字")
private String keyWord;
@ApiModelProperty(value = "开始时间")
private String startTime;
@ApiModelProperty(value = "结束时间")
private String endTime;
/**
* 设备所属类型
*/
@ApiModelProperty(value = "数据所属组织")
private Integer companyId;
/**
* 装备管理方式(0编号 1计数)
*/
@ApiModelProperty(value = "装备管理方式")
private int manageType;
/**
* 装备管理方式(0编号 1计数)
*/
@ApiModelProperty(value = "装备管理方式名称")
private String manageTypeName;
/**
* 实时库存
*/
@ApiModelProperty(value = "实时库存")
private Double num;
/**
* 机具在用数量
*/
@ApiModelProperty(value = "机具在用数量")
private Integer useNumJj;
/**
* 调试在用数量
*/
@ApiModelProperty(value = "调试在用数量")
private Integer useNumTs;
/**
* 设备负责人
*/
@ApiModelProperty(value = "设备负责人")
private String typeKeepName;
}

View File

@ -27,6 +27,7 @@ public class ParamsDto {
* 类型 验收1 入库2
* */
private String type;
private String province;
/**
* 公司id

View File

@ -47,7 +47,7 @@ public interface LargeScreenMapper {
* @author cwchen
* @date 2023/12/13 15:04
*/
List<EquipmentDisVo> getEquipmentDisByMap(ParamsDto dto);
List<EquipmentDis> getEquipmentDisByMap(ParamsDto dto);
/**
* @param dto
@ -172,5 +172,15 @@ public interface LargeScreenMapper {
*/
List<AccessVo> getRepairList(ParamsDto dto);
List<IotMaCodeMachine> getIotMaCodeMachine();
List<IotMaCodeMachine> getIotMaCodeMachine(String province);
List<EquipmentDisVo> getEquipmentDis(ParamsDto dto);
List<LeaseRecord> getLeaseRecordList(LeaseRecord leaseRecord);
String getTypeKeepName(LeaseRecord record);
Double getUseNumByLotId(LeaseRecord leaseRecord);
List<BackRecord> getBackRecordList(BackRecord backRecord);
}

View File

@ -169,5 +169,13 @@ public interface ILargeScreenService {
*/
AjaxResult getMaintenanceChartByMonth(ParamsDto dto);
List<IotMaCodeMachine> getIotMaCodeMachine();
List<IotMaCodeMachine> getIotMaCodeMachine(String province);
AjaxResult getEquipmentDis(ParamsDto dto);
List<LeaseRecord> getLeaseRecordList(LeaseRecord lotId);
LeaseRecord getUseNumByLotId(LeaseRecord leaseRecord);
List<BackRecord> getBackRecordListByLotId(BackRecord backRecord);
}

View File

@ -81,13 +81,8 @@ public class LargeScreenServiceImpl implements ILargeScreenService {
@Override
public AjaxResult getEquipmentDisByMap(ParamsDto dto) {
List<EquipmentDisVo> list = new ArrayList<>();
try {
} catch (Exception e) {
log.error("设备分布", e);
}
return AjaxResult.success(list);
List<EquipmentDis> equipmentDisByMap = mapper.getEquipmentDisByMap(dto);
return AjaxResult.success(equipmentDisByMap);
}
@Override
@ -365,14 +360,54 @@ public class LargeScreenServiceImpl implements ILargeScreenService {
}
@Override
public List<IotMaCodeMachine> getIotMaCodeMachine() {
List<IotMaCodeMachine> iotMaCodeMachine = mapper.getIotMaCodeMachine();
public List<IotMaCodeMachine> getIotMaCodeMachine(String province) {
List<IotMaCodeMachine> iotMaCodeMachine = mapper.getIotMaCodeMachine(province);
for (IotMaCodeMachine maCodeMachine : iotMaCodeMachine) {
getLocation(maCodeMachine);
getLocation(maCodeMachine);
}
return iotMaCodeMachine;
}
@Override
public AjaxResult getEquipmentDis(ParamsDto dto) {
List<EquipmentDisVo> equipmentDis = mapper.getEquipmentDis(dto);
return AjaxResult.success(equipmentDis);
}
@Override
public List<LeaseRecord> getLeaseRecordList(LeaseRecord leaseRecord) {
List<LeaseRecord> leaseRecordList = mapper.getLeaseRecordList(leaseRecord);
for (LeaseRecord record : leaseRecordList) {
String typeKeepName = mapper.getTypeKeepName(record);
record.setTypeKeepName(typeKeepName);
}
return leaseRecordList;
}
@Override
public LeaseRecord getUseNumByLotId(LeaseRecord leaseRecord) {
LeaseRecord leaseRecord1 = new LeaseRecord();
leaseRecord.setCompanyId(101);
Double useNumCom1 = mapper.getUseNumByLotId(leaseRecord);
if (useNumCom1 == null){
useNumCom1 = 0.00;
}
leaseRecord.setCompanyId(102);
Double useNumCom2 = mapper.getUseNumByLotId(leaseRecord);
if (useNumCom2 == null){
useNumCom2 = 0.00;
}
leaseRecord1.setUseNumJj(useNumCom1.intValue());
leaseRecord1.setUseNumTs(useNumCom2.intValue());
return leaseRecord1;
}
@Override
public List<BackRecord> getBackRecordListByLotId(BackRecord backRecord) {
List<BackRecord> leaseRecordList = mapper.getBackRecordList(backRecord);
return leaseRecordList;
}
public void getLocation(IotMaCodeMachine iotMaCodeMachine) {
log.info("getLocation:{}", iotMaCodeMachine);
if (iotMaCodeMachine == null || iotMaCodeMachine.getIotCode() == null) {
@ -392,8 +427,11 @@ public class LargeScreenServiceImpl implements ILargeScreenService {
map.put("deviceids", list);
String param = JSON.toJSONString(map);
String res = HttpHelper.doPost(HttpStatus.LAST_POSITION_URL + redisCode, param);
String res1 = HttpHelper.doPost(HttpStatus.REPORT_OF_FLINE + redisCode, param);
//对返回的结果进行解析
IotLocationVo iotLocationVo = resultDataHandler(res);
String address = resultDataHandler1(res1);
iotLocationVo.setAddress(address);
iotMaCodeMachine.setIotLocationVo(iotLocationVo);
}
@ -408,7 +446,7 @@ public class LargeScreenServiceImpl implements ILargeScreenService {
if ("0".equals(status) && "OK".equals(cause)) {
String records = object.getString("records");
//判断返回结果是否为空
if (records != null){
if (records != null) {
JSONArray jsonArray = JSON.parseArray(records);
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject = JSONObject.from(jsonArray.getJSONObject(i));
@ -421,6 +459,22 @@ public class LargeScreenServiceImpl implements ILargeScreenService {
}
return iotLocationVo;
}
private String resultDataHandler1(String res) {
if (res == null) {
throw new RuntimeException(ExceptionEnum.RETURN_DATA_IS_EMPTY.getMsg());
}
String address = "";
JSONObject object = JSONObject.parseObject(res);
String status = object.getString("status");
String cause = object.getString("cause");
if ("0".equals(status) && "OK".equals(cause)) {
JSONObject addressmap = object.getJSONObject("addressmap");
for (String s : addressmap.keySet()) {
address = addressmap.get(s).toString();
}
}
return address;
}
@Override
public AjaxResult getTotalOwnership() {

View File

@ -2,11 +2,40 @@
server:
port: 29301
# Spring Boot Actuator V2中风险漏洞处理禁止远程端口访问
management:
endpoint:
env:
enabled: false
# Spring
spring:
spring:
application:
# 应用名称
name: sgzb-base
profiles:
# 环境配置
active: sgzb_cloud_local
active: sgzb_cloud_local
cloud:
loadbalancer:
# 关闭Ribbon的负载均衡器
ribbon:
enabled: false
# 开启Nacos的负载均衡器
nacos:
enabled: true
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
namespace: sgzb_cloud_dev_nxjj
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
namespace: sgzb_cloud_dev_nxjj
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -321,7 +321,7 @@
<if test="fileUrl != null and fileUrl != ''">
file_url,
</if>
<if test="companyId != null">
<if test="companyId != null and companyId !=''">
company_id,
</if>
create_time
@ -361,7 +361,7 @@
<if test="fileUrl != null and fileUrl != ''">
#{fileUrl},
</if>
<if test="companyId != null">
<if test="companyId != null and companyId !=''">
#{companyId},
</if>
NOW()
@ -718,6 +718,7 @@
IFNULL(bad.audit_num,0)-IFNULL(aa.back_num,0) as num,
bb.finished_back_num,
mt.manage_type as manageType,
mt.company_id as companyId,
CONCAT('NSJJ',mt.`code`,mt.model_code) as `code`
FROM
back_apply_details bad

View File

@ -1129,6 +1129,7 @@
mt2.type_name as typeName,
mt.type_name as typeModelName,
mt.manage_type as manageType,
mt.company_id as companyId,
GROUP_CONCAT(su.user_id) as userId,
GROUP_CONCAT(su.nick_name) as userName,
lad.status as status,
@ -1312,6 +1313,7 @@
ifnull(lad.al_num,0) as alNum,
mt2.type_name as typeName,
mt.type_name as typeModelName,
mt.company_id as companyId,
mt.manage_type as manageType,
GROUP_CONCAT(su.nick_name) as userName,
GROUP_CONCAT(su.user_id) as userId,

View File

@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!--<include refid="bmProjectInfo"/>-->
select a.lot_id, a.pro_id, a.lot_name, a.status, a.type_id, a.link_man, a.telphone, a.own_pro, a.dept_id, a.is_share,
a.lon, a.lat, a.del_flag, a.create_by, a.create_time,a.remark,a.company_id ,b.dept_name, c.name,a.start_date,a.completion_date,
a.longitude,a.latitude,a.address
a.longitude,a.latitude,a.address,a.province
from bm_project_lot a
left join sys_dept b on a.dept_id = b.dept_id
left join sys_dic c on a.type_id = c.id
@ -121,6 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="longitude != null and longitude != ''">longitude,</if>
<if test="latitude != null and latitude != ''">latitude,</if>
<if test="address != null and address != ''">address,</if>
<if test="province != null and province != ''">province,</if>
create_time
)values(
<if test="lotName != null and lotName != ''">#{lotName},</if>
@ -141,6 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="longitude != null and longitude != ''">#{longitude},</if>
<if test="latitude != null and latitude != ''">#{latitude},</if>
<if test="address != null and address != ''">#{address},</if>
<if test="province != null and province != ''">#{province},</if>
sysdate()
)
</insert>
@ -162,6 +164,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
<if test="startDate != null and startDate != ''">start_date = #{startDate},</if>
<if test="completionDate != null and completionDate != ''">completion_date = #{completionDate},</if>
<if test="longitude != null and longitude != ''">longitude = #{longitude},</if>
<if test="latitude != null and latitude != ''">latitude = #{latitude},</if>
<if test="address != null and address != ''">address = #{address},</if>
update_time = sysdate()
</set>

View File

@ -41,7 +41,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
</select>
<!--设备分布-->
<select id="getEquipmentDisByMap" resultType="com.bonus.sgzb.largeScreen.domain.EquipmentDisVo"></select>
<select id="getEquipmentDisByMap" resultType="com.bonus.sgzb.largeScreen.domain.EquipmentDis">
select count(*) as num,province from bm_project_lot where province is not null
<if test="province!=null and province != ''">
AND province = #{province}
</if>
GROUP BY province
</select>
<!--新购验收入库分析-->
<select id="getAcceptanceStorage" resultType="java.util.Map">
/*验收*/
@ -891,6 +897,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt.type_name as typeModelName,
mt1.type_name as typeName,
bpl.lot_id as projectId,
sai.agreement_id as agreementId,
bpl.lot_name as projectName,
sd.name as maStatus,
mm.type_id,
@ -910,7 +917,141 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN bm_project_lot bpl ON bai.project_id = bpl.lot_id
WHERE
im.bind_status = 0
AND imb.unbind_time IS NULL and sai.`status` = 0
AND imb.unbind_time IS NULL and sai.`status` = 0 and bpl.province = #{province}
</select>
<select id="getEquipmentDis" resultType="com.bonus.sgzb.largeScreen.domain.EquipmentDisVo">
select longitude,
lot_id as lotId,
latitude,
lot_name as lotName,
address,
province
from bm_project_lot where province = #{province}
</select>
<select id="getLeaseRecordList" resultType="com.bonus.sgzb.largeScreen.domain.LeaseRecord">
SELECT
mt2.type_name AS typeName,
lai.lease_person AS leasePerson,
mt.type_id AS typeId,
mt.type_name AS typeModelName,
bai.agreement_code AS agreementCode,
mm.ma_code AS maCode,
mt.unit_name AS unit,
lod.out_num AS preNum,
lai.`code` AS code,
lod.create_time AS createTime,
bpl.lot_name AS proName,
lod.car_code AS carCode,
bui.unit_name AS unitName
FROM
lease_out_details lod
LEFT JOIN lease_apply_info lai ON lai.id = lod.parent_id
LEFT JOIN tm_task_agreement tta ON tta.task_id = lai.task_id
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bai.project_id
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
LEFT JOIN ma_type mt ON mt.type_id = lod.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
LEFT JOIN ma_machine mm ON mm.ma_id = lod.ma_id
WHERE
bpl.lot_id = #{lotId}
<if test="code != null and code != ''">
and lai.code = #{code}
</if>
<if test="typeId != null">
and mt.type_id = #{typeId}
</if>
<if test="unitId != null">
and bui.unit_id = #{unitId}
</if>
<if test="companyId != null">
and lod.company_id = #{companyId}
</if>
order by lod.create_time desc
</select>
<select id="getTypeKeepName" resultType="java.lang.String">
SELECT
group_concat(su.nick_name) as typeKeepName
FROM
ma_type mt
LEFT JOIN ma_type_keeper mtk ON mt.type_id = mtk.type_id
LEFT JOIN sys_user su ON mtk.user_id = su.user_id
WHERE
mtk.type_id = #{typeId}
</select>
<select id="getUseNumByLotId" resultType="java.lang.Double">
SELECT
IFNULL( t1.outNum, 0 ) - IFNULL( t2.backNum, 0 ) AS useNum
FROM
(
SELECT
SUM( lod.out_num ) AS outNum,
bai.unit_id,
bai.project_id
FROM
lease_out_details lod
LEFT JOIN lease_apply_info lai ON lai.id = lod.parent_id
LEFT JOIN tm_task_agreement tta ON tta.task_id = lai.task_id
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bai.project_id
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
LEFT JOIN ma_type mt ON mt.type_id = lod.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
WHERE
bpl.lot_id = #{lotId}
AND lod.company_id = #{companyId}
GROUP BY
bai.project_id
) t1
LEFT JOIN (
SELECT
SUM( bcd.back_num ) AS backNum,
bai.unit_id,
bai.project_id
FROM
back_check_details bcd
LEFT JOIN back_apply_info bapi ON bapi.id = bcd.parent_id
LEFT JOIN tm_task_agreement tta ON tta.task_id = bapi.task_id
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bai.project_id
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
LEFT JOIN ma_type mt ON mt.type_id = bcd.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
WHERE
bpl.lot_id = #{lotId}
AND bcd.company_id = #{companyId}
GROUP BY
bai.project_id,
bcd.company_id
) t2 ON t1.unit_id = t2.unit_id
AND t1.project_id = t2.project_id
</select>
<select id="getBackRecordList" resultType="com.bonus.sgzb.largeScreen.domain.BackRecord">
SELECT
mt2.type_name AS typeName,
mt.type_name AS typeModelName,
baif.`code`,
mm.ma_code AS maCode,
bcd.back_num AS backNum,
baif.back_person AS backPerson,
bcd.create_time AS createTime,
bpl.lot_name AS proName,
bui.unit_name AS unitName
FROM
back_check_details bcd
LEFT JOIN back_apply_info baif ON baif.id = bcd.parent_id
LEFT JOIN tm_task_agreement tta ON tta.task_id = baif.task_id
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bai.project_id
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
LEFT JOIN ma_type mt ON mt.type_id = bcd.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
LEFT JOIN ma_machine mm ON mm.ma_id = bcd.ma_id
WHERE
bpl.lot_id = #{lotId}
ORDER BY
bcd.create_time DESC
</select>
</mapper>