优化新增/修改人员下发宇泛设备
This commit is contained in:
@@ -1,14 +1,22 @@
|
||||
package com.dcsoft.system.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.dcsoft.common.core.utils.CollUtil;
|
||||
import com.dcsoft.common.core.web.controller.BaseController;
|
||||
import com.dcsoft.common.core.web.domain.AjaxResult;
|
||||
import com.dcsoft.common.core.web.page.TableDataInfo;
|
||||
import com.dcsoft.common.log.annotation.Log;
|
||||
import com.dcsoft.common.log.enums.BusinessType;
|
||||
import com.dcsoft.common.security.annotation.RequiresPermissions;
|
||||
import com.dcsoft.system.domain.SysEqDownRecord;
|
||||
import com.dcsoft.system.domain.SysPeopleEqDown;
|
||||
import com.dcsoft.system.service.ISysEqDownRecordService;
|
||||
import com.dcsoft.system.uniubi.service.ISysSdkService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@@ -19,14 +27,48 @@ public class SysEqDownRecordController extends BaseController {
|
||||
@Autowired
|
||||
private ISysEqDownRecordService sysEqDownRecordService;
|
||||
|
||||
@Autowired
|
||||
protected ISysSdkService sdkService;
|
||||
|
||||
/**
|
||||
* 分页查询设备下机记录列表
|
||||
*/
|
||||
@RequestMapping("/pageList")
|
||||
@RequiresPermissions("system:delCarInfo:restore")
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(SysEqDownRecord sysEqDownRecord) {
|
||||
List<SysEqDownRecord> list = sysEqDownRecordService.pageList(sysEqDownRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@RequiresPermissions("system:eqDown:down")
|
||||
@Log(title = "人员重新下发", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/down")
|
||||
public AjaxResult down(@RequestBody List<Long> ids) {
|
||||
List<Long> failIds = new ArrayList<>();
|
||||
List<SysEqDownRecord> downRecordList = new ArrayList<>();
|
||||
List<SysPeopleEqDown> list = sysEqDownRecordService.selectListByIds(ids,null);
|
||||
for (SysPeopleEqDown sysPeopleEqDown : list) {
|
||||
SysEqDownRecord sysEqDownRecord = sdkService.authDeviceDown(sysPeopleEqDown);
|
||||
downRecordList.add(sysEqDownRecord);
|
||||
if (ObjectUtil.isNotNull(sysEqDownRecord) && sysEqDownRecord.getDownResult() == 1) {
|
||||
failIds.add(sysPeopleEqDown.getId());
|
||||
}
|
||||
}
|
||||
|
||||
//保存下发记录
|
||||
if (CollUtil.isNotEmpty(downRecordList)) {
|
||||
sysEqDownRecordService.saveBatch(downRecordList);
|
||||
}
|
||||
|
||||
if (CollUtil.isNotEmpty(failIds)) {
|
||||
return AjaxResult.error("下发失败的ID:" + failIds);
|
||||
}
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.dcsoft.common.core.constant.Constants;
|
||||
import com.dcsoft.common.core.domain.R;
|
||||
import com.dcsoft.common.core.enums.CompanyType;
|
||||
import com.dcsoft.common.core.exception.ServiceException;
|
||||
import com.dcsoft.common.core.utils.poi.ExcelUtil;
|
||||
import com.dcsoft.common.core.utils.uuid.IdUtils;
|
||||
@@ -26,7 +25,6 @@ import com.dcsoft.system.domain.*;
|
||||
import com.dcsoft.system.domain.vo.JjserInfoVo;
|
||||
import com.dcsoft.system.service.*;
|
||||
import com.dcsoft.system.uniubi.domain.Person;
|
||||
import com.dcsoft.system.uniubi.service.ISysApiService;
|
||||
import com.dcsoft.system.uniubi.service.ISysSdkService;
|
||||
import com.dcsoft.system.utils.PictureUtils;
|
||||
import com.dcsoft.system.visitor.service.IVisitorService;
|
||||
@@ -34,6 +32,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -41,8 +40,10 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -62,10 +63,7 @@ public class SysPeopleController extends BaseController
|
||||
private ISysPeopleService sysPeopleService;
|
||||
|
||||
@Autowired
|
||||
private ISysApiService sysApiService;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
private ISysEqDownRecordService sysEqDownRecordService;
|
||||
|
||||
@Autowired
|
||||
protected ISysSdkService sdkService;
|
||||
@@ -91,9 +89,6 @@ public class SysPeopleController extends BaseController
|
||||
@Autowired
|
||||
private ISysPeopleRuleService sysPeopleRuleService;
|
||||
|
||||
@Autowired
|
||||
private ISysSyncRuleService sysSyncRuleService;
|
||||
|
||||
@Autowired
|
||||
private IVisitorService visitorService;
|
||||
|
||||
@@ -152,7 +147,8 @@ public class SysPeopleController extends BaseController
|
||||
@RequiresPermissions("system:sysPeople:add")
|
||||
@Log(title = "人员管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysPeople sysPeople) throws ExecutionException, InterruptedException {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult add(@RequestBody SysPeople sysPeople) {
|
||||
SysPeople people = sysPeopleService.selectSysPeopleByGh(sysPeople.getGh());
|
||||
if (people != null) {
|
||||
return error("该工号已存在");
|
||||
@@ -170,6 +166,13 @@ public class SysPeopleController extends BaseController
|
||||
}
|
||||
sysPeople.setGuid(IdUtils.simpleUUID());
|
||||
|
||||
//携物出门审核人
|
||||
if (CollUtil.isNotEmpty(sysPeople.getCarryStuffExamineList())) {
|
||||
sysPeople.setCarryStuffExamine(String.join(",", sysPeople.getCarryStuffExamineList()));
|
||||
}
|
||||
|
||||
sysPeopleService.insertSysPeople(sysPeople);
|
||||
|
||||
//下发设备
|
||||
if (StringUtils.isNotEmpty(sysPeople.getBranchId())) {
|
||||
SysBranch branch = sysBranchService.selectSysBranchById(sysPeople.getBranchId());
|
||||
@@ -178,19 +181,13 @@ public class SysPeopleController extends BaseController
|
||||
SysRule rule = sysRuleService.selectSysRuleById(branch.getRuleId());
|
||||
int i = sdkService.authDeviceAddUpdate(rule, sysPeople, 0);
|
||||
if (i > 0) {
|
||||
return AjaxResult.error(i + "个设备下发失败!");
|
||||
throw new ServiceException(i + "个设备下发失败!");
|
||||
}
|
||||
sysPeople.setDown(1L);
|
||||
}
|
||||
}
|
||||
|
||||
//携物出门审核人
|
||||
if (CollUtil.isNotEmpty(sysPeople.getCarryStuffExamineList())) {
|
||||
sysPeople.setCarryStuffExamine(String.join(",", sysPeople.getCarryStuffExamineList()));
|
||||
}
|
||||
|
||||
int i = sysPeopleService.insertSysPeople(sysPeople);
|
||||
return toAjax(i);
|
||||
return toAjax(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -201,8 +198,6 @@ public class SysPeopleController extends BaseController
|
||||
@Log(title = "人员管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysPeople sysPeople) {
|
||||
|
||||
|
||||
SysPeople people = sysPeopleService.selectSysPeopleByGh(sysPeople.getGh());
|
||||
if (people != null && !people.getId().equals(sysPeople.getId())) {
|
||||
return error("该工号已存在");
|
||||
@@ -288,46 +283,23 @@ public class SysPeopleController extends BaseController
|
||||
*/
|
||||
@RequiresPermissions("system:sysPeople:remove")
|
||||
@Log(title = "人员管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
String cloud = configService.selectConfigByKey("sys.equipment.cloud");
|
||||
if("true".equals(cloud)) {
|
||||
String admitGuids = "";
|
||||
for (Long id : ids) {
|
||||
SysPeople people = sysPeopleService.selectSysPeopleById(id);
|
||||
admitGuids += people.getGuid() + ",";
|
||||
}
|
||||
if (!"".equals(admitGuids)) {
|
||||
admitGuids = admitGuids.substring(0, admitGuids.length() - 1);
|
||||
if (!"null".equals(admitGuids)) {
|
||||
String data = sysApiService.admitDelete(admitGuids);
|
||||
JSONObject json = JSONObject.parseObject(data);
|
||||
if ("1".equals(json.get("result") + "")) {
|
||||
} else {
|
||||
// return error(json.get("msg")+"");
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
String admitGuids = "";
|
||||
for (Long id : ids) {
|
||||
SysPeople people = sysPeopleService.selectSysPeopleById(id);
|
||||
admitGuids += people.getGuid() + ",";
|
||||
}
|
||||
if (!"".equals(admitGuids)) {
|
||||
admitGuids = admitGuids.substring(0, admitGuids.length() - 1);
|
||||
if (!"null".equals(admitGuids)) {
|
||||
SysEquipment equipment=new SysEquipment();
|
||||
equipment.setFlag("0");
|
||||
equipment.setProductId(3L);
|
||||
List<SysEquipment> list = equipmentService.selectSysEquipmentList(equipment);
|
||||
for(SysEquipment e:list){
|
||||
sdkService.personDelete(admitGuids,e.getIp(),e.getPassword());
|
||||
}
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
List<SysPeopleEqDown> list = sysEqDownRecordService.selectListByIds(null, Arrays.asList(ids));
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
for (SysPeopleEqDown sysPeopleEqDown : list) {
|
||||
if(sysPeopleEqDown.getDownResult() == 1) {
|
||||
continue;
|
||||
}
|
||||
String data = sdkService.personDelete(sysPeopleEqDown.getGuid(), sysPeopleEqDown.getIp(), sysPeopleEqDown.getPassword());
|
||||
JSONObject jsons = JSONObject.parseObject(data);
|
||||
if (jsons == null || !jsons.containsKey("code") || !StrUtil.equals("LAN_SUS-0", jsons.getString("code"))) {
|
||||
throw new ServiceException("人员删除失败:设备" + sysPeopleEqDown.getIp() + "网络异常");
|
||||
}
|
||||
}
|
||||
sysEqDownRecordService.deleteByIds(list.stream().map(SysPeopleEqDown::getId).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
//暂未处理离线设备人员数据删除
|
||||
return toAjax(sysPeopleService.deleteSysPeopleByIds(ids));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.dcsoft.system.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 人员设备下记录实体
|
||||
*/
|
||||
@Data
|
||||
public class SysPeopleEqDown {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
private Long equipmentId;
|
||||
|
||||
/**
|
||||
* 人员ID
|
||||
*/
|
||||
private Long peopleId;
|
||||
|
||||
/**
|
||||
* 规则id
|
||||
*/
|
||||
private Long ruleId;
|
||||
|
||||
/**
|
||||
* 人员名称
|
||||
*/
|
||||
private String peopleName;
|
||||
|
||||
/** 门卡号码 */
|
||||
private String doorNo;
|
||||
|
||||
/** 身份证号码 */
|
||||
private String idcard;
|
||||
|
||||
/** 联系电话 */
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 人员头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/** 人员编号对接 */
|
||||
private String guid;
|
||||
|
||||
/** 人像对接 */
|
||||
private String faceGuid;
|
||||
|
||||
/** 设备IP */
|
||||
private String ip;
|
||||
|
||||
/** 设备密码 */
|
||||
private String password;
|
||||
|
||||
/** 下机结果 0:成功 1:失败 */
|
||||
private Integer downResult;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.dcsoft.system.mapper;
|
||||
|
||||
import com.dcsoft.system.domain.SysEqDownRecord;
|
||||
import com.dcsoft.system.domain.SysPeopleEqDown;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@@ -22,4 +23,14 @@ public interface SysEqDownRecordMapper {
|
||||
* @param downRecordList 设备下发记录集合
|
||||
*/
|
||||
void insertBatch(@Param("list") List<SysEqDownRecord> downRecordList);
|
||||
|
||||
/**
|
||||
* 根据ID查询人员设备下机记录
|
||||
*
|
||||
* @param ids 人员设备下机记录ID集合
|
||||
* @return 人员设备下机记录集合
|
||||
*/
|
||||
List<SysPeopleEqDown> selectListByIds(@Param("ids") List<Long> ids, @Param("peopleIds") List<Long> peopleIds);
|
||||
|
||||
void deleteByIds(@Param("ids") List<Long> ids);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.dcsoft.system.service;
|
||||
|
||||
import com.dcsoft.system.domain.SysEqDownRecord;
|
||||
import com.dcsoft.system.domain.SysPeopleEqDown;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -8,4 +9,8 @@ public interface ISysEqDownRecordService {
|
||||
List<SysEqDownRecord> pageList(SysEqDownRecord sysEqDownRecord);
|
||||
|
||||
void saveBatch(List<SysEqDownRecord> downRecordList);
|
||||
|
||||
List<SysPeopleEqDown> selectListByIds(List<Long> ids, List<Long> peopleIds);
|
||||
|
||||
void deleteByIds(List<Long> collect);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
package com.dcsoft.system.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.dcsoft.common.security.utils.SecurityUtils;
|
||||
import com.dcsoft.system.api.model.LoginUser;
|
||||
import com.dcsoft.system.domain.SysEqDownRecord;
|
||||
import com.dcsoft.system.domain.SysPeopleEqDown;
|
||||
import com.dcsoft.system.mapper.SysEqDownRecordMapper;
|
||||
import com.dcsoft.system.service.ISysEqDownRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static com.dcsoft.common.core.utils.PageUtils.startPage;
|
||||
@@ -25,6 +31,24 @@ public class SysEqDownRecordServiceImpl implements ISysEqDownRecordService {
|
||||
|
||||
@Override
|
||||
public void saveBatch(List<SysEqDownRecord> downRecordList) {
|
||||
LoginUser user = SecurityUtils.getLoginUser();
|
||||
for (SysEqDownRecord sysEqDownRecord : downRecordList) {
|
||||
sysEqDownRecord.setCreateTime(new Date());
|
||||
sysEqDownRecord.setCreateBy(user.getUsername());
|
||||
}
|
||||
sysEqDownRecordMapper.insertBatch(downRecordList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysPeopleEqDown> selectListByIds(List<Long> ids, List<Long> peopleIds) {
|
||||
return sysEqDownRecordMapper.selectListByIds(ids, peopleIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByIds(List<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return;
|
||||
}
|
||||
sysEqDownRecordMapper.deleteByIds(ids);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,15 +2,13 @@ package com.dcsoft.system.uniubi.service;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.dcsoft.system.domain.SysEquipment;
|
||||
import com.dcsoft.system.domain.SysPeople;
|
||||
import com.dcsoft.system.domain.SysPeopleRecord;
|
||||
import com.dcsoft.system.domain.SysRule;
|
||||
import com.dcsoft.system.domain.*;
|
||||
import com.dcsoft.system.uniubi.domain.Person;
|
||||
import com.dcsoft.system.visitor.domain.Visitor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Uface 服务层
|
||||
@@ -125,4 +123,6 @@ public interface ISysSdkService {
|
||||
String authDevices(SysPeople people, SysEquipment equipment);
|
||||
|
||||
int authDeviceAddUpdate(SysRule rule, SysPeople sysPeople, Integer operType);
|
||||
|
||||
SysEqDownRecord authDeviceDown(SysPeopleEqDown sysPeopleEqDown);
|
||||
}
|
||||
|
||||
@@ -728,7 +728,7 @@ public class SysSdkServiceImpl implements ISysSdkService {
|
||||
person.setId(people.getGuid());
|
||||
|
||||
//删除人员信息
|
||||
if (operType == 0) {
|
||||
if (operType == 1) {
|
||||
String data = this.personDelete(person.getId(), e.getIp(), e.getPassword());
|
||||
if (!verifyResult(data, sysEqDownRecord)) {
|
||||
i++;
|
||||
@@ -758,6 +758,45 @@ public class SysSdkServiceImpl implements ISysSdkService {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysEqDownRecord authDeviceDown(SysPeopleEqDown sysPeopleEqDown) {
|
||||
SysEqDownRecord sysEqDownRecord = new SysEqDownRecord();
|
||||
sysEqDownRecord.setEquipmentId(sysPeopleEqDown.getEquipmentId());
|
||||
sysEqDownRecord.setPeopleId(sysPeopleEqDown.getPeopleId());
|
||||
sysEqDownRecord.setRuleId(sysPeopleEqDown.getRuleId());
|
||||
sysEqDownRecord.setOperType(2);
|
||||
sysEqDownRecord.setDownTime(new Date());
|
||||
|
||||
//将人员信息下发到设备
|
||||
Person person = new Person();
|
||||
person.setName(sysPeopleEqDown.getPeopleName());
|
||||
person.setIdcardNum(sysPeopleEqDown.getDoorNo());
|
||||
person.setiDNumber(sysPeopleEqDown.getIdcard());
|
||||
person.setPhone(sysPeopleEqDown.getPhone());
|
||||
person.setId(sysPeopleEqDown.getGuid());
|
||||
|
||||
//删除人员信息
|
||||
String data = this.personDelete(person.getId(), sysPeopleEqDown.getIp(), sysPeopleEqDown.getPassword());
|
||||
if (!verifyResult(data, sysEqDownRecord)) {
|
||||
return sysEqDownRecord;
|
||||
}
|
||||
|
||||
//新增人员信息
|
||||
String data1 = this.personCreate(person, sysPeopleEqDown.getIp(), sysPeopleEqDown.getPassword());
|
||||
if (!verifyResult(data1, sysEqDownRecord)) {
|
||||
return sysEqDownRecord;
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(sysPeopleEqDown.getFaceGuid())) {
|
||||
String dataImg = this.imageCreateUrl(sysPeopleEqDown.getGuid(), sysPeopleEqDown.getFaceGuid(), sysPeopleEqDown.getAvatar(), sysPeopleEqDown.getIp(), sysPeopleEqDown.getPassword());
|
||||
if (!verifyResult(dataImg, sysEqDownRecord)) {
|
||||
return sysEqDownRecord;
|
||||
}
|
||||
}
|
||||
|
||||
return sysEqDownRecord;
|
||||
}
|
||||
|
||||
private Boolean verifyResult(String data, SysEqDownRecord eqDownRecord) {
|
||||
eqDownRecord.setMsg(data);
|
||||
JSONObject jsons = JSONObject.parseObject(data);
|
||||
|
||||
@@ -59,6 +59,13 @@
|
||||
create_time = values(create_time);
|
||||
</insert>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
delete from sys_equipment_down_record where id in
|
||||
<foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="selectList" parameterType="SysEqDownRecord" resultMap="SysEqDownRecordResult">
|
||||
select
|
||||
@@ -95,4 +102,39 @@
|
||||
order by r.create_time desc,r.id desc
|
||||
</select>
|
||||
|
||||
<select id="selectListByIds" resultType="com.dcsoft.system.domain.SysPeopleEqDown">
|
||||
select
|
||||
r.id,
|
||||
e.`ip` ip,
|
||||
e.password password,
|
||||
p.`name` peopleName,
|
||||
p.avatar,
|
||||
p.door_no doorNo,
|
||||
p.idcard,
|
||||
p.guid,
|
||||
p.face_guid faceGuid,
|
||||
p.phone phone,
|
||||
r.people_id peopleId,
|
||||
r.equipment_id equipmentId,
|
||||
r.rule_id ruleId,
|
||||
r.down_result downResult
|
||||
from sys_equipment_down_record r
|
||||
left join sys_equipment e on r.equipment_id = e.id
|
||||
left join sys_people p on r.people_id = p.id
|
||||
where
|
||||
<if test="ids != null and ids.size() > 0">
|
||||
r.id in
|
||||
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="peopleIds != null and peopleIds.size() > 0">
|
||||
r.people_id in
|
||||
<foreach collection="peopleIds" item="peopleId" open="(" close=")" separator=",">
|
||||
#{peopleId}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user