|
|
@@ -1,11 +1,12 @@
|
|
|
package com.lc.ibps.components.equipment.provider;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
+import com.lc.ibps.base.core.util.Collections;
|
|
|
+import com.lc.ibps.base.core.util.string.StringFormater;
|
|
|
+import com.lc.ibps.base.framework.table.ICommonDao;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
@@ -44,6 +45,8 @@ public class EquipmentCardProvider extends GenericProvider implements IEquipment
|
|
|
|
|
|
@Resource
|
|
|
private EquipmentCardRepository equipmentCardRepository;
|
|
|
+ @Resource
|
|
|
+ private ICommonDao iCommonDao;
|
|
|
|
|
|
@ApiOperation(value = "设备档案卡列表(分页条件查询)数据", notes = "设备档案卡列表(分页条件查询)数据")
|
|
|
@Override
|
|
|
@@ -63,6 +66,36 @@ public class EquipmentCardProvider extends GenericProvider implements IEquipment
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public APIResult<Map<String, Object>> grantor(
|
|
|
+ @RequestParam(required = true) String id) {
|
|
|
+ APIResult<Map<String, Object>> result = new APIResult<>();
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ String sql = " SELECT " +
|
|
|
+ " a.she_bei_ming_chen, " +
|
|
|
+ " a.she_bei_bian_hao_, " +
|
|
|
+ " a.bian_zhi_shi_jian, " +
|
|
|
+ " b.xing_ming_, " +
|
|
|
+ " b.gang_wei_, " +
|
|
|
+ " b.yuan_gong_bian_ha, " +
|
|
|
+ " b.ren_yuan_ming_, " +
|
|
|
+ " e.positions_, " +
|
|
|
+ " GROUP_CONCAT(p.name_ ORDER BY FIND_IN_SET(p.id_, e.positions_)) AS pname_ " +
|
|
|
+ " FROM t_sbsysqb a " +
|
|
|
+ " JOIN t_sbsysqryb b ON a.id_ = b.parent_id_ " +
|
|
|
+ " JOIN ibps_party_employee e ON b.xing_ming_ = e.id_ " +
|
|
|
+ " LEFT JOIN ibps_party_position p ON FIND_IN_SET(p.id_, e.positions_) where a.she_bei_ming_chen = '%s' " +
|
|
|
+ " GROUP BY a.id_, b.id_, e.id_ ";
|
|
|
+ sql = String.format(sql,id);
|
|
|
+ List <Map<String, Object>> list = (List<Map<String, Object>>) iCommonDao.query(sql);
|
|
|
+ if(Collections.isNotEmpty(list)){
|
|
|
+ result.setData(map);
|
|
|
+ }
|
|
|
+ result.setState(StateEnum.SUCCESS.getCode());
|
|
|
+ result.setMessage(StateEnum.SUCCESS.getText());
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "根据id查询设备档案卡", notes = "根据id查询设备档案卡")
|
|
|
@Override
|
|
|
public APIResult<EquipmentCardPo> get(
|