Commit 933ee155 authored by lixuan's avatar lixuan

Merge branch 'dev' into 'dev-lx'

Dev

See merge request !70
parents 812f0b12 7669c5b7
package com.ruoyi.web.controller.grid;
import cn.hutool.json.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.common.core.controller.BaseController;
......@@ -7,15 +8,13 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.bean.BeanCopyUtil;
import com.ruoyi.common.zqt.ZQTPageUtil;
import com.ruoyi.system.domain.grid.GridCompany;
import com.ruoyi.system.domain.grid.GridCompanyEconomy;
import com.ruoyi.system.domain.grid.GridCompanyPeople;
import com.ruoyi.system.domain.grid.GridRegion;
import com.ruoyi.system.domain.grid.*;
import com.ruoyi.system.domain.grid.enums.GridCompanyLevelEnum;
import com.ruoyi.system.domain.grid.ext.GridCompanyExt;
import com.ruoyi.system.domain.grid.ext.GridCompanyPeopleExt;
import com.ruoyi.system.domain.grid.vo.GridCompanySearchParam;
import com.ruoyi.system.domain.other.BsCommon;
import com.ruoyi.system.mapper.grid.GridCompanyMapper;
import com.ruoyi.system.service.grid.GridCompanyPeopleService;
import com.ruoyi.system.service.grid.GridCompanyService;
import com.ruoyi.system.service.grid.GridRegionService;
......@@ -26,10 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -49,6 +45,8 @@ public class CompanyController extends BaseController {
private BsCommonService bsCommonService;
@Autowired
private GridRegionService gridRegionService;
@Autowired
private GridCompanyMapper gridCompanyMapper;
@RequestMapping(value = "/page", method = RequestMethod.GET)
public AjaxResult page(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
......@@ -214,4 +212,40 @@ public class CompanyController extends BaseController {
return AjaxResult.success(gridCompanyService.getAllCompanyList(param));
}
// @GetMapping("/saveLabel")
// public AjaxResult saveLabel(@RequestParam(value = "id")String id,@RequestParam(value = "label")String label){
// return AjaxResult.success(gridCompanyMapper.insertLabelById(id,label));
// }
//
// @GetMapping("/selectLabel")
// public AjaxResult selectLabel(@RequestParam(value = "id")String id){
// return AjaxResult.success(gridCompanyMapper.selectLabelById(id));
// }
@PostMapping("/saveCompanyLabel")
public AjaxResult saveCompanyLabel(@RequestBody CompanyLabel companyLabel){
String id = companyLabel.getId();
List<CompanyLabelLevelOne> labels = companyLabel.getLabels();
String strLabel = "";
for (CompanyLabelLevelOne label : labels) {
strLabel += label.getLevelTwo()+":"+label.getValue()+",";
}
return AjaxResult.success(gridCompanyMapper.insertLabelById(id,strLabel));
}
@GetMapping("/selectCompanyLabel")
public AjaxResult selectCompanyLabel(@RequestParam("id") String id){
String label = gridCompanyMapper.selectLabelById(id);
List<CompanyLabelLevelOne> res = new ArrayList<>();
List<String> labels = Arrays.asList(label.split(","));
for (String labelTwo : labels) {
List<String> labelTwos = Arrays.asList(labelTwo.split(":"));
CompanyLabelLevelOne companyLabel = new CompanyLabelLevelOne();
companyLabel.setLevelTwo(labelTwos.get(0));
companyLabel.setValue(labelTwos.get(1));
res.add(companyLabel);
}
return AjaxResult.success(res);
}
}
......@@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -77,6 +78,18 @@ public class CompanyEconomyInfoController {
*/
@PostMapping(value = "/save")
public AjaxResult save(@RequestBody GridCompanyEconomyInfoExt infoExt) {
infoExt.setYearSales(infoExt.getSales().toString());
infoExt.setYearTaxes(infoExt.getTaxes().toString());
int sale = 0;
for(String s:infoExt.getSales()){
sale += Integer.parseInt(s);
}
infoExt.setSale(BigDecimal.valueOf(sale));
int tax = 0;
for (String s:infoExt.getTaxes()){
tax += Integer.parseInt(s);
}
infoExt.setTax(BigDecimal.valueOf(tax));
companyEconomyInfoService.save(infoExt);
return AjaxResult.success("提交成功");
}
......
......@@ -148,6 +148,12 @@ public class RegionController extends BaseController {
@ResponseBody
public String insert(@RequestBody GridRegion body) {
try {
String level = body.getLevel();
if(level.equals("1")||level.equals("2")){
body.setStatus("1");
}else {
body.setStatus(level);
}
return gridRegionFacadeService.commit(body, "insert");
} catch (Exception e) {
e.printStackTrace();
......@@ -542,6 +548,10 @@ public class RegionController extends BaseController {
@RequestMapping(value = "/getWsTreeNode", method = RequestMethod.GET)
@ResponseBody
public AjaxResult getWsTreeNode(@RequestParam("wgType") String wgType, String isShow, @RequestParam(value = "isAll", required = false) String isAll) {
if(wgType.equals("0")){
return AjaxResult.success(gridRegionFacadeService.getWsTreeNodeIncludeTwoPointFive(null,null,null));
}
SysUser sysUser = getLoginUser().getUser();
List<String> wgCodeList = new ArrayList<>();
if(StringUtils.isBlank(isAll) && wgType.equals("1")){
......@@ -758,4 +768,23 @@ public class RegionController extends BaseController {
List<GridRegion> gridRegionList = gridRegionMapper.selectByExample(example);
return AjaxResult.success(gridRegionList);
}
@RequestMapping(value = "/getTwoThreeRegion",method = RequestMethod.GET)
@ResponseBody
public AjaxResult getTwoThreeRegion(@RequestParam(value = "wgType", required = false) String wgType,
@RequestParam(value = "wgCode", required = false) String wgCode,
@RequestParam(value = "pageNum", required = false) Integer pageNum,
@RequestParam(value = "pageSize", required = false) Integer pageSize
){
GridRegionExample example = new GridRegionExample();
GridRegionExample.Criteria criteria = example.createCriteria();
criteria.andIsValidEqualTo("1");
// criteria.andLevelEqualTo(level);
criteria.andWgTypeEqualTo(wgType);
criteria.andWgCodeEqualTo(wgCode);
List<GridRegion> gridRegionList = gridRegionMapper.selectByExample(example);
return AjaxResult.success(gridRegionList);
}
}
......@@ -5,6 +5,7 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.grid.GridShop;
import com.ruoyi.system.domain.grid.GridShopStaff;
import com.ruoyi.system.domain.grid.vo.GridShopSearchParam;
import com.ruoyi.system.mapper.grid.GridShopMapper;
import com.ruoyi.system.service.grid.GridShopService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -23,6 +24,8 @@ public class ShopController {
@Autowired
GridShopService gridShopService;
@Autowired
GridShopMapper gridShopMapper;
/**
* 保存
......@@ -127,4 +130,14 @@ public class ShopController {
}
return AjaxResult.success(gridShopService.getAllShopList(param));
}
@GetMapping("/saveLabel")
public AjaxResult saveLabel(@RequestParam(value = "id")String id,@RequestParam(value = "label")String label){
return AjaxResult.success(gridShopMapper.insertLabelById(id,label));
}
@GetMapping("/selectLabel")
public AjaxResult selectLabel(@RequestParam(value = "id")String id){
return AjaxResult.success(gridShopMapper.selectLabelById(id));
}
}
package com.ruoyi.web.controller.other;
import com.alibaba.fastjson2.JSON;
import com.github.pagehelper.PageHelper;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.other.Labels;
import com.ruoyi.system.domain.other.LabelsExample;
import com.ruoyi.system.domain.other.vo.LabelsVO;
import com.ruoyi.system.service.other.LabelsFacadeService;
import com.ruoyi.system.service.other.LabelsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @Auther: hxc
* @Date: 2019/6/18 0028 14:09
* @Description: 数据字典
*/
@Api(tags = "基本配置 - 数据字典")
@RestController
@RequestMapping("/api/labels")
public class LabelsController extends BaseController {
@Autowired
private LabelsFacadeService commonService;
@Autowired
private LabelsService bsCommonService;
@ApiOperation("列表")
@RequestMapping(value = "/list", method = RequestMethod.POST)
@ResponseBody
public TableDataInfo getCommons(@RequestBody LabelsVO bsCommonVO) {
PageHelper.startPage(bsCommonVO.getPageNum(),bsCommonVO.getPageSize());
LabelsExample example = new LabelsExample();
LabelsExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotEmpty(bsCommonVO.getParentId())) {
criteria.andParentIdEqualTo(bsCommonVO.getParentId());
}else{
criteria.andParentIdIsNull();
}
example.setOrderByClause(" sort + 0 asc ");
List<Labels> list = bsCommonService.selectByExample(example);
return getDataTable(list);
}
@ApiOperation("删除")
@RequestMapping(value = "", method = RequestMethod.DELETE)
@ResponseBody
public String delete(@RequestBody Labels body) {
try {
return commonService.commit(body, "delete");
} catch (Exception e) {
e.printStackTrace();
return JSON.toJSONString(AjaxResult.error(500, "服务器内部错误"));
}
}
@ApiOperation("创建")
@RequestMapping(value = "", method = RequestMethod.POST)
@ResponseBody
public String insert(@RequestBody Labels body) {
try {
return commonService.commit(body, "insert");
} catch (Exception e) {
e.printStackTrace();
return JSON.toJSONString(AjaxResult.error(500, "服务器内部错误"));
}
}
@ApiOperation("更新")
@RequestMapping(value = "", method = RequestMethod.PATCH)
@ResponseBody
public String update(@RequestBody Labels body) {
try {
return commonService.commit(body, "update");
} catch (Exception e) {
e.printStackTrace();
return JSON.toJSONString(AjaxResult.error(500, "服务器内部错误"));
}
}
@ApiOperation("树结构")
@RequestMapping(value = "/getTreeNode", method = RequestMethod.POST)
@ResponseBody
public AjaxResult getTreeNode(@RequestBody LabelsVO bsCommonVO) {
try {
return commonService.getTreeNode(bsCommonVO);
} catch (Exception e) {
e.printStackTrace();
return AjaxResult.error(500, "服务器内部错误");
}
}
@Anonymous
@ApiOperation("获取网格列表")
@RequestMapping(value = "/getWgdxList", method = RequestMethod.GET)
@ResponseBody
public String getWgdxList(@RequestParam(name = "code") String code) {
try {
List<Labels> wgdxList = bsCommonService.getWgdxList(code);
return JSON.toJSONString(AjaxResult.success(wgdxList));
} catch (Exception e) {
e.printStackTrace();
return JSON.toJSONString(AjaxResult.error(500, "服务器内部错误"));
}
}
}
package com.ruoyi.system.domain.grid;
import lombok.Data;
import java.util.List;
@Data
public class CompanyLabel {
String id;
List<CompanyLabelLevelOne> labels;
}
package com.ruoyi.system.domain.grid;
import lombok.Data;
@Data
public class CompanyLabelLevelOne {
//二级标签对应的id
String levelTwo;
String value;
}
package com.ruoyi.system.domain.grid;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@Data
public class GridCompanyEconomyInfo implements Serializable {
private String id;
......@@ -58,71 +62,79 @@ public class GridCompanyEconomyInfo implements Serializable {
private String companyName;
private static final long serialVersionUID = 1L;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public BigDecimal getSale() {
return sale;
}
public void setSale(BigDecimal sale) {
this.sale = sale;
}
public BigDecimal getTax() {
return tax;
}
public void setTax(BigDecimal tax) {
this.tax = tax;
}
public BigDecimal getPerMu() {
return perMu;
}
private List<String> sales;
public void setPerMu(BigDecimal perMu) {
this.perMu = perMu;
}
private List<String> taxes;
public String getYear() {
return year;
}
private String yearSales;
public void setYear(String year) {
this.year = year;
}
private String yearTaxes;
public String getIsValid() {
return isValid;
}
public void setIsValid(String isValid) {
this.isValid = isValid;
}
public String getCreateTime() {
return createTime;
}
private static final long serialVersionUID = 1L;
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
// public String getId() {
// return id;
// }
//
// public void setId(String id) {
// this.id = id;
// }
//
// public String getCompanyId() {
// return companyId;
// }
//
// public void setCompanyId(String companyId) {
// this.companyId = companyId;
// }
//
// public BigDecimal getSale() {
// return sale;
// }
//
// public void setSale(BigDecimal sale) {
// this.sale = sale;
// }
//
// public BigDecimal getTax() {
// return tax;
// }
//
// public void setTax(BigDecimal tax) {
// this.tax = tax;
// }
//
// public BigDecimal getPerMu() {
// return perMu;
// }
//
// public void setPerMu(BigDecimal perMu) {
// this.perMu = perMu;
// }
//
// public String getYear() {
// return year;
// }
//
// public void setYear(String year) {
// this.year = year;
// }
//
// public String getIsValid() {
// return isValid;
// }
//
// public void setIsValid(String isValid) {
// this.isValid = isValid;
// }
//
// public String getCreateTime() {
// return createTime;
// }
//
// public void setCreateTime(String createTime) {
// this.createTime = createTime;
// }
@Override
public String toString() {
......
......@@ -105,6 +105,12 @@ public class GridRegion implements Serializable {
*/
private String wgCoordinate;
private String status;
public String getStatus(){return status;}
public void setStatus(String status){this.status=status;}
private static final long serialVersionUID = 1L;
public String getId() {
......
......@@ -38,6 +38,12 @@ public class GridTreeNode {
*/
private List<GridTreeNode> child = new ArrayList();
private String status;
public String getStatus(){return status;}
public void setStatus(String status){this.status=status;}
public String getLevel() {
return level;
}
......
package com.ruoyi.system.domain.other;
import java.io.Serializable;
public class Labels implements Serializable {
/**
* ID
*
* @mbg.generated
*/
private String id;
private String code;
/**
* 字段名
*
* @mbg.generated
*/
private String name;
/**
* 描述
* 若是选人,这里是names
* @mbg.generated
*/
private String description;
/**
* 父节点
*
* @mbg.generated
*/
private String parentId;
/**
* 是否有效 0:无效 1:有效
*
* @mbg.generated
*/
private String isValid;
/**
* 排序
*
* @mbg.generated
*/
private String sort;
//若是选人,这里是ids
private String ylzd1;
private String ylzd2;
private String ylzd3;
private String ylzd4;
private String ylzd5;
//适用范围
private String scope;
private static final long serialVersionUID = 1L;
public String getScope(){return scope;}
public void setScope(String scope){this.scope = scope;}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getIsValid() {
return isValid;
}
public void setIsValid(String isValid) {
this.isValid = isValid;
}
public String getSort() {
return sort;
}
public void setSort(String sort) {
this.sort = sort;
}
public String getYlzd1() {
return ylzd1;
}
public void setYlzd1(String ylzd1) {
this.ylzd1 = ylzd1;
}
public String getYlzd2() {
return ylzd2;
}
public void setYlzd2(String ylzd2) {
this.ylzd2 = ylzd2;
}
public String getYlzd3() {
return ylzd3;
}
public void setYlzd3(String ylzd3) {
this.ylzd3 = ylzd3;
}
public String getYlzd4() {
return ylzd4;
}
public void setYlzd4(String ylzd4) {
this.ylzd4 = ylzd4;
}
public String getYlzd5() {
return ylzd5;
}
public void setYlzd5(String ylzd5) {
this.ylzd5 = ylzd5;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", code=").append(code);
sb.append(", name=").append(name);
sb.append(", description=").append(description);
sb.append(", parentId=").append(parentId);
sb.append(", isValid=").append(isValid);
sb.append(", sort=").append(sort);
sb.append(", ylzd1=").append(ylzd1);
sb.append(", ylzd2=").append(ylzd2);
sb.append(", ylzd3=").append(ylzd3);
sb.append(", ylzd4=").append(ylzd4);
sb.append(", ylzd5=").append(ylzd5);
sb.append("]");
return sb.toString();
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
BsCommon other = (BsCommon) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
&& (this.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId()))
&& (this.getIsValid() == null ? other.getIsValid() == null : this.getIsValid().equals(other.getIsValid()))
&& (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort()))
&& (this.getYlzd1() == null ? other.getYlzd1() == null : this.getYlzd1().equals(other.getYlzd1()))
&& (this.getYlzd2() == null ? other.getYlzd2() == null : this.getYlzd2().equals(other.getYlzd2()))
&& (this.getYlzd3() == null ? other.getYlzd3() == null : this.getYlzd3().equals(other.getYlzd3()))
&& (this.getYlzd4() == null ? other.getYlzd4() == null : this.getYlzd4().equals(other.getYlzd4()))
&& (this.getYlzd5() == null ? other.getYlzd5() == null : this.getYlzd5().equals(other.getYlzd5()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
result = prime * result + ((getParentId() == null) ? 0 : getParentId().hashCode());
result = prime * result + ((getIsValid() == null) ? 0 : getIsValid().hashCode());
result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode());
result = prime * result + ((getYlzd1() == null) ? 0 : getYlzd1().hashCode());
result = prime * result + ((getYlzd2() == null) ? 0 : getYlzd2().hashCode());
result = prime * result + ((getYlzd3() == null) ? 0 : getYlzd3().hashCode());
result = prime * result + ((getYlzd4() == null) ? 0 : getYlzd4().hashCode());
result = prime * result + ((getYlzd5() == null) ? 0 : getYlzd5().hashCode());
return result;
}
}
package com.ruoyi.system.domain.other.vo;
/**
* @Auther: hxc
* @Date: 2019/6/18 0018 15:46
* @Description:
*/
public class LabelsVO {
private String Id;
private String parentId;
private String code;
private Integer pageNum;
private Integer pageSize;
private String scope;
public String getScope(){return scope;}
public void setScope(String scope){this.scope = scope;}
public String getId() {
return Id;
}
public void setId(String id) {
Id = id;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Integer getPageNum() {
return pageNum;
}
public void setPageNum(Integer pageNum) {
this.pageNum = pageNum;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
}
......@@ -47,4 +47,8 @@ public interface GridCompanyMapper {
* @return
*/
List<SimpleGridCompanyItem> simplePointList(@Param("wgCode") String wgCode, @Param("name")String name);
int insertLabelById(@Param("id") String id, @Param("label") String label);
String selectLabelById(@Param("id") String id);
}
......@@ -49,4 +49,10 @@ public interface GridRegionMapper {
List<GridRegion> getSecondOrThirdRegion(@Param("wgType")String wgType, @Param("wgCodeLikes")List<String> wgCodeLikes, @Param("name")String name, @Param("level")String level);
String getWgTypeByWgCode(@Param("wgCode")String wgCode);
List<GridRegion> getRegionByTypeAndCode(@Param("wgType")String wgType, @Param("wgCodeLikes")List<String> wgCodeLikes, @Param("level")String level);
List<GridRegion> getAllLevelThreeByType(@Param("type") String type,@Param("code") String code);
List<GridRegion> getAllLevelFourByType(@Param("type") String type,@Param("code") String code);
}
\ No newline at end of file
......@@ -41,4 +41,8 @@ public interface GridShopMapper {
List<GridShop> listByParam(GridShopSearchParam param);
List<SimpleGridShopItem> listShopPoint(@Param("wgCode") String wgCode, @Param("name")String name);
int insertLabelById(@Param("id") String id, @Param("label") String label);
String selectLabelById(@Param("id") String id);
}
package com.ruoyi.system.mapper.other;
import com.ruoyi.system.domain.other.Labels;
import com.ruoyi.system.domain.other.LabelsExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface LabelsMapper {
long countByExample(LabelsExample example);
int deleteByExample(LabelsExample example);
int deleteByPrimaryKey(String id);
int insert(Labels record);
int insertSelective(Labels record);
Labels selectByPrimaryKey(String id);
List<Labels> selectByExample(LabelsExample example);
int updateByExampleSelective(@Param("record") Labels record, @Param("example") LabelsExample example);
int updateByPrimaryKeySelective(Labels record);
int updateByExample(@Param("record") Labels record, @Param("example") LabelsExample example);
List<Labels> getWgdxList(String code);
}
\ No newline at end of file
......@@ -856,7 +856,8 @@ public class GridRegionFacadeService {
criteria.andWgNameLike("%" + wgName + "%");
}
if (StringUtils.isNotEmpty(wgCode)) {
criteria.andWgCodeLike(wgCode + "%").andLevelEqualTo("4");
// criteria.andWgCodeLike(wgCode + "%").andLevelEqualTo("4");
criteria.andWgCodeLike(wgCode + "%").andLevelEqualTo("2").andWgTypeEqualTo("1");
}
try {
int count = gridRegionService.countByExample(example);
......@@ -1134,4 +1135,117 @@ public class GridRegionFacadeService {
}
return gridRegionList;
}
public List<GridTreeNode> getWsTreeNodeIncludeTwoPointFive(String wgType, List<String> wgList, String isShow) {
//获取一级树
List<GridRegion> gridRegionList = gridRegionMapper.getRegionByTypeAndCode("1",new ArrayList<>(),"1");
List<GridTreeNode> res = new ArrayList<>();
GridTreeNode firstNode = new GridTreeNode();
firstNode.setLevel("1");
firstNode.setCode(gridRegionList.get(0).getWgCode());
firstNode.setName(gridRegionList.get(0).getWgName());
firstNode.setId(gridRegionList.get(0).getId());
firstNode.setChild(new ArrayList<>());
firstNode.setParentId("");
firstNode.setWgArea(gridRegionList.get(0).getWgArea());
firstNode.setWgCoordinate(gridRegionList.get(0).getWgCoordinate());
firstNode.setWgCentreCoordinate(gridRegionList.get(0).getWgCentreCoordinate());
res.add(firstNode);
//获取二级树
List<GridTreeNode> nowNodes = new ArrayList<>();
String firstNodeCode = gridRegionList.get(0).getWgCode();
List<String> wgCodeLike = new ArrayList<>();
wgCodeLike.add(firstNodeCode);
gridRegionList = gridRegionMapper.getRegionByTypeAndCode("1",wgCodeLike,"2");
for(GridRegion gridRegion : gridRegionList){
GridTreeNode treeNode = convertNodeToTree(gridRegion);
nowNodes.add(treeNode);
}
firstNode.setChild(nowNodes);
//获取2.5级树
List<GridTreeNode> secondTree = firstNode.getChild();
for(GridTreeNode gridTreeNode : secondTree){
List<GridTreeNode> secondFiveTree = new ArrayList<>();
GridTreeNode secondFiveTreeNode1 = new GridTreeNode();
secondFiveTreeNode1.setId(UUID.randomUUID().toString());
secondFiveTreeNode1.setName("楼宇");
secondFiveTreeNode1.setChild(new ArrayList<>());
secondFiveTreeNode1.setStatus("2");
GridTreeNode secondFiveTreeNode4 = new GridTreeNode();
secondFiveTreeNode4.setId(UUID.randomUUID().toString());
secondFiveTreeNode4.setName("道路");
secondFiveTreeNode4.setChild(new ArrayList<>());
secondFiveTreeNode4.setStatus("2");
GridTreeNode secondFiveTreeNode5 = new GridTreeNode();
secondFiveTreeNode5.setId(UUID.randomUUID().toString());
secondFiveTreeNode5.setName("街区");
secondFiveTreeNode5.setChild(new ArrayList<>());
secondFiveTreeNode5.setStatus("2");
GridTreeNode secondFiveTreeNode6 = new GridTreeNode();
secondFiveTreeNode6.setId(UUID.randomUUID().toString());
secondFiveTreeNode6.setName("综合体");
secondFiveTreeNode6.setChild(new ArrayList<>());
secondFiveTreeNode6.setStatus("2");
GridTreeNode secondFiveTreeNode7 = new GridTreeNode();
secondFiveTreeNode7.setId(UUID.randomUUID().toString());
secondFiveTreeNode7.setName("市场");
secondFiveTreeNode7.setChild(new ArrayList<>());
secondFiveTreeNode7.setStatus("2");
secondFiveTree.add(secondFiveTreeNode1);
secondFiveTree.add(secondFiveTreeNode4);
secondFiveTree.add(secondFiveTreeNode5);
secondFiveTree.add(secondFiveTreeNode6);
secondFiveTree.add(secondFiveTreeNode7);
for(GridTreeNode gridTreeNode1 : secondFiveTree){
gridTreeNode1.setCode(gridTreeNode.getCode());
String type = null;
if(gridTreeNode1.getName().equals("楼宇")){
type = "1";
}else if(gridTreeNode1.getName().equals("道路")){
type = "4";
}else if(gridTreeNode1.getName().equals("街区")){
type = "5";
}else if(gridTreeNode1.getName().equals("综合体")){
type = "6";
}else{
type = "7";
}
List<GridRegion> threeLevelNode = gridRegionMapper.getAllLevelThreeByType(type,gridTreeNode1.getCode());
List<GridTreeNode> threeNodes = new ArrayList<>();
for(GridRegion gridRegion : threeLevelNode){
GridTreeNode treeNode = convertNodeToTree(gridRegion);
List<GridRegion> fourLevelNode = gridRegionMapper.getAllLevelFourByType(type,treeNode.getCode());
List<GridTreeNode> fourNodes = new ArrayList<>();
for(GridRegion gridFourRegion : fourLevelNode){
GridTreeNode treeFourNode = convertNodeToTree(gridFourRegion);
fourNodes.add(treeFourNode);
}
treeNode.setChild(fourNodes);
threeNodes.add(treeNode);
}
gridTreeNode1.setChild(threeNodes);
}
gridTreeNode.setChild(secondFiveTree);
}
return res;
}
private GridTreeNode convertNodeToTree(GridRegion gridRegion){
GridTreeNode firstNode = new GridTreeNode();
// firstNode.setLevel("1");
firstNode.setCode(gridRegion.getWgCode());
firstNode.setName(gridRegion.getWgName());
firstNode.setId(gridRegion.getId());
firstNode.setChild(new ArrayList<>());
firstNode.setParentId("");
firstNode.setWgArea(gridRegion.getWgArea());
firstNode.setWgCoordinate(gridRegion.getWgCoordinate());
firstNode.setWgCentreCoordinate(gridRegion.getWgCentreCoordinate());
firstNode.setStatus(gridRegion.getStatus());
return firstNode;
}
}
......@@ -79,7 +79,12 @@ public class GridCompanyEconomyInfoServiceImpl extends BaseServiceImpl<GridCompa
}
criteria.andIsValidEqualTo("1");
example.setOrderByClause(" year desc ");
return gridCompanyEconomyInfoMapper.selectByExample(example);
List<GridCompanyEconomyInfo> res = gridCompanyEconomyInfoMapper.selectByExample(example);
for (GridCompanyEconomyInfo info : res) {
info.setSales(Arrays.asList(info.getYearSales().substring(1, info.getYearSales().length()-1).split(",")));
info.setTaxes(Arrays.asList(info.getYearTaxes().substring(1, info.getYearTaxes().length()-1).split(",")));
}
return res;
}
@Override
......
package com.ruoyi.system.service.other;
import com.alibaba.fastjson2.JSON;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.other.Labels;
import com.ruoyi.system.domain.other.LabelsExample;
import com.ruoyi.system.domain.other.vo.LabelsVO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.lang.reflect.Method;
import java.util.*;
/**
* @Auther: hxc
* @Date: 2019/6/18 0018 09:23
* @Description: 数据字典
*/
@Component
public class LabelsFacadeService {
@Autowired
private LabelsService bsCommonService;
public String commit(Labels body, String method) {
try {
AjaxResult result = new AjaxResult();
Method methodCheck = null;
try {
methodCheck = this.getClass().getMethod(method + "Pre", body.getClass(), result.getClass());
} catch (Exception e) {
methodCheck = null;
}
if (null != methodCheck) {
Object ret = methodCheck.invoke(this, body, result);
if ((ret instanceof Boolean) && !(boolean) ret) {
return JSON.toJSONString(result);
}
}
Method methodCommit = null;
try {
methodCommit = this.getClass().getMethod(method, body.getClass(), result.getClass());
} catch (Exception e) {
methodCommit = null;
}
if (null == methodCommit) {
return JSON.toJSONString(AjaxResult.error(600, "方法未找到:" + method));
}
methodCommit.invoke(this, body, result);
return JSON.toJSONString(result);
} catch (Exception e) {
e.printStackTrace();
return JSON.toJSONString(AjaxResult.error(500, "服务器内部错误"));
}
}
public boolean insertPre(Labels body, AjaxResult result) {
if (null == body) {
result.buildError(500, "body为空");
return false;
}
LabelsExample example = new LabelsExample();
example.createCriteria().andCodeEqualTo(body.getCode());
int count = bsCommonService.countByExample(example);
if (count > 0) {
result.buildError(500, "编码存在,请重新填写!");
return false;
}
return true;
}
public void insert(Labels body, AjaxResult result) {
String id = UUID.randomUUID().toString();
Labels bsCommon = new Labels();
bsCommon.setId(id);
bsCommon.setCode(body.getCode());
bsCommon.setDescription(body.getDescription());
bsCommon.setName(body.getName());
bsCommon.setParentId(body.getParentId());
bsCommon.setIsValid(body.getIsValid());
bsCommon.setSort(body.getSort());
bsCommon.setScope(body.getScope());
bsCommon.setYlzd1(body.getYlzd1());
bsCommon.setYlzd2(body.getYlzd2());
bsCommon.setYlzd3(body.getYlzd3());
bsCommon.setYlzd4(body.getYlzd4());
bsCommon.setYlzd5(body.getYlzd5());
int ret = bsCommonService.insertSelective(bsCommon);
if (ret > 0) {
result.buildSuccess("success", id);
} else {
result.buildError(600, "新增失败");
}
return;
}
public boolean updatePre(Labels body, AjaxResult result) {
if (null == body) {
result.buildError(500, "body为空");
return false;
}
return true;
}
public void update(Labels body, AjaxResult result) {
String id = body.getId();
Labels bean = get(id, null);
if (null == bean) {
result.buildError(500, "body为空");
return;
}
if (!bean.getCode().equals(body.getCode())) {
LabelsExample example = new LabelsExample();
example.createCriteria().andCodeEqualTo(body.getCode());
int count = bsCommonService.countByExample(example);
if (count > 0) {
result.buildError(500, "编码存在,请重新填写!");
return;
}
}
int ret = bsCommonService.updateByPrimaryKeySelective(body);
if (ret > 0) {
result.buildSuccess("success", id);
} else {
result.buildError(600, "更新失败");
}
return;
}
public Labels get(String id, Labels bsCommon) {
if (null == bsCommon) {
if (StringUtils.isNotEmpty(id)) {
bsCommon = bsCommonService.selectByPrimaryKey(id);
}
if (null == bsCommon) {
return null;
}
}
return bsCommon;
}
public boolean deletePre(Labels body, AjaxResult result) {
if (null == body) {
result.buildError(500, "body为空");
return false;
}
if (!itemIsUUID(body.getId())) {
result.buildError(500, "参数非法");
return false;
}
return true;
}
public void delete(Labels body, AjaxResult result) {
Labels bean = get(body.getId(), null);
if (null == bean) {
result.buildError(500, "找不到该数据");
return;
}
// 如果该网格下有子网格,则无法删除
LabelsExample gridRegionExample = new LabelsExample();
gridRegionExample.createCriteria().andIsValidEqualTo("1").andParentIdEqualTo(body.getId());
int count = bsCommonService.countByExample(gridRegionExample);
if (count > 0) {
result.buildError(600, "有子数据无法删除");
return;
}
// 防止数据残留
int ret = bsCommonService.deleteByStringPrimaryKey(body.getId());
if (ret > 0) {
result.buildSuccess("success", null);
} else {
result.buildError(600, "删除失败");
}
return;
}
public AjaxResult getTreeNode(LabelsVO bsCommonVO) {
LabelsExample bsCommonExample = new LabelsExample();
LabelsExample.Criteria criteria = bsCommonExample.createCriteria();
criteria.andIsValidEqualTo("1");
if(bsCommonVO != null){
if(StringUtils.isNotBlank(bsCommonVO.getCode())){
criteria.andCodeLike("%"+bsCommonVO.getCode()+"%");
}
// if(StringUtils.isNotBlank(bsCommonVO.getScope())){
// criteria.andScopeLike("%"+bsCommonVO.getScope()+"%");
// }
}
bsCommonExample.setOrderByClause(" sort + 0 ");
List<Labels> bsCommons = bsCommonService.selectByExample(bsCommonExample);
List<Map<String, Object>> jsTreeModels = convertFrBomsCommon(bsCommons);
if(bsCommonVO == null || StringUtils.isBlank(bsCommonVO.getScope())){
return AjaxResult.success("success", jsTreeModels);
}
List<Map<String, Object>> res = new ArrayList<>();
for (Map<String, Object> map : jsTreeModels) {
String scope = (String) map.get("scope");
if(scope == null){
continue;
}
if(scope.contains(bsCommonVO.getScope())){
res.add(map);
}
}
return AjaxResult.success("success", res);
}
private List<Map<String, Object>> convertFrBomsCommon(List<Labels> bsCommons) {
List<Map<String, Object>> models = new ArrayList<>();
if (!CollectionUtils.isEmpty(bsCommons)) {
for (Labels bsCommon : bsCommons) {
if (StringUtils.isEmpty(bsCommon.getParentId())) {
Map<String, Object> model = new HashMap<>();
model.put("id", bsCommon.getId());
model.put("code", bsCommon.getCode());
model.put("name", bsCommon.getName());
model.put("description", bsCommon.getDescription());
model.put("parentId", bsCommon.getParentId());
model.put("isValid", bsCommon.getIsValid());
model.put("sort", bsCommon.getSort());
model.put("scope", bsCommon.getScope());
List<Map<String, Object>> childrenDocTypes = convertFromWgCodeByParent(bsCommons, bsCommon.getId());
model.put("child", childrenDocTypes);
models.add(model);
}
}
}
return models;
}
private List<Map<String, Object>> convertFromWgCodeByParent(List<Labels> bsCommons, String parentId) {
List<Map<String, Object>> models = new ArrayList<>();
for (Labels bsCommon : bsCommons) {
if (StringUtils.isNotEmpty(bsCommon.getParentId()) && bsCommon.getParentId().equals(parentId)) {
Map<String, Object> model = new HashMap<>();
model.put("id", bsCommon.getId());
model.put("code", bsCommon.getCode());
model.put("name", bsCommon.getName());
model.put("description", bsCommon.getDescription());
model.put("parentId", bsCommon.getParentId());
model.put("isValid", bsCommon.getIsValid());
model.put("sort", bsCommon.getSort());
List<Map<String, Object>> childrenDocTypes = convertFromWgCodeByParent(bsCommons, bsCommon.getId());
model.put("child", childrenDocTypes);
models.add(model);
}
}
return models;
}
private boolean itemIsUUID(String item) {
if (StringUtils.isEmpty(item)) {
return false;
}
return item.matches("(\\w{8}(-\\w{4}){3}-\\w{12}?)");
}
}
package com.ruoyi.system.service.other;
import com.ruoyi.system.domain.other.Labels;
import com.ruoyi.system.domain.other.LabelsExample;
import com.ruoyi.system.service.BaseService;
import java.util.List;
import java.util.Map;
public interface LabelsService extends BaseService<Labels, LabelsExample> {
List<Labels> getWgdxList(String code);
String getName(String code);
String getCode(String name);
List<Labels> getBsCommonMap();
Map<String, String> getMapByCodes(List<String> codes);
}
\ No newline at end of file
package com.ruoyi.system.service.other.impl;
import com.ruoyi.system.domain.other.Labels;
import com.ruoyi.system.domain.other.LabelsExample;
import com.ruoyi.system.listener.MyBaseService;
import com.ruoyi.system.mapper.other.LabelsMapper;
import com.ruoyi.system.service.BaseServiceImpl;
import com.ruoyi.system.service.other.LabelsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author Cesar
* @date ${cTime}
* @desc BsCommonService实现
*/
@Service
@MyBaseService
public class LabelsServiceImpl extends BaseServiceImpl<LabelsMapper, Labels, LabelsExample> implements LabelsService {
private static final Logger LOGGER = LoggerFactory.getLogger(LabelsServiceImpl.class);
@Autowired
private LabelsMapper bsCommonMapper;
@Override
public List<Labels> getWgdxList(String code) {
return bsCommonMapper.getWgdxList(code);
}
@Override
public String getName(String code) {
LabelsExample ex = new LabelsExample();
LabelsExample.Criteria ca = ex.createCriteria();
ca.andCodeEqualTo(code);
ca.andIsValidEqualTo("1");
Labels bsCommon = selectFirstByExample(ex);
if (bsCommon != null) {
return bsCommon.getName();
} else {
return null;
}
}
@Override
public String getCode(String name) {
LabelsExample ex = new LabelsExample();
LabelsExample.Criteria ca = ex.createCriteria();
ca.andNameEqualTo(name);
ca.andIsValidEqualTo("1");
Labels bsCommon = selectFirstByExample(ex);
if (bsCommon != null) {
return bsCommon.getCode();
} else {
return null;
}
}
@Override
public List<Labels> getBsCommonMap() {
LabelsExample ex = new LabelsExample();
LabelsExample.Criteria ca = ex.createCriteria();
ca.andIsValidEqualTo("1");
return this.selectByExample(ex);
}
@Override
public Map<String, String> getMapByCodes(List<String> codes) {
LabelsExample ex = new LabelsExample();
LabelsExample.Criteria ca = ex.createCriteria();
ca.andIsValidEqualTo("1");
ca.andCodeIn(codes);
List<Labels> commonList = bsCommonMapper.selectByExample(ex);
return commonList.stream().collect(Collectors.toMap(Labels::getCode, Labels::getName));
}
}
......@@ -10,6 +10,8 @@
<result column="year" jdbcType="VARCHAR" property="year" />
<result column="is_valid" jdbcType="VARCHAR" property="isValid" />
<result column="create_time" jdbcType="VARCHAR" property="createTime" />
<result column="year_sales" jdbcType="VARCHAR" property="yearSales" />
<result column="year_taxes" jdbcType="VARCHAR" property="yearTaxes" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
......@@ -70,7 +72,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, company_id, sale, tax, per_mu, year, is_valid, create_time
id, company_id, sale, tax, per_mu, year, is_valid, create_time, year_sales, year_taxes
</sql>
<select id="selectByExample" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfoExample" resultMap="BaseResultMap">
select
......@@ -105,10 +107,11 @@
<insert id="insert" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfo">
insert into grid_company_economy_info (id, company_id, sale,
tax, per_mu, year,
is_valid, create_time)
is_valid, create_time, year_sales, year_taxes)
values (#{id,jdbcType=VARCHAR}, #{companyId,jdbcType=VARCHAR}, #{sale,jdbcType=DECIMAL},
#{tax,jdbcType=DECIMAL}, #{perMu,jdbcType=DECIMAL}, #{year,jdbcType=VARCHAR},
#{isValid,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR})
#{isValid,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR}
, #{yearSales,jdbcType=VARCHAR}, #{yearTaxes,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfo">
insert into grid_company_economy_info
......@@ -137,6 +140,12 @@
<if test="createTime != null">
create_time,
</if>
<if test="yearSales != null">
year_sales,
</if>
<if test="yearTaxes != null">
year_taxes,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
......@@ -163,6 +172,12 @@
<if test="createTime != null">
#{createTime,jdbcType=VARCHAR},
</if>
<if test="yearSales != null">
#{yearSales,jdbcType=VARCHAR},
</if>
<if test="yearTaxes != null">
#{yearTaxes,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ruoyi.system.domain.grid.GridCompanyEconomyInfoExample" resultType="java.lang.Long">
......@@ -198,6 +213,12 @@
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=VARCHAR},
</if>
<if test="record.yearSales != null">
year_sales = #{record.yearSales,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
year_taxes = #{record.yearTaxes,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
......@@ -212,7 +233,9 @@
per_mu = #{record.perMu,jdbcType=DECIMAL},
year = #{record.year,jdbcType=VARCHAR},
is_valid = #{record.isValid,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=VARCHAR}
create_time = #{record.createTime,jdbcType=VARCHAR},
year_sales = #{record.yearSales,jdbcType=VARCHAR},
year_taxes = #{record.yearTaxes,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -241,6 +264,12 @@
<if test="createTime != null">
create_time = #{createTime,jdbcType=VARCHAR},
</if>
<if test="record.yearSales != null">
year_sales = #{yearSales,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
year_taxes = #{yearTaxes,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
......@@ -252,7 +281,9 @@
per_mu = #{perMu,jdbcType=DECIMAL},
year = #{year,jdbcType=VARCHAR},
is_valid = #{isValid,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=VARCHAR}
create_time = #{createTime,jdbcType=VARCHAR},
year_sales = #{yearSales,jdbcType=VARCHAR},
year_taxes = #{yearTaxes,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
......@@ -273,7 +273,8 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ruoyi.system.domain.grid.GridCompanyExample" resultType="java.lang.Long">
<select id="countByExample" parameterType="com.ruoyi.system.domain.grid.GridCompanyExample" resultType="java.lang.Long">
select count(*) from grid_company
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
......@@ -550,4 +551,14 @@
and wg_code like CONCAT(#{wgCode}, '%')
</if>
</select>
<select id="selectLabelById" resultType="java.lang.String">
select label from grid_company
where id = #{id}
</select>
<insert id="insertLabelById">
update grid_company
set label = #{label,jdbcType=VARCHAR}
where id = #{id}
</insert>
</mapper>
......@@ -87,7 +87,7 @@
<sql id="Base_Column_List">
id, wg_type, wg_code, wg_name, wg_parent_id, wg_area, wg_centre_coordinate,
wg_principal, create_time, create_by, update_time, update_by, level, is_valid, ylzd1,
ylzd2, ylzd3, ylzd4, ylzd5, wg_purpose
ylzd2, ylzd3, ylzd4, ylzd5, wg_purpose, status
</sql>
<sql id="Blob_Column_List">
wg_coordinate
......@@ -587,7 +587,7 @@
)
</if>
<if test="isShow == false">
and level != '4'
and level != '4' and level != '3'
</if>
<if test="wgCodeIn != null and wgCodeIn.size() > 0">
and wg_code in
......@@ -642,4 +642,43 @@
select wg_type from grid_region
where wg_code = #{wgCode}
</select>
<select id="getRegionByTypeAndCode" resultType="com.ruoyi.system.domain.grid.GridRegion">
select
<include refid="Base_Column_List" />
from grid_region where is_valid = '1'
<if test="wgCodeLikes != null and wgCodeLikes.size() > 0">
and (
<foreach collection="wgCodeLikes" item="wgCode" open="(" close=")" separator="or">
wg_code like CONCAT(#{wgCode}, '%')
</foreach>
)
</if>
<if test="wgCodeLikes != null and wgCodeLikes.size() > 0">
and (
<foreach collection="wgCodeLikes" item="wgCode" open="(" close=")" separator="and">
wg_code != #{wgCode}
</foreach>
)
</if>
<if test="wgType != null and wgType != ''">
and wg_type = #{wgType}
</if>
and level = #{level}
</select>
<select id="getAllLevelThreeByType" resultType="com.ruoyi.system.domain.grid.GridRegion">
select
<include refid="Base_Column_List" />
from grid_region where is_valid = '1'
and level = 3 and wg_type = #{type}
and wg_code like CONCAT(#{code}, '%')
and wg_code != #{code}
</select>
<select id="getAllLevelFourByType" resultType="com.ruoyi.system.domain.grid.GridRegion">
select
<include refid="Base_Column_List" />
from grid_region where is_valid = '1'
and level = 4 and wg_type = #{type}
and wg_code like CONCAT(#{code}, '%')
and wg_code != #{code}
</select>
</mapper>
\ No newline at end of file
......@@ -470,4 +470,14 @@
</if>
</select>
<select id="selectLabelById" resultType="java.lang.String">
select label from grid_shop
where id = #{id}
</select>
<insert id="insertLabelById">
insert into grid_shop
(label) values (#{label,jdbcType=VARCHAR})
where id = #{id}
</insert>
</mapper>
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment