forked from integrated_whb/integrated_whb
隐患排查添加导入
parent
741d2f1077
commit
4f9ca7c9c9
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,34 @@
|
||||||
|
package com.zcloud.controller.hiddenDangerCheckStandard;
|
||||||
|
|
||||||
|
import com.zcloud.controller.base.BaseController;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
import com.zcloud.service.hiddenDangerCheckStandard.CustomTermLibraryService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/customLabelFactory")
|
||||||
|
public class CustomTermLibraryController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CustomTermLibraryService customTermLibraryService;
|
||||||
|
|
||||||
|
@RequestMapping(value = "/termList")
|
||||||
|
@ResponseBody
|
||||||
|
public Object list() throws Exception {
|
||||||
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
|
String errInfo = "success";
|
||||||
|
PageData pd = new PageData();
|
||||||
|
pd = this.getPageData();
|
||||||
|
List<PageData> varList = customTermLibraryService.listAll(pd); //列出LabelFacory列表
|
||||||
|
map.put("varList", varList);
|
||||||
|
map.put("result", errInfo);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.zcloud.mapper.datasource.hiddenDangerCheckStandard;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:标签库
|
||||||
|
* 作者:luoxiaobao
|
||||||
|
* 时间:2022-12-27
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
public interface CustomLabelFactoryMapper {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void save(PageData pd);
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void delete(PageData pd);
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void edit(PageData pd);
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> datalistPage(Page page);
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> listAll(PageData pd);
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
PageData findById(PageData pd);
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void deleteAll(String[] ArrayDATA_IDS);
|
||||||
|
|
||||||
|
List<PageData> findByAncestors(PageData condition);
|
||||||
|
|
||||||
|
void deleteByAncestors(PageData leafInfo);
|
||||||
|
|
||||||
|
List<PageData> findAllAncestors(PageData condition);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.zcloud.mapper.datasource.hiddenDangerCheckStandard;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:包保责任人明细项
|
||||||
|
* 作者:luoxiaobao
|
||||||
|
* 时间:2023-10-13
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
public interface CustomTermLibraryMapper {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void save(PageData pd);
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void delete(PageData pd);
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void edit(PageData pd);
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> datalistPage(Page page);
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
List<PageData> listAll(PageData pd);
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
PageData findById(PageData pd);
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
void deleteAll(String[] ArrayDATA_IDS);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.zcloud.service.hiddenDangerCheckStandard;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:标签库
|
||||||
|
* 作者:luoxiaobao
|
||||||
|
* 时间:2022-12-27
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
public interface CustomLabelFactoryService {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void save(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void delete(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void edit(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> list(Page page)throws Exception;
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listAll(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public PageData findById(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
|
||||||
|
|
||||||
|
List<PageData> getTree(PageData condition) throws Exception;
|
||||||
|
|
||||||
|
List<PageData> saveTree(PageData pd) throws Exception;
|
||||||
|
|
||||||
|
List<PageData> findAllAncestors(PageData condition) throws Exception;
|
||||||
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ public interface CustomService {
|
||||||
*/
|
*/
|
||||||
List<PageData> getListByCorplistPage(Page page)throws Exception;
|
List<PageData> getListByCorplistPage(Page page)throws Exception;
|
||||||
|
|
||||||
|
void saveBaoBaoType(PageData pd) throws Exception;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.zcloud.service.hiddenDangerCheckStandard;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:包保责任人明细项
|
||||||
|
* 作者:luoxiaobao
|
||||||
|
* 时间:2023-10-13
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
public interface CustomTermLibraryService {
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void save(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void delete(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void edit(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> list(Page page)throws Exception;
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listAll(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public PageData findById(PageData pd)throws Exception;
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,249 @@
|
||||||
|
package com.zcloud.service.hiddenDangerCheckStandard.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomLabelFactoryMapper;
|
||||||
|
import com.zcloud.service.hiddenDangerCheckStandard.CustomLabelFactoryService;
|
||||||
|
import com.zcloud.util.DateUtil;
|
||||||
|
import com.zcloud.util.Jurisdiction;
|
||||||
|
import com.zcloud.util.Warden;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:标签库
|
||||||
|
* 作者:luoxiaobao
|
||||||
|
* 时间:2022-12-27
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional //开启事物
|
||||||
|
public class CustomLabelFacoryServiceImpl implements CustomLabelFactoryService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CustomLabelFactoryMapper customLabelFactoryMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void save(PageData pd) throws Exception {
|
||||||
|
customLabelFactoryMapper.save(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void delete(PageData pd) throws Exception {
|
||||||
|
customLabelFactoryMapper.delete(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void edit(PageData pd) throws Exception {
|
||||||
|
customLabelFactoryMapper.edit(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表
|
||||||
|
*
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> list(Page page) throws Exception {
|
||||||
|
return customLabelFactoryMapper.datalistPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表(全部)
|
||||||
|
*
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listAll(PageData pd) throws Exception {
|
||||||
|
return customLabelFactoryMapper.listAll(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id获取数据
|
||||||
|
*
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public PageData findById(PageData pd) throws Exception {
|
||||||
|
return customLabelFactoryMapper.findById(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void deleteAll(String[] ArrayDATA_IDS) throws Exception {
|
||||||
|
customLabelFactoryMapper.deleteAll(ArrayDATA_IDS);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PageData> getTree(PageData request) throws Exception {
|
||||||
|
List<PageData> result = new ArrayList<>();
|
||||||
|
PageData condition = new PageData();
|
||||||
|
List<PageData> labels = customLabelFactoryMapper.findByAncestors(condition);
|
||||||
|
for (PageData label : labels) {
|
||||||
|
if ("1".equals(label.getString("IS_ANCESTORS_FLAG"))){
|
||||||
|
condition.clear();
|
||||||
|
condition.put("BUS_LABEL_FACTORY_ID",label.getString("BUS_LABEL_FACTORY_ID"));
|
||||||
|
PageData ancestors = customLabelFactoryMapper.findById(condition);
|
||||||
|
analysis(labels, ancestors);
|
||||||
|
if (ancestors != null) {
|
||||||
|
result.add(ancestors);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result = result.stream().sorted(Comparator.comparing(o -> new BigDecimal(String.valueOf(o.get("SORT").toString())))).collect(Collectors.toList());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public List<PageData> saveTree(PageData pd) throws Exception {
|
||||||
|
// 组织
|
||||||
|
List<PageData> _tree = Warden.getList(pd.getString("tree"));
|
||||||
|
PageData condition = new PageData();
|
||||||
|
// 删除所有标签
|
||||||
|
condition.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID());
|
||||||
|
condition.put("TYPE",pd.getString("TYPE"));
|
||||||
|
customLabelFactoryMapper.deleteByAncestors(condition);
|
||||||
|
List<PageData> result = new ArrayList<>();
|
||||||
|
for (PageData leaf : _tree) {
|
||||||
|
Warden.initDate(leaf);
|
||||||
|
leaf.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||||
|
if (leaf.get("BUS_LABEL_FACTORY_ID").toString().length() > 30) {
|
||||||
|
if ("1".equals(leaf.getString("IS_ANCESTORS_FLAG"))) {
|
||||||
|
leaf.put("NAME", leaf.getString("NAME"));
|
||||||
|
customLabelFactoryMapper.save(leaf);
|
||||||
|
} else {
|
||||||
|
leaf.put("ANCESTORS_ID", leaf.getString("BUS_LABEL_FACTORY_ID"));
|
||||||
|
leaf.put("NAME", leaf.getString("NAME"));
|
||||||
|
leaf.put("PARENT_ID", "0");
|
||||||
|
leaf.put("IS_ANCESTORS_FLAG", "1");
|
||||||
|
leaf.put("TYPE", pd.getString("TYPE"));
|
||||||
|
customLabelFactoryMapper.save(leaf);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
leaf.put("BUS_LABEL_FACTORY_ID", Warden.get32UUID());
|
||||||
|
leaf.put("ANCESTORS_ID", leaf.getString("BUS_LABEL_FACTORY_ID"));
|
||||||
|
leaf.put("NAME", leaf.getString("NAME"));
|
||||||
|
leaf.put("PARENT_ID", "0");
|
||||||
|
leaf.put("IS_ANCESTORS_FLAG", "1");
|
||||||
|
leaf.put("TYPE", pd.getString("TYPE"));
|
||||||
|
customLabelFactoryMapper.save(leaf);
|
||||||
|
}
|
||||||
|
analysis(leaf, result, 1);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PageData> findAllAncestors(PageData condition) throws Exception {
|
||||||
|
return customLabelFactoryMapper.findAllAncestors(condition);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void analysis(PageData pd, List<PageData> result, Integer level) {
|
||||||
|
JSONArray children = (JSONArray) pd.get("children");
|
||||||
|
if (children == null || children.size() <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<PageData> tree = Warden.getList(children);
|
||||||
|
result.addAll(tree);
|
||||||
|
for (PageData leaf : tree) {
|
||||||
|
leaf.put("BUS_LABEL_FACTORY_ID", leaf.get("BUS_LABEL_FACTORY_ID").toString().length() > 30 ? leaf.getString("BUS_LABEL_FACTORY_ID") : Warden.get32UUID());
|
||||||
|
leaf.put("ANCESTORS_ID", pd.getString("ANCESTORS_ID"));
|
||||||
|
leaf.put("PARENT_ID", pd.getString("BUS_LABEL_FACTORY_ID"));
|
||||||
|
leaf.put("IS_ANCESTORS_FLAG", "0");
|
||||||
|
leaf.put("LEVEL", level);
|
||||||
|
leaf.put("CREATOR_ID", Jurisdiction.getUSER_ID());
|
||||||
|
leaf.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||||
|
leaf.put("CREATED_TIME", DateUtil.date2Str(new Date()));
|
||||||
|
leaf.put("ISDELETE", "0");
|
||||||
|
leaf.put("TYPE", pd.getString("TYPE"));
|
||||||
|
customLabelFactoryMapper.save(leaf);
|
||||||
|
analysis(leaf, result, ++level);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void analysis(List<PageData> labels, PageData parent) {
|
||||||
|
List<PageData> sons = labels.stream()
|
||||||
|
.filter(n -> n.getString("PARENT_ID").equals(parent.getString("BUS_LABEL_FACTORY_ID")))
|
||||||
|
.sorted(Comparator.comparing(o -> new BigDecimal(String.valueOf(o.get("SORT").toString()))))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (parent == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
parent.put("children", sons);
|
||||||
|
if (sons.size() > 0) {
|
||||||
|
for (PageData son : sons) {
|
||||||
|
analysis(labels, son);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private PageData findParentNode(List<PageData> tree, PageData branch) throws Exception {
|
||||||
|
for (PageData root : tree) {
|
||||||
|
List<PageData> branches = (List<PageData>) root.get("children");
|
||||||
|
if (branches.size() <= 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
for (PageData _branch : branches) {
|
||||||
|
if (branch.getString("BUS_LABEL_FACTORY_ID").equals(_branch.getString("BUS_LABEL_FACTORY_ID"))) {
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PageData parentNode = findParentNode(branches, branch);
|
||||||
|
if (parentNode != null && parentNode.size() > 0) {
|
||||||
|
return parentNode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initNode(PageData info, PageData gene) {
|
||||||
|
info.put("BUS_LABEL_FACTORY_ID", info.get("BUS_LABEL_FACTORY_ID").toString().length() > 30 ? info.getString("BUS_LABEL_FACTORY_ID") : Warden.get32UUID());
|
||||||
|
info.put("PARENT_ID", gene.getString("BUS_LABEL_FACTORY_ID"));
|
||||||
|
info.put("ANCESTORS_ID", gene.getString("ANCESTORS_ID"));
|
||||||
|
info.put("IS_ANCESTORS_FLAG", "0");
|
||||||
|
info.put("LEVEL", Integer.parseInt(gene.get("LEVEL").toString()) + 1);
|
||||||
|
info.put("CREATOR_ID", Jurisdiction.getUSER_ID());
|
||||||
|
info.put("CREATED_TIME", DateUtil.date2Str(new Date()));
|
||||||
|
info.put("ISDELETE", "0");
|
||||||
|
info.put("TYPE", gene.getString("TYPE"));
|
||||||
|
JSONArray _children = (JSONArray) info.get("children");
|
||||||
|
if (_children == null || _children.size() <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<PageData> children = Warden.getList(_children);
|
||||||
|
for (PageData child : children) {
|
||||||
|
initNode(child, info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -2,8 +2,11 @@ package com.zcloud.service.hiddenDangerCheckStandard.impl;
|
||||||
|
|
||||||
import com.zcloud.entity.Page;
|
import com.zcloud.entity.Page;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
|
import com.zcloud.mapper.datasource.check.ListCheckItemMapper;
|
||||||
import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomMapper;
|
import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomMapper;
|
||||||
|
import com.zcloud.service.hiddenDangerCheckStandard.CustomItemService;
|
||||||
import com.zcloud.service.hiddenDangerCheckStandard.CustomService;
|
import com.zcloud.service.hiddenDangerCheckStandard.CustomService;
|
||||||
|
import com.zcloud.util.Warden;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
@ -22,6 +25,8 @@ public class CustomServiceImpl implements CustomService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CustomMapper customMapper;
|
private CustomMapper customMapper;
|
||||||
|
@Autowired
|
||||||
|
private CustomItemService customItemService;
|
||||||
|
|
||||||
|
|
||||||
/**新增
|
/**新增
|
||||||
|
@ -147,6 +152,19 @@ public class CustomServiceImpl implements CustomService {
|
||||||
public void edit(PageData pd)throws Exception{
|
public void edit(PageData pd)throws Exception{
|
||||||
customMapper.edit(pd);
|
customMapper.edit(pd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void saveBaoBaoType(PageData pd) throws Exception {
|
||||||
|
List<PageData> itemList = Warden.getList(pd.getString("list"));
|
||||||
|
for (PageData dto : itemList) {
|
||||||
|
PageData condition = new PageData();
|
||||||
|
condition.put("CUSTOM_ITEM_ID",dto.get("CUSTOM_ITEM_ID"));
|
||||||
|
PageData entity = customItemService.findById(condition);
|
||||||
|
entity.put("BAO_BAO_NUM",dto.get("BAO_BAO_NUM"));
|
||||||
|
customItemService.edit(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
package com.zcloud.service.hiddenDangerCheckStandard.impl;
|
||||||
|
|
||||||
|
import com.zcloud.entity.Page;
|
||||||
|
import com.zcloud.entity.PageData;
|
||||||
|
import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomTermLibraryMapper;
|
||||||
|
import com.zcloud.service.hiddenDangerCheckStandard.CustomTermLibraryService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明:包保责任人明细项
|
||||||
|
* 作者:luoxiaobao
|
||||||
|
* 时间:2023-10-13
|
||||||
|
* 官网:www.zcloudchina.com
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Transactional //开启事物
|
||||||
|
public class CustomTermLibraryServiceImpl implements CustomTermLibraryService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CustomTermLibraryMapper customTermLibraryMapper;
|
||||||
|
|
||||||
|
/**新增
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void save(PageData pd)throws Exception{
|
||||||
|
customTermLibraryMapper.save(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**删除
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void delete(PageData pd)throws Exception{
|
||||||
|
customTermLibraryMapper.delete(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**修改
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void edit(PageData pd)throws Exception{
|
||||||
|
customTermLibraryMapper.edit(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表
|
||||||
|
* @param page
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> list(Page page)throws Exception{
|
||||||
|
return customTermLibraryMapper.datalistPage(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**列表(全部)
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<PageData> listAll(PageData pd)throws Exception{
|
||||||
|
return customTermLibraryMapper.listAll(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**通过id获取数据
|
||||||
|
* @param pd
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public PageData findById(PageData pd)throws Exception{
|
||||||
|
return customTermLibraryMapper.findById(pd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**批量删除
|
||||||
|
* @param ArrayDATA_IDS
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
|
||||||
|
customTermLibraryMapper.deleteAll(ArrayDATA_IDS);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -98,10 +98,10 @@
|
||||||
and f.COMMON_STATUS = 1
|
and f.COMMON_STATUS = 1
|
||||||
and bhci.COMMON_ITEM_STATUS = 1
|
and bhci.COMMON_ITEM_STATUS = 1
|
||||||
<!-- and f.INDUSTRY_TYPE_NAMES = #{pd.CORP_TYPE_NAME} -->
|
<!-- and f.INDUSTRY_TYPE_NAMES = #{pd.CORP_TYPE_NAME} -->
|
||||||
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
<if test="pd.OTHERKEYWORDS != null and pd.OTHERKEYWORDS != ''"><!-- 关键词检索 -->
|
||||||
and
|
and
|
||||||
(
|
(
|
||||||
bhci.CHECK_CONTENT LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
bhci.CHECK_CONTENT LIKE CONCAT(CONCAT('%', #{pd.OTHERKEYWORDS}),'%')
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
<if test="pd.CHECK_CATEGORY != null and pd.CHECK_CATEGORY != ''"><!-- 检查类别 -->
|
<if test="pd.CHECK_CATEGORY != null and pd.CHECK_CATEGORY != ''"><!-- 检查类别 -->
|
||||||
|
|
|
@ -131,7 +131,7 @@
|
||||||
CHECK_UNQUALIFIED = #{CHECK_UNQUALIFIED},
|
CHECK_UNQUALIFIED = #{CHECK_UNQUALIFIED},
|
||||||
OPERATION_TYPE = #{OPERATION_TYPE},
|
OPERATION_TYPE = #{OPERATION_TYPE},
|
||||||
BAO_BAO_NUM = #{BAO_BAO_NUM},
|
BAO_BAO_NUM = #{BAO_BAO_NUM},
|
||||||
LISTCHECKITEM_ID = LISTCHECKITEM_ID
|
CUSTOM_ITEM_ID = CUSTOM_ITEM_ID
|
||||||
where
|
where
|
||||||
CUSTOM_ITEM_ID = #{CUSTOM_ITEM_ID}
|
CUSTOM_ITEM_ID = #{CUSTOM_ITEM_ID}
|
||||||
</update>
|
</update>
|
||||||
|
@ -189,7 +189,8 @@
|
||||||
blsd.NAME as TASK_TYPE_NAME,
|
blsd.NAME as TASK_TYPE_NAME,
|
||||||
blsd.BZ as TASK_TYPE_NUM,
|
blsd.BZ as TASK_TYPE_NUM,
|
||||||
bhd1.DICTIONARY_NAME as CHECK_CATEGORY_NAME,
|
bhd1.DICTIONARY_NAME as CHECK_CATEGORY_NAME,
|
||||||
bhd2.DICTIONARY_NAME as CHECK_ITEM_NAME
|
bhd2.DICTIONARY_NAME as CHECK_ITEM_NAME,
|
||||||
|
btl.DESCRIBE as BAO_BAO_NUM_NAME
|
||||||
from
|
from
|
||||||
<include refid="tableName"></include> f
|
<include refid="tableName"></include> f
|
||||||
left join bus_hiddendangercheckstandard_custom bl on bl.CUSTOM_ID = f.CUSTOM_ID
|
left join bus_hiddendangercheckstandard_custom bl on bl.CUSTOM_ID = f.CUSTOM_ID
|
||||||
|
@ -198,6 +199,7 @@
|
||||||
left join sys_user u on u.USER_ID = bl.USER_ID
|
left join sys_user u on u.USER_ID = bl.USER_ID
|
||||||
left join bus_hiddendangercheckstandard_dictionary bhd1 on bhd1.DICTIONARY_ID = f.CHECK_CATEGORY and bhd1.ISDELETE = 0
|
left join bus_hiddendangercheckstandard_dictionary bhd1 on bhd1.DICTIONARY_ID = f.CHECK_CATEGORY and bhd1.ISDELETE = 0
|
||||||
left join bus_hiddendangercheckstandard_dictionary bhd2 on bhd2.DICTIONARY_ID = f.CHECK_ITEM and bhd2.ISDELETE = 0
|
left join bus_hiddendangercheckstandard_dictionary bhd2 on bhd2.DICTIONARY_ID = f.CHECK_ITEM and bhd2.ISDELETE = 0
|
||||||
|
left join bus_hiddendangercheckstandard_term_library btl on btl.TASK_NUM = f.BAO_BAO_NUM and btl.WORK_TYPE = blsd.BZ
|
||||||
where f.ISDELETE = '0'
|
where f.ISDELETE = '0'
|
||||||
<if test="CUSTOM_ID != null and CUSTOM_ID != ''"><!-- 检查表id -->
|
<if test="CUSTOM_ID != null and CUSTOM_ID != ''"><!-- 检查表id -->
|
||||||
and f.CUSTOM_ID = #{CUSTOM_ID}
|
and f.CUSTOM_ID = #{CUSTOM_ID}
|
||||||
|
|
|
@ -0,0 +1,197 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomLabelFactoryMapper">
|
||||||
|
|
||||||
|
<!--表名 -->
|
||||||
|
<sql id="tableName">
|
||||||
|
BUS_HIDDENDANGERCHECKSTANDARD_TERM_LIBRARY
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!--数据字典表名 -->
|
||||||
|
<sql id="dicTableName">
|
||||||
|
SYS_DICTIONARIES
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段 -->
|
||||||
|
<sql id="Field">
|
||||||
|
f.PARENT_ID,
|
||||||
|
f.ANCESTORS_ID,
|
||||||
|
f.IS_ANCESTORS_FLAG,
|
||||||
|
f.LEVEL,
|
||||||
|
f.NAME,
|
||||||
|
f.CREATOR_ID,
|
||||||
|
f.CREATED_TIME,
|
||||||
|
f.ISDELETE,
|
||||||
|
f.SORT,
|
||||||
|
f.TYPE,
|
||||||
|
f.BUS_LABEL_FACTORY_ID,
|
||||||
|
f.CORPINFO_ID
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段用于新增 -->
|
||||||
|
<sql id="Field2">
|
||||||
|
PARENT_ID,
|
||||||
|
ANCESTORS_ID,
|
||||||
|
IS_ANCESTORS_FLAG,
|
||||||
|
LEVEL,
|
||||||
|
NAME,
|
||||||
|
CREATOR_ID,
|
||||||
|
CREATED_TIME,
|
||||||
|
ISDELETE,
|
||||||
|
SORT,
|
||||||
|
TYPE,
|
||||||
|
BUS_LABEL_FACTORY_ID,
|
||||||
|
CORPINFO_ID
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段值 -->
|
||||||
|
<sql id="FieldValue">
|
||||||
|
#{PARENT_ID},
|
||||||
|
#{ANCESTORS_ID},
|
||||||
|
#{IS_ANCESTORS_FLAG},
|
||||||
|
#{LEVEL},
|
||||||
|
#{NAME},
|
||||||
|
#{CREATOR_ID},
|
||||||
|
#{CREATED_TIME},
|
||||||
|
#{ISDELETE},
|
||||||
|
#{SORT},
|
||||||
|
#{TYPE},
|
||||||
|
#{BUS_LABEL_FACTORY_ID},
|
||||||
|
#{CORPINFO_ID}
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 新增-->
|
||||||
|
<insert id="save" parameterType="pd">
|
||||||
|
insert into
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
(
|
||||||
|
<include refid="Field2"></include>
|
||||||
|
) values (
|
||||||
|
<include refid="FieldValue"></include>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 删除-->
|
||||||
|
<delete id="delete" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1'
|
||||||
|
where
|
||||||
|
BUS_LABEL_FACTORY_ID = #{BUS_LABEL_FACTORY_ID}
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteByAncestors" parameterType="pd">
|
||||||
|
delete from
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
where TYPE = #{TYPE}
|
||||||
|
<if test="CORPINFO_ID != '' and CORPINFO_ID != null">
|
||||||
|
and CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
</if>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 修改 -->
|
||||||
|
<update id="edit" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
PARENT_ID = #{PARENT_ID},
|
||||||
|
ANCESTORS_ID = #{ANCESTORS_ID},
|
||||||
|
IS_ANCESTORS_FLAG = #{IS_ANCESTORS_FLAG},
|
||||||
|
LEVEL = #{LEVEL},
|
||||||
|
NAME = #{NAME},
|
||||||
|
CREATOR_ID = #{CREATOR_ID},
|
||||||
|
CREATED_TIME = #{CREATED_TIME},
|
||||||
|
SORT = #{SORT},
|
||||||
|
TYPE = #{TYPE},
|
||||||
|
CORPINFO_ID = #{CORPINFO_ID},
|
||||||
|
BUS_LABEL_FACTORY_ID = BUS_LABEL_FACTORY_ID
|
||||||
|
where
|
||||||
|
BUS_LABEL_FACTORY_ID = #{BUS_LABEL_FACTORY_ID}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 通过ID获取数据 -->
|
||||||
|
<select id="findById" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where
|
||||||
|
f.BUS_LABEL_FACTORY_ID = #{BUS_LABEL_FACTORY_ID}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findByAncestors" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
f
|
||||||
|
where f.ISDELETE = '0'
|
||||||
|
<if test="ANCESTORS_ID != null and ANCESTORS_ID != ''">
|
||||||
|
and f.ANCESTORS_ID = #{ANCESTORS_ID}
|
||||||
|
</if>
|
||||||
|
<if test="TYPE != null and TYPE != ''">
|
||||||
|
and f.TYPE = #{TYPE}
|
||||||
|
</if>
|
||||||
|
<if test="CORPINFO_ID != '' and CORPINFO_ID != null">
|
||||||
|
and f.CORPINFO_ID = #{CORPINFO_ID}
|
||||||
|
</if>
|
||||||
|
<if test="IS_ANCESTORS_FLAG != null and IS_ANCESTORS_FLAG != ''">
|
||||||
|
and f.IS_ANCESTORS_FLAG = #{IS_ANCESTORS_FLAG}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="findAllAncestors" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where
|
||||||
|
f.IS_ANCESTORS_FLAG = '1' and f.ISDELETE = '0' and TYPE = #{TYPE}
|
||||||
|
<if test="NAME != null and NAME != ''">
|
||||||
|
and f.NAME LIKE CONCAT(CONCAT('%', #{NAME}),'%')
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
f
|
||||||
|
where f.ISDELETE = '0'
|
||||||
|
<if test="pd.NAME != null and pd.NAME != ''"><!-- 关键词检索 -->
|
||||||
|
and f.NAME LIKE CONCAT(CONCAT('%', #{pd.NAME}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="pd.IS_ANCESTORS_FLAG != null and pd.IS_ANCESTORS_FLAG != ''"><!-- 关键词检索 -->
|
||||||
|
and f.IS_ANCESTORS_FLAG = #{pd.IS_ANCESTORS_FLAG}
|
||||||
|
</if>
|
||||||
|
<if test="pd.TYPE != null and pd.TYPE != ''">
|
||||||
|
and f.TYPE = #{pd.TYPE}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(全部) -->
|
||||||
|
<select id="listAll" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f where f.ISDELETE = '0'
|
||||||
|
<if test="NAME != '' and NAME != null">
|
||||||
|
and f.NAME = #{NAME}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 批量删除 -->
|
||||||
|
<delete id="deleteAll" parameterType="String">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
ISDELETE = '1'
|
||||||
|
where
|
||||||
|
BUS_LABEL_FACTORY_ID in
|
||||||
|
<foreach item="item" index="index" collection="array" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -343,6 +343,72 @@
|
||||||
<if test="pd.TYPE != null and pd.TYPE != ''"><!-- 关键词检索 -->
|
<if test="pd.TYPE != null and pd.TYPE != ''"><!-- 关键词检索 -->
|
||||||
and f.TYPE = #{pd.TYPE}
|
and f.TYPE = #{pd.TYPE}
|
||||||
</if>
|
</if>
|
||||||
|
<choose>
|
||||||
|
<when test='pd.ISMAIN != null and pd.ISMAIN != "" and pd.ISMAIN == "1"'>
|
||||||
|
<if test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
|
||||||
|
and
|
||||||
|
f.DEPARTMENT_ID in
|
||||||
|
<foreach item="item" index="index"
|
||||||
|
collection="pd.DEPT_IDS" open="(" separator="," close=")">
|
||||||
|
'${item}'
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
<choose>
|
||||||
|
<when test='pd.ISSUPERVISE != null and pd.ISSUPERVISE != "" and pd.ISSUPERVISE == "1"'>
|
||||||
|
<choose>
|
||||||
|
<when test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
|
||||||
|
and
|
||||||
|
f.DEPARTMENT_ID in
|
||||||
|
<foreach item="item" index="index"
|
||||||
|
collection="pd.DEPT_IDS" open="(" separator="," close=")">
|
||||||
|
'${item}'
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
and
|
||||||
|
(f.DEPARTMENT_ID in (
|
||||||
|
select
|
||||||
|
SUB_DEPARTMENT_ID
|
||||||
|
from
|
||||||
|
oa_supervision_department osd
|
||||||
|
where
|
||||||
|
osd.SUP_DEPARTMENT_ID = #{pd.DEPARTMENT_ID}
|
||||||
|
and osd.ISDELETE = '0'
|
||||||
|
and osd.CORPINFO_ID = #{pd.CORPINFO_ID}
|
||||||
|
)or f.USER_ID = #{pd.USER_ID})
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</when>
|
||||||
|
<when test='pd.ISLEADER != null and pd.ISLEADER != "" and pd.ISLEADER == "1"'>
|
||||||
|
<choose>
|
||||||
|
<when test="pd.DEPT_IDS != null and pd.DEPT_IDS != ''">
|
||||||
|
and
|
||||||
|
f.DEPARTMENT_ID in
|
||||||
|
<foreach item="item" index="index"
|
||||||
|
collection="pd.DEPT_IDS" open="(" separator="," close=")">
|
||||||
|
'${item}'
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
and
|
||||||
|
f.DEPARTMENT_ID in
|
||||||
|
<foreach item="item" index="index"
|
||||||
|
collection="pd.DEPARTMENT_IDS" open="(" separator="," close=")">
|
||||||
|
'${item}'
|
||||||
|
</foreach>
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</when>
|
||||||
|
<when test="pd.DEPARTMENT_ID != null and pd.DEPARTMENT_ID != ''">
|
||||||
|
and f.DEPARTMENT_ID=#{pd.DEPARTMENT_ID}
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
<if test="pd.LISTINGLEVEL != null and pd.LISTINGLEVEL != ''"><!-- 关键词检索 -->
|
<if test="pd.LISTINGLEVEL != null and pd.LISTINGLEVEL != ''"><!-- 关键词检索 -->
|
||||||
<choose>
|
<choose>
|
||||||
<when test='pd.LISTINGLEVEL == "1"'>
|
<when test='pd.LISTINGLEVEL == "1"'>
|
||||||
|
@ -353,8 +419,8 @@
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
</if>
|
</if>
|
||||||
<if test="pd.SCREENTYPE != null and pd.SCREENTYPE != ''"><!-- 关键词检索 -->
|
<if test="pd.RISKCHECKLISTTYPE != null and pd.RISKCHECKLISTTYPE != ''"><!-- 关键词检索 -->
|
||||||
and f.SCREENTYPE = #{pd.SCREENTYPE}
|
and f.SCREENTYPE = #{pd.RISKCHECKLISTTYPE}
|
||||||
</if>
|
</if>
|
||||||
order by f.ISDELETE,f.OPERATTIME desc
|
order by f.ISDELETE,f.OPERATTIME desc
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
<!--表名 -->
|
<!--表名 -->
|
||||||
<sql id="tableName">
|
<sql id="tableName">
|
||||||
bus_hiddendangercheckstandard_statistics
|
BUS_HIDDENDANGERCHECKSTANDARD_STATISTICS
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!--数据字典表名 -->
|
<!--数据字典表名 -->
|
||||||
|
@ -79,7 +79,7 @@
|
||||||
set
|
set
|
||||||
ISDELETE = '1'
|
ISDELETE = '1'
|
||||||
where
|
where
|
||||||
LISTSTATISTICS_ID = #{LISTSTATISTICS_ID}
|
CUSTOMSTATISTICS_ID = #{CUSTOMSTATISTICS_ID}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<!-- 物理删除-->
|
<!-- 物理删除-->
|
||||||
|
|
|
@ -0,0 +1,140 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomTermLibraryMapper">
|
||||||
|
|
||||||
|
<!--表名 -->
|
||||||
|
<sql id="tableName">
|
||||||
|
BUS_HIDDENDANGERCHECKSTANDARD_TERM_LIBRARY
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!--数据字典表名 -->
|
||||||
|
<sql id="dicTableName">
|
||||||
|
SYS_DICTIONARIES
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段 -->
|
||||||
|
<sql id="Field">
|
||||||
|
f.TASK_NUM,
|
||||||
|
f.DESCRIBE,
|
||||||
|
f.WORK_TYPE,
|
||||||
|
f.IS_DELETE,
|
||||||
|
f.CREATE_TIME,
|
||||||
|
f.TERM_LIBRARY_ID,
|
||||||
|
f.SORT
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段用于新增 -->
|
||||||
|
<sql id="Field2">
|
||||||
|
TASK_NUM,
|
||||||
|
DESCRIBE,
|
||||||
|
WORK_TYPE,
|
||||||
|
IS_DELETE,
|
||||||
|
CREATE_TIME,
|
||||||
|
TERM_LIBRARY_ID,
|
||||||
|
SORT
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 字段值 -->
|
||||||
|
<sql id="FieldValue">
|
||||||
|
#{TASK_NUM},
|
||||||
|
#{DESCRIBE},
|
||||||
|
#{WORK_TYPE},
|
||||||
|
#{IS_DELETE},
|
||||||
|
#{CREATE_TIME},
|
||||||
|
#{TERM_LIBRARY_ID},
|
||||||
|
#{SORT}
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 新增-->
|
||||||
|
<insert id="save" parameterType="pd">
|
||||||
|
insert into
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
(
|
||||||
|
<include refid="Field2"></include>
|
||||||
|
) values (
|
||||||
|
<include refid="FieldValue"></include>
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 删除-->
|
||||||
|
<delete id="delete" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
IS_DELETE = '1'
|
||||||
|
where
|
||||||
|
TERM_LIBRARY_ID = #{TERM_LIBRARY_ID}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<!-- 修改 -->
|
||||||
|
<update id="edit" parameterType="pd">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
TASK_NUM = #{TASK_NUM},
|
||||||
|
DESCRIBE = #{DESCRIBE},
|
||||||
|
WORK_TYPE = #{WORK_TYPE},
|
||||||
|
IS_DELETE = #{IS_DELETE},
|
||||||
|
CREATE_TIME = #{CREATE_TIME},
|
||||||
|
SORT = #{SORT},
|
||||||
|
TERM_LIBRARY_ID = TERM_LIBRARY_ID
|
||||||
|
where
|
||||||
|
TERM_LIBRARY_ID = #{TERM_LIBRARY_ID}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 通过ID获取数据 -->
|
||||||
|
<select id="findById" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where
|
||||||
|
f.TERM_LIBRARY_ID = #{TERM_LIBRARY_ID}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where f.IS_DELETE = '0'
|
||||||
|
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||||
|
and
|
||||||
|
(
|
||||||
|
<!-- 根据需求自己加检索条件
|
||||||
|
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||||
|
or
|
||||||
|
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||||
|
-->
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 列表(全部) -->
|
||||||
|
<select id="listAll" parameterType="pd" resultType="pd">
|
||||||
|
select
|
||||||
|
<include refid="Field"></include>
|
||||||
|
from
|
||||||
|
<include refid="tableName"></include> f
|
||||||
|
where f.IS_DELETE = '0'
|
||||||
|
<if test="WORK_TYPE != null and WORK_TYPE != null">
|
||||||
|
and f.WORK_TYPE = #{WORK_TYPE}
|
||||||
|
</if>
|
||||||
|
order by f.SORT asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 批量删除 -->
|
||||||
|
<delete id="deleteAll" parameterType="String">
|
||||||
|
update
|
||||||
|
<include refid="tableName"></include>
|
||||||
|
set
|
||||||
|
IS_DELETE = '1'
|
||||||
|
where
|
||||||
|
TERM_LIBRARY_ID in
|
||||||
|
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue