指标库新增web页面树形接口
This commit is contained in:
parent
142e628102
commit
72d6e516de
@ -40,6 +40,30 @@ public class IndexLibController extends DefaultBaseController {
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "web页面指标库树形列表", notes = "web页面指标库树形列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listztreeweb")
|
||||
public List<IndexLibZTreeDTO> listZTreeWeb() {
|
||||
Map<String, Object> params = requestParams();
|
||||
String indexLibParentId = "0";
|
||||
if (!StringUtils.isBlank(params.get("id") == null ? null : params.get("id").toString())) {
|
||||
indexLibParentId = params.get("id").toString();
|
||||
}
|
||||
params.put("indexLibParentId",indexLibParentId);
|
||||
return indexLibService.listZTreeWeb(params);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "修改指标状态", notes = "修改指标状态接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "indexLibId", value = "ID", paramType = "path"),
|
||||
|
@ -24,6 +24,15 @@ import java.util.Map;
|
||||
public interface IIndexLibDao {
|
||||
|
||||
|
||||
/**
|
||||
* web页面树形列表
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
List<IndexLibZTreeDTO> listZTreeWeb(Map<String, Object> params) throws SearchException;
|
||||
|
||||
|
||||
/**
|
||||
* 树形列表
|
||||
* @param params
|
||||
@ -135,4 +144,13 @@ public interface IIndexLibDao {
|
||||
*/
|
||||
Integer countByParentId(Map<String, Object> params) throws SearchException;
|
||||
|
||||
|
||||
/**
|
||||
* web页面根据父级ID统计
|
||||
* @param params
|
||||
* @return
|
||||
* @throws SearchException
|
||||
*/
|
||||
Integer countByParentIdWeb(Map<String, Object> params) throws SearchException;
|
||||
|
||||
}
|
@ -20,13 +20,15 @@ import java.util.Map;
|
||||
**/
|
||||
public interface IIndexLibService {
|
||||
|
||||
|
||||
/**
|
||||
* 树形列表
|
||||
* web页面树形列表
|
||||
* @param params
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
List<IndexLibZTreeDTO> listZTreeWeb(Map<String, Object> params);
|
||||
|
||||
|
||||
List<IndexLibZTreeDTO> listZTree(Map<String, Object> params);
|
||||
/**
|
||||
* 新增
|
||||
|
@ -34,6 +34,23 @@ public class IndexLibServiceImpl extends DefaultBaseService implements IIndexLib
|
||||
@Autowired
|
||||
private IIndexLibDao indexLibDao;
|
||||
|
||||
public List<IndexLibZTreeDTO> listZTreeWeb(Map<String, Object> params){
|
||||
List<IndexLibZTreeDTO> list = indexLibDao.listZTreeWeb(params);
|
||||
for (IndexLibZTreeDTO indexLibZTreeDTO : list) {
|
||||
Map<String,Object> data = new HashMap<>();
|
||||
data.put("parentId",indexLibZTreeDTO.getId());
|
||||
Integer count = countByParentIdWeb(data);
|
||||
if (count > 0){
|
||||
indexLibZTreeDTO.setIsParent(true);
|
||||
}else{
|
||||
indexLibZTreeDTO.setIsParent(false);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public List<IndexLibZTreeDTO> listZTree(Map<String, Object> params){
|
||||
List<IndexLibZTreeDTO> list = indexLibDao.listZTree(params);
|
||||
@ -50,15 +67,6 @@ public class IndexLibServiceImpl extends DefaultBaseService implements IIndexLib
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void save(IndexLibVO indexLibVO) {
|
||||
saveReturnId(indexLibVO);
|
||||
@ -201,5 +209,9 @@ public class IndexLibServiceImpl extends DefaultBaseService implements IIndexLib
|
||||
Integer count = indexLibDao.countByParentId(params);
|
||||
return count == null ? 0 : count;
|
||||
}
|
||||
public Integer countByParentIdWeb(Map<String, Object> params) {
|
||||
Integer count = indexLibDao.countByParentIdWeb(params);
|
||||
return count == null ? 0 : count;
|
||||
}
|
||||
|
||||
}
|
@ -53,6 +53,35 @@
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 树形列表 -->
|
||||
<select id="listZTreeWeb" parameterType="map" resultMap="indexLibZTreeDTO">
|
||||
SELECT
|
||||
t1.index_lib_id,
|
||||
t1.index_lib_name,
|
||||
t1.index_lib_parent_id
|
||||
FROM
|
||||
duty_index_lib t1
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
AND t1.index_lib_state = 1
|
||||
AND (t1.index_template_id = '' OR t1.index_template_id IS NULL)
|
||||
AND t1.index_lib_parent_id = #{indexLibParentId}
|
||||
ORDER BY
|
||||
t1.index_lib_sort
|
||||
</select>
|
||||
|
||||
<!-- web页面统计根据父级ID -->
|
||||
<select id="countByParentIdWeb" parameterType="map" resultType="Integer">
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
duty_index_lib t1
|
||||
WHERE
|
||||
t1.is_delete = 0 AND t1.index_lib_parent_id = #{parentId}
|
||||
AND t1.index_lib_state = 1
|
||||
AND (t1.index_template_id = '' OR t1.index_template_id IS NULL)
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user