ソースを参照

修复发改委

Administrator 2 年 前
コミット
cb6e158f3c
18 ファイル変更768 行追加44 行削除
  1. 1 1
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/projectV2/ZsyzSkDzjeController.java
  2. 110 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/projectV2/ZsyzSkcyController.java
  3. 1 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/projectV2/common/ZsyzCommonController.java
  4. 2 2
      ruoyi-admin/src/main/resources/application.yml
  5. 14 0
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
  6. 6 4
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/projectV2/common/ZsyzCommonServiceImpL.java
  7. 138 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/projectV2/ZsyzSkcy.java
  8. 1 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/projectV2/ZsyzSkDzjeMapper.java
  9. 81 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/projectV2/ZsyzSkcyMapper.java
  10. 161 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/projectV2/ZsyzSkcyServiceImpl.java
  11. 18 2
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/projectV2/ZsyzSkxmServiceImpl.java
  12. 69 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/projectV2/IZsyzSkcyService.java
  13. 1 1
      ruoyi-system/src/main/java/com/ruoyi/system/service/projectV2/common/IZsyzCommonService.java
  14. 6 2
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
  15. 4 1
      ruoyi-system/src/main/resources/mapper/system/projectV2/ZsyzSkDzjeMapper.xml
  16. 1 0
      ruoyi-system/src/main/resources/mapper/system/projectV2/ZsyzSkSwtzdwMapper.xml
  17. 123 0
      ruoyi-system/src/main/resources/mapper/system/projectV2/ZsyzSkcyMapper.xml
  18. 31 29
      ruoyi-system/src/main/resources/mapper/system/projectV2/ZsyzSkxmMapper.xml

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/projectV2/ZsyzSkDzjeController.java

@@ -97,7 +97,7 @@ public class ZsyzSkDzjeController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('projectV2:dzje:remove')")
     @Log(title = "招商引资_省库项目_到资金额", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
+	@GetMapping("/delete/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)
     {
         return toAjax(zsyzSkDzjeService.deleteZsyzSkDzjeByIds(ids));

+ 110 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/projectV2/ZsyzSkcyController.java

@@ -0,0 +1,110 @@
+package com.ruoyi.web.controller.projectV2;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.core.domain.entity.SysDept;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.projectV2.ZsyzSkcy;
+import com.ruoyi.system.service.projectV2.IZsyzSkcyService;
+import org.apache.commons.lang3.ArrayUtils;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 省库产业Controller
+ * 
+ * @author boman
+ * @date 2023-03-29
+ */
+@RestController
+@RequestMapping("/projectV2/skcy")
+public class ZsyzSkcyController extends BaseController
+{
+    @Autowired
+    private IZsyzSkcyService zsyzSkcyService;
+
+    /**
+     * 查询省库产业列表
+     */
+    @GetMapping("/list")
+    public AjaxResult list(ZsyzSkcy zsyzSkcy)
+    {
+        List<ZsyzSkcy> list = zsyzSkcyService.selectZsyzSkcyList(zsyzSkcy);
+        return success(list);
+    }
+
+    /**
+     * 导出省库产业列表
+     */
+    @PreAuthorize("@ss.hasPermi('projectV2:skcy:export')")
+    @Log(title = "省库产业", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, ZsyzSkcy zsyzSkcy)
+    {
+        List<ZsyzSkcy> list = zsyzSkcyService.selectZsyzSkcyList(zsyzSkcy);
+        ExcelUtil<ZsyzSkcy> util = new ExcelUtil<ZsyzSkcy>(ZsyzSkcy.class);
+        util.exportExcel(response, list, "省库产业数据");
+    }
+
+    /**
+     * 获取省库产业详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('projectV2:skcy:query')")
+    @GetMapping(value = "/{skcyId}")
+    public AjaxResult getInfo(@PathVariable("skcyId") Long skcyId)
+    {
+        return success(zsyzSkcyService.selectZsyzSkcyBySkcyId(skcyId));
+    }
+
+    /**
+     * 新增省库产业
+     */
+    @PreAuthorize("@ss.hasPermi('projectV2:skcy:add')")
+    @Log(title = "省库产业", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ZsyzSkcy zsyzSkcy)
+    {
+        return toAjax(zsyzSkcyService.insertZsyzSkcy(zsyzSkcy));
+    }
+
+    /**
+     * 修改省库产业
+     */
+    @PreAuthorize("@ss.hasPermi('projectV2:skcy:edit')")
+    @Log(title = "省库产业", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody ZsyzSkcy zsyzSkcy)
+    {
+        return toAjax(zsyzSkcyService.updateZsyzSkcy(zsyzSkcy));
+    }
+
+    /**
+     * 删除省库产业
+     */
+    @PreAuthorize("@ss.hasPermi('projectV2:skcy:remove')")
+    @Log(title = "省库产业", businessType = BusinessType.DELETE)
+	@GetMapping("/delete/{skcyIds}")
+    public AjaxResult remove(@PathVariable Long skcyId)
+    {
+        if (zsyzSkcyService.hasChildBySkcyId(skcyId))
+        {
+            return warn("存在下级产业,不允许删除");
+        }
+        return toAjax(zsyzSkcyService.deleteZsyzSkcyBySkcyId(skcyId));
+    }
+}

+ 1 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/projectV2/common/ZsyzCommonController.java

@@ -198,8 +198,7 @@ public class ZsyzCommonController extends BaseController {
      * @return
      */
     @GetMapping("/area/{pid}")
-    @PreAuthorize("@ss.hasPermi('projectV2:common:area')")
-    public AjaxResult area(@PathVariable("pid") Long pid ) {
+    public AjaxResult area(@PathVariable("pid") String pid ) {
         //所有审核需要往审核意见表插入数据
         return zsyzCommonService.area(pid);
     }

+ 2 - 2
ruoyi-admin/src/main/resources/application.yml

@@ -20,7 +20,7 @@ spring:
     basename: i18n/messages
   profiles:
     active: druid
-    #active: prod
+#    active: prod
   # 文件上传
   servlet:
      multipart:
@@ -41,7 +41,7 @@ token:
     # 令牌密钥
     secret: abcdefghijklmnopqrstuvwxyz
     # 令牌有效期(默认30分钟)
-    expireTime: 30
+    expireTime: 300
   
 # MyBatis配置
 mybatis:

+ 14 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java

@@ -37,6 +37,11 @@ public class SysUser extends BaseEntity
     @Excel(name = "用户名称")
     private String nickName;
 
+    /**
+     * 用户类型
+     */
+    private String userType;
+
     /** 用户邮箱 */
     @Excel(name = "用户邮箱")
     private String email;
@@ -98,6 +103,14 @@ public class SysUser extends BaseEntity
 
     }
 
+    public String getUserType() {
+        return userType;
+    }
+
+    public void setUserType(String userType) {
+        this.userType = userType;
+    }
+
     public SysUser(Long userId)
     {
         this.userId = userId;
@@ -316,6 +329,7 @@ public class SysUser extends BaseEntity
             .append("deptId", getDeptId())
             .append("userName", getUserName())
             .append("nickName", getNickName())
+            .append("userType", getUserType())
             .append("email", getEmail())
             .append("phonenumber", getPhonenumber())
             .append("sex", getSex())

+ 6 - 4
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/projectV2/common/ZsyzCommonServiceImpL.java

@@ -14,6 +14,7 @@ import com.ruoyi.framework.manager.AsyncManager;
 import com.ruoyi.framework.manager.factory.AsyncFactory;
 import com.ruoyi.system.domain.projectV2.*;
 import com.ruoyi.system.domain.projectV2.Vo.ZpVo;
+import com.ruoyi.system.domain.projectV2.common.ChinaArea;
 import com.ruoyi.system.domain.projectV2.common.SendSmsConfig;
 import com.ruoyi.system.mapper.SysDeptMapper;
 import com.ruoyi.system.mapper.projectV2.*;
@@ -132,8 +133,8 @@ public class ZsyzCommonServiceImpL implements IZsyzCommonService {
     public AjaxResult sksh(ZsyzSkxm zsyzSkxm) {
         ZsyzSkxm zsyzSkxmOld = zsyzSkxmMapper.selectZsyzSkxmById(zsyzSkxm.getId());
         if (zsyzSkxmOld != null){
-            String isHs = zsyzSkxmOld.getIsHs();
-            if (!ONE.equals(isHs)){
+            String isSh = zsyzSkxmOld.getIsSh();
+            if (!ONE.equals(isSh)){
                 return AjaxResult.error("当前项目已审核");
             }
         }
@@ -153,8 +154,9 @@ public class ZsyzCommonServiceImpL implements IZsyzCommonService {
      * @return
      */
     @Override
-    public AjaxResult area(Long pid) {
-        return AjaxResult.success(chinaAreaMapper.selectChinaAreaByAreaId(String.valueOf(pid)));
+    public AjaxResult area(String pid) {
+        List<ChinaArea> chinaAreas = chinaAreaMapper.selectChinaAreaByPId(pid);
+        return AjaxResult.success(chinaAreas);
     }
 
     /**

+ 138 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/projectV2/ZsyzSkcy.java

@@ -0,0 +1,138 @@
+package com.ruoyi.system.domain.projectV2;
+
+import com.ruoyi.common.core.domain.entity.SysDept;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 省库产业对象 zsyz_skcy
+ * 
+ * @author boman
+ * @date 2023-03-29
+ */
+public class ZsyzSkcy extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 部门id */
+    private Long skcyId;
+
+    /** 父部门id */
+    @Excel(name = "父部门id")
+    private Long parentId;
+
+    /** 祖级列表 */
+    @Excel(name = "祖级列表")
+    private String ancestors;
+
+    /** 产业名称 */
+    @Excel(name = "产业名称")
+    private String deptName;
+
+    /** 显示顺序 */
+    @Excel(name = "显示顺序")
+    private Integer orderNum;
+
+    /** 部门状态(0正常 1停用) */
+    @Excel(name = "部门状态", readConverterExp = "0=正常,1=停用")
+    private String status;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    private String delFlag;
+    /** 子部门 */
+    private List<ZsyzSkcy> children = new ArrayList<ZsyzSkcy>();
+
+    public List<ZsyzSkcy> getChildren() {
+        return children;
+    }
+
+    public void setChildren(List<ZsyzSkcy> children) {
+        this.children = children;
+    }
+
+    public void setSkcyId(Long skcyId)
+    {
+        this.skcyId = skcyId;
+    }
+
+    public Long getSkcyId() 
+    {
+        return skcyId;
+    }
+    public void setParentId(Long parentId) 
+    {
+        this.parentId = parentId;
+    }
+
+    public Long getParentId() 
+    {
+        return parentId;
+    }
+    public void setAncestors(String ancestors) 
+    {
+        this.ancestors = ancestors;
+    }
+
+    public String getAncestors() 
+    {
+        return ancestors;
+    }
+    public void setDeptName(String deptName) 
+    {
+        this.deptName = deptName;
+    }
+
+    public String getDeptName() 
+    {
+        return deptName;
+    }
+    public void setOrderNum(Integer orderNum) 
+    {
+        this.orderNum = orderNum;
+    }
+
+    public Integer getOrderNum() 
+    {
+        return orderNum;
+    }
+    public void setStatus(String status) 
+    {
+        this.status = status;
+    }
+
+    public String getStatus() 
+    {
+        return status;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("skcyId", getSkcyId())
+            .append("parentId", getParentId())
+            .append("ancestors", getAncestors())
+            .append("deptName", getDeptName())
+            .append("orderNum", getOrderNum())
+            .append("status", getStatus())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/projectV2/ZsyzSkDzjeMapper.java

@@ -59,6 +59,7 @@ public interface ZsyzSkDzjeMapper
      * @return 结果
      */
     public int deleteZsyzSkDzjeById(Long id);
+    public int deleteZsyzSkDzjeBySkId(Long id);
 
     /**
      * 批量删除招商引资_省库项目_到资金额

+ 81 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/projectV2/ZsyzSkcyMapper.java

@@ -0,0 +1,81 @@
+package com.ruoyi.system.mapper.projectV2;
+
+import com.ruoyi.common.core.domain.entity.SysDept;
+import com.ruoyi.system.domain.projectV2.ZsyzSkcy;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 省库产业Mapper接口
+ * 
+ * @author boman
+ * @date 2023-03-29
+ */
+public interface ZsyzSkcyMapper 
+{
+    /**
+     * 查询省库产业
+     * 
+     * @param skcyId 省库产业主键
+     * @return 省库产业
+     */
+    public ZsyzSkcy selectZsyzSkcyBySkcyId(Long skcyId);
+
+    /**
+     * 根据ID查询所有子产业
+     *
+     * @param skcyId 产业ID
+     * @return 产业列表
+     */
+    public List<ZsyzSkcy> selectChildrenSkcyById(Long skcyId);
+
+    /**
+     * 查询省库产业列表
+     * 
+     * @param zsyzSkcy 省库产业
+     * @return 省库产业集合
+     */
+    public List<ZsyzSkcy> selectZsyzSkcyList(ZsyzSkcy zsyzSkcy);
+
+    /**
+     * 新增省库产业
+     * 
+     * @param zsyzSkcy 省库产业
+     * @return 结果
+     */
+    public int insertZsyzSkcy(ZsyzSkcy zsyzSkcy);
+
+    /**
+     * 修改省库产业
+     * 
+     * @param zsyzSkcy 省库产业
+     * @return 结果
+     */
+    public int updateZsyzSkcy(ZsyzSkcy zsyzSkcy);
+    public int updateZsyzSkcyChildren(@Param("zsyzSkcys") List<ZsyzSkcy> zsyzSkcys);
+
+    /**
+     * 删除省库产业
+     * 
+     * @param skcyId 省库产业主键
+     * @return 结果
+     */
+    public int deleteZsyzSkcyBySkcyId(Long skcyId);
+
+    /**
+     * 批量删除省库产业
+     * 
+     * @param skcyIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteZsyzSkcyBySkcyIds(Long[] skcyIds);
+    public int updateZsyzSkcyStatusNormal(Long[] skcyIds);
+    /**
+     * 是否存在子节点
+     *
+     * @param skcyId 产业ID
+     * @return 结果
+     */
+    public int hasChildBySkcyId(Long skcyId);
+}

+ 161 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/projectV2/ZsyzSkcyServiceImpl.java

@@ -0,0 +1,161 @@
+package com.ruoyi.system.service.impl.projectV2;
+
+import java.util.List;
+
+import com.ruoyi.common.annotation.DataScope;
+import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.domain.entity.SysDept;
+import com.ruoyi.common.core.text.Convert;
+import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.system.domain.projectV2.ZsyzSkcy;
+import com.ruoyi.system.mapper.projectV2.ZsyzSkcyMapper;
+import com.ruoyi.system.service.projectV2.IZsyzSkcyService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 省库产业Service业务层处理
+ * 
+ * @author boman
+ * @date 2023-03-29
+ */
+@Service
+public class ZsyzSkcyServiceImpl implements IZsyzSkcyService
+{
+    @Autowired
+    private ZsyzSkcyMapper zsyzSkcyMapper;
+
+    /**
+     * 查询省库产业
+     * 
+     * @param skcyId 省库产业主键
+     * @return 省库产业
+     */
+    @Override
+    public ZsyzSkcy selectZsyzSkcyBySkcyId(Long skcyId)
+    {
+        return zsyzSkcyMapper.selectZsyzSkcyBySkcyId(skcyId);
+    }
+
+    /**
+     * 查询省库产业列表
+     * 
+     * @param zsyzSkcy 省库产业
+     * @return 省库产业
+     */
+    @Override
+    public List<ZsyzSkcy> selectZsyzSkcyList(ZsyzSkcy zsyzSkcy)
+    {
+        return zsyzSkcyMapper.selectZsyzSkcyList(zsyzSkcy);
+    }
+
+    /**
+     * 新增省库产业
+     * 
+     * @param zsyzSkcy 省库产业
+     * @return 结果
+     */
+    @Override
+    public int insertZsyzSkcy(ZsyzSkcy zsyzSkcy)
+    {
+        ZsyzSkcy info = zsyzSkcyMapper.selectZsyzSkcyBySkcyId(zsyzSkcy.getParentId());
+        if (info == null){
+            zsyzSkcy.setParentId(0L);
+            zsyzSkcy.setAncestors("0");
+        }else {
+            // 如果父节点不为正常状态,则不允许新增子节点
+            if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
+            {
+                throw new ServiceException("省库产业停用,不允许新增");
+            }
+            zsyzSkcy.setAncestors(info.getAncestors() + "," + zsyzSkcy.getParentId());
+        }
+        zsyzSkcy.setCreateTime(DateUtils.getNowDate());
+        return zsyzSkcyMapper.insertZsyzSkcy(zsyzSkcy);
+    }
+
+    /**
+     * 修改省库产业
+     * 
+     * @param zsyzSkcy 省库产业
+     * @return 结果
+     */
+    @Override
+    public int updateZsyzSkcy(ZsyzSkcy zsyzSkcy)
+    {
+        ZsyzSkcy newParentZsyzSkcy = zsyzSkcyMapper.selectZsyzSkcyBySkcyId(zsyzSkcy.getParentId());
+        ZsyzSkcy oldZsyzSkcy = zsyzSkcyMapper.selectZsyzSkcyBySkcyId(zsyzSkcy.getSkcyId());
+        if (StringUtils.isNotNull(newParentZsyzSkcy) && StringUtils.isNotNull(oldZsyzSkcy))
+        {
+            String newAncestors = newParentZsyzSkcy.getAncestors() + "," + newParentZsyzSkcy.getSkcyId();
+            String oldAncestors = oldZsyzSkcy.getAncestors();
+            zsyzSkcy.setAncestors(newAncestors);
+            updateZsyzSkcyChildren(zsyzSkcy.getSkcyId(), newAncestors, oldAncestors);
+        }
+        zsyzSkcy.setUpdateTime(DateUtils.getNowDate());
+        int result = zsyzSkcyMapper.updateZsyzSkcy(zsyzSkcy);
+        if (UserConstants.DEPT_NORMAL.equals(zsyzSkcy.getStatus()) && StringUtils.isNotEmpty(zsyzSkcy.getAncestors())
+                && !StringUtils.equals("0", zsyzSkcy.getAncestors()))
+        {
+            // 如果该部门是启用状态,则启用该部门的所有上级部门
+            updateParentZsyzSkcyStatusNormal(zsyzSkcy);
+        }
+        return result;
+    }
+
+    public void updateZsyzSkcyChildren(Long skcyId, String newAncestors, String oldAncestors)
+    {
+        List<ZsyzSkcy> children = zsyzSkcyMapper.selectChildrenSkcyById(skcyId);
+        for (ZsyzSkcy child : children)
+        {
+            child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors));
+        }
+        if (children.size() > 0)
+        {
+            zsyzSkcyMapper.updateZsyzSkcyChildren(children);
+        }
+    }
+
+    /**
+     * 修改该产业的父级产业状态
+     *
+     * @param zsyzSkcy 当前产业
+     */
+    private void updateParentZsyzSkcyStatusNormal(ZsyzSkcy zsyzSkcy)
+    {
+        String ancestors = zsyzSkcy.getAncestors();
+        Long[] skcyIds = Convert.toLongArray(ancestors);
+        zsyzSkcyMapper.updateZsyzSkcyStatusNormal(skcyIds);
+    }
+    /**
+     * 批量删除省库产业
+     * 
+     * @param skcyIds 需要删除的省库产业主键
+     * @return 结果
+     */
+    @Override
+    public int deleteZsyzSkcyBySkcyIds(Long[] skcyIds)
+    {
+        return zsyzSkcyMapper.deleteZsyzSkcyBySkcyIds(skcyIds);
+    }
+
+    /**
+     * 删除省库产业信息
+     * 
+     * @param skcyId 省库产业主键
+     * @return 结果
+     */
+    @Override
+    public int deleteZsyzSkcyBySkcyId(Long skcyId)
+    {
+        return zsyzSkcyMapper.deleteZsyzSkcyBySkcyId(skcyId);
+    }
+
+    @Override
+    public boolean hasChildBySkcyId(Long skcyId) {
+        int result = zsyzSkcyMapper.hasChildBySkcyId(skcyId);
+        return result > 0;
+    }
+}

+ 18 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/projectV2/ZsyzSkxmServiceImpl.java

@@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl.projectV2;
 
 import java.util.List;
 
+import com.ruoyi.common.annotation.DataScope;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.system.domain.projectV2.ZsyzFj;
@@ -48,6 +49,19 @@ public class ZsyzSkxmServiceImpl implements IZsyzSkxmService {
         ZsyzSkxm zsyzSkxm = zsyzSkxmMapper.selectZsyzSkxmById(id);
         if (zsyzSkxm != null) {
             List<ZsyzSkSwtzdw> zsyzSkSwtzdws = zsyzSkSwtzdwMapper.selectZsyzSkSwtzdwBySkId(zsyzSkxm.getId());
+            ZsyzFj zsyzFj = new ZsyzFj();
+            zsyzFj.setSourceId(zsyzSkxm.getId());
+            zsyzFj.setType(SIX);
+            List<ZsyzFj> zsyzFjs = zsyzFjMapper.selectZsyzFjList(zsyzFj);
+            ZsyzSkDzje zsyzSkDzje = new ZsyzSkDzje();
+            zsyzSkDzje.setSkId(zsyzSkxm.getId());
+            List<ZsyzSkDzje> zsyzSkDzjes = zsyzSkDzjeMapper.selectZsyzSkDzjeList(zsyzSkDzje);
+            if (zsyzSkDzjes != null && zsyzSkDzjes.size() > 0){
+                zsyzSkxm.setZsyzSkDzjeList(zsyzSkDzjes);
+            }
+            if (zsyzFjs != null && zsyzFjs.size() > 0){
+                zsyzSkxm.setZsyzFjList(zsyzFjs);
+            }
             if (zsyzSkSwtzdws != null && zsyzSkSwtzdws.size() > 0) {
                 zsyzSkxm.setZsyzSkSwtzdwList(zsyzSkSwtzdws);
             }
@@ -62,6 +76,7 @@ public class ZsyzSkxmServiceImpl implements IZsyzSkxmService {
      * @return 招商引资_省库项目
      */
     @Override
+    @DataScope(deptAlias = "z")
     public List<ZsyzSkxm> selectZsyzSkxmList(ZsyzSkxm zsyzSkxm) {
         List<ZsyzSkxm> zsyzSkxms = zsyzSkxmMapper.selectZsyzSkxmList(zsyzSkxm);
         //查询实际到资金额
@@ -121,7 +136,7 @@ public class ZsyzSkxmServiceImpl implements IZsyzSkxmService {
     @Override
     public int updateZsyzSkxm(ZsyzSkxm zsyzSkxm) {
         zsyzSkxm.setUpdateTime(DateUtils.getNowDate());
-        zsyzSkxm.setIsHs(ONE);
+        zsyzSkxm.setIsSh(ONE);
         int i = zsyzSkxmMapper.updateZsyzSkxm(zsyzSkxm);
         List<ZsyzSkSwtzdw> zsyzSkSwtzdwList = zsyzSkxm.getZsyzSkSwtzdwList();
         if (zsyzSkSwtzdwList != null && zsyzSkSwtzdwList.size() > 0) {
@@ -133,10 +148,11 @@ public class ZsyzSkxmServiceImpl implements IZsyzSkxmService {
         }
         List<ZsyzSkDzje> zsyzSkDzjeList = zsyzSkxm.getZsyzSkDzjeList();
         if (zsyzSkDzjeList != null && zsyzSkDzjeList.size() > 0) {
+            zsyzSkDzjeMapper.deleteZsyzSkDzjeBySkId(zsyzSkxm.getId());
             for (ZsyzSkDzje zsyzSkDzje : zsyzSkDzjeList) {
                 zsyzSkDzje.setXmmc(zsyzSkxm.getXmmc());
                 zsyzSkDzje.setSkId(zsyzSkxm.getId());
-                zsyzSkDzjeMapper.updateZsyzSkDzje(zsyzSkDzje);
+                zsyzSkDzjeMapper.insertZsyzSkDzje(zsyzSkDzje);
             }
         }
         List<ZsyzFj> zsyzFjList = zsyzSkxm.getZsyzFjList();

+ 69 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/projectV2/IZsyzSkcyService.java

@@ -0,0 +1,69 @@
+package com.ruoyi.system.service.projectV2;
+
+import com.ruoyi.system.domain.projectV2.ZsyzSkcy;
+
+import java.util.List;
+
+/**
+ * 省库产业Service接口
+ * 
+ * @author boman
+ * @date 2023-03-29
+ */
+public interface IZsyzSkcyService 
+{
+    /**
+     * 查询省库产业
+     * 
+     * @param skcyId 省库产业主键
+     * @return 省库产业
+     */
+    public ZsyzSkcy selectZsyzSkcyBySkcyId(Long skcyId);
+
+    /**
+     * 查询省库产业列表
+     * 
+     * @param zsyzSkcy 省库产业
+     * @return 省库产业集合
+     */
+    public List<ZsyzSkcy> selectZsyzSkcyList(ZsyzSkcy zsyzSkcy);
+
+    /**
+     * 新增省库产业
+     * 
+     * @param zsyzSkcy 省库产业
+     * @return 结果
+     */
+    public int insertZsyzSkcy(ZsyzSkcy zsyzSkcy);
+
+    /**
+     * 修改省库产业
+     * 
+     * @param zsyzSkcy 省库产业
+     * @return 结果
+     */
+    public int updateZsyzSkcy(ZsyzSkcy zsyzSkcy);
+
+    /**
+     * 批量删除省库产业
+     * 
+     * @param skcyIds 需要删除的省库产业主键集合
+     * @return 结果
+     */
+    public int deleteZsyzSkcyBySkcyIds(Long[] skcyIds);
+
+    /**
+     * 删除省库产业信息
+     * 
+     * @param skcyId 省库产业主键
+     * @return 结果
+     */
+    public int deleteZsyzSkcyBySkcyId(Long skcyId);
+    /**
+     * 是否存在产业子节点
+     *
+     * @param skcyId 产业ID
+     * @return 结果
+     */
+    public boolean hasChildBySkcyId(Long skcyId);
+}

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/projectV2/common/IZsyzCommonService.java

@@ -34,7 +34,7 @@ public interface IZsyzCommonService
    * @param pid
    * @return
    */
-  public AjaxResult area(Long pid);
+  public AjaxResult area(String pid);
 
   /**
    * Cjd的项目审核/驳回接口

+ 6 - 2
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="deptId"       column="dept_id"      />
         <result property="userName"     column="user_name"    />
         <result property="nickName"     column="nick_name"    />
+        <result property="userType"     column="user_type"    />
         <result property="email"        column="email"        />
         <result property="phonenumber"  column="phonenumber"  />
         <result property="sex"          column="sex"          />
@@ -48,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 	
 	<sql id="selectUserVo">
-        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date,u.jg_id, u.create_by, u.create_time, u.remark,
+        select u.user_id, u.dept_id, u.user_name, u.nick_name,u.user_type, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date,u.jg_id, u.create_by, u.create_time, u.remark,
         d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
         r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
         from sys_user u
@@ -58,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
     
     <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
-		select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date,u.jg_id, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
+		select u.user_id, u.dept_id, u.nick_name, u.user_name,u.user_type, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date,u.jg_id, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
 		left join sys_dept d on u.dept_id = d.dept_id
 		where u.del_flag = '0'
 		<if test="userId != null and userId != 0">
@@ -152,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="deptId != null and deptId != 0">dept_id,</if>
  			<if test="userName != null and userName != ''">user_name,</if>
  			<if test="nickName != null and nickName != ''">nick_name,</if>
+ 			<if test="userType != null and userType != ''">user_type,</if>
  			<if test="email != null and email != ''">email,</if>
  			<if test="avatar != null and avatar != ''">avatar,</if>
  			<if test="phonenumber != null and phonenumber != ''">phonenumber,</if>
@@ -167,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="deptId != null and deptId != ''">#{deptId},</if>
  			<if test="userName != null and userName != ''">#{userName},</if>
  			<if test="nickName != null and nickName != ''">#{nickName},</if>
+ 			<if test="userType != null and userType != ''">#{userType},</if>
  			<if test="email != null and email != ''">#{email},</if>
  			<if test="avatar != null and avatar != ''">#{avatar},</if>
  			<if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if>
@@ -186,6 +189,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="deptId != null and deptId != 0">dept_id = #{deptId},</if>
  			<if test="userName != null and userName != ''">user_name = #{userName},</if>
  			<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
+ 			<if test="userType != null and userType != ''">user_type = #{userType},</if>
  			<if test="email != null ">email = #{email},</if>
  			<if test="phonenumber != null ">phonenumber = #{phonenumber},</if>
  			<if test="sex != null and sex != ''">sex = #{sex},</if>

+ 4 - 1
ruoyi-system/src/main/resources/mapper/system/projectV2/ZsyzSkDzjeMapper.xml

@@ -106,7 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="remark != null">remark = #{remark},</if>
         </trim>
-        where sk_id = #{id}
+        where sk_id = #{skId}
     </update>
 
     <delete id="deleteZsyzSkDzjeById" parameterType="Long">
@@ -119,4 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </delete>
+    <delete id="deleteZsyzSkDzjeBySkId">
+                delete from zsyz_sk_dzje where sk_id = #{id}
+    </delete>
 </mapper>

+ 1 - 0
ruoyi-system/src/main/resources/mapper/system/projectV2/ZsyzSkSwtzdwMapper.xml

@@ -39,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="cityId != null  and cityId != ''"> and city_id = #{cityId}</if>
             <if test="dwjj != null  and dwjj != ''"> and dwjj = #{dwjj}</if>
         </where>
+        order by create_time DESC
     </select>
     
     <select id="selectZsyzSkSwtzdwById" parameterType="Long" resultMap="ZsyzSkSwtzdwResult">

+ 123 - 0
ruoyi-system/src/main/resources/mapper/system/projectV2/ZsyzSkcyMapper.xml

@@ -0,0 +1,123 @@
+<?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.ruoyi.system.mapper.projectV2.ZsyzSkcyMapper">
+    
+    <resultMap type="ZsyzSkcy" id="ZsyzSkcyResult">
+        <result property="skcyId"    column="skcy_id"    />
+        <result property="parentId"    column="parent_id"    />
+        <result property="ancestors"    column="ancestors"    />
+        <result property="deptName"    column="dept_name"    />
+        <result property="orderNum"    column="order_num"    />
+        <result property="status"    column="status"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectZsyzSkcyVo">
+        select skcy_id, parent_id, ancestors, dept_name, order_num, status, del_flag, create_by, create_time, update_by, update_time from zsyz_skcy
+    </sql>
+
+    <select id="selectZsyzSkcyList" parameterType="ZsyzSkcy" resultMap="ZsyzSkcyResult">
+        <include refid="selectZsyzSkcyVo"/>
+        <where>  
+            <if test="parentId != null "> and parent_id = #{parentId}</if>
+            <if test="ancestors != null  and ancestors != ''"> and ancestors = #{ancestors}</if>
+            <if test="deptName != null  and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
+            <if test="orderNum != null "> and order_num = #{orderNum}</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+        </where>
+    </select>
+    
+    <select id="selectZsyzSkcyBySkcyId" parameterType="Long" resultMap="ZsyzSkcyResult">
+        <include refid="selectZsyzSkcyVo"/>
+        where skcy_id = #{skcyId}
+    </select>
+    <select id="selectChildrenSkcyById" resultType="com.ruoyi.system.domain.projectV2.ZsyzSkcy">
+        select * from zsyz_skcy where find_in_set(#{skcyId}, ancestors)
+    </select>
+
+    <insert id="insertZsyzSkcy" parameterType="ZsyzSkcy" useGeneratedKeys="true" keyProperty="skcyId">
+        insert into zsyz_skcy
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="parentId != null">parent_id,</if>
+            <if test="ancestors != null">ancestors,</if>
+            <if test="deptName != null">dept_name,</if>
+            <if test="orderNum != null">order_num,</if>
+            <if test="status != null">status,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="parentId != null">#{parentId},</if>
+            <if test="ancestors != null">#{ancestors},</if>
+            <if test="deptName != null">#{deptName},</if>
+            <if test="orderNum != null">#{orderNum},</if>
+            <if test="status != null">#{status},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateZsyzSkcy" parameterType="ZsyzSkcy">
+        update zsyz_skcy
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="parentId != null">parent_id = #{parentId},</if>
+            <if test="ancestors != null">ancestors = #{ancestors},</if>
+            <if test="deptName != null">dept_name = #{deptName},</if>
+            <if test="orderNum != null">order_num = #{orderNum},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where skcy_id = #{skcyId}
+    </update>
+    <update id="updateZsyzSkcyChildren" parameterType="java.util.List">
+            update zsyz_skcy set ancestors =
+            <foreach collection="zsyzSkcys" item="item" index="index"
+                     separator=" " open="case skcy_id" close="end">
+                when #{item.skcyId} then #{item.ancestors}
+            </foreach>
+            where skcy_id in
+            <foreach collection="zsyzSkcys" item="item" index="index"
+                     separator="," open="(" close=")">
+                #{item.skcyId}
+            </foreach>
+
+    </update>
+    <update id="updateZsyzSkcyStatusNormal" parameterType="Long">
+        update zsyz_skcy set status = '0' where skcy_id in
+        <foreach collection="array" item="skcyId" open="(" separator="," close=")">
+            #{skcyId}
+        </foreach>
+    </update>
+
+    <select id="hasChildBySkcyId" parameterType="Long" resultType="int">
+		select count(1) from zsyz_skcy
+		where del_flag = '0' and parent_id = #{SkcyId} limit 1
+	</select>
+
+    <delete id="deleteZsyzSkcyBySkcyId" parameterType="Long">
+        delete from zsyz_skcy where skcy_id = #{skcyId}
+    </delete>
+
+    <delete id="deleteZsyzSkcyBySkcyIds" parameterType="String">
+        delete from zsyz_skcy where skcy_id in 
+        <foreach item="skcyId" collection="array" open="(" separator="," close=")">
+            #{skcyId}
+        </foreach>
+    </delete>
+</mapper>

+ 31 - 29
ruoyi-system/src/main/resources/mapper/system/projectV2/ZsyzSkxmMapper.xml

@@ -39,43 +39,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectZsyzSkxmVo">
-        select id, is_hs, xmmc, pzwh, yyzz, szdq_id, szdq_name, sscy, xxcy, zdcy, is_lt, is_fzzlfdcy, tzfs, rk_time, kgjs_time, jswc_time, ztze, swzj, jsjd, xmnr, czwt, is_sh, sh_name, sh_time, sh_jy, dept_id, create_by, create_time, update_by, update_time, remark from zsyz_skxm
+        select z.id, z.is_hs, z.xmmc, z.pzwh, z.yyzz, z.szdq_id, z.szdq_name, z.sscy, z.xxcy, z.zdcy, z.is_lt, z.is_fzzlfdcy, z.tzfs, z.rk_time, z.kgjs_time, z.jswc_time, z.ztze, z.swzj, z.jsjd, z.xmnr, z.czwt, z.is_sh, z.sh_name, z.sh_time, z.sh_jy, z.dept_id, z.create_by, z.create_time, z.update_by, z.update_time, z.remark from zsyz_skxm z
     </sql>
 
     <select id="selectZsyzSkxmList" parameterType="ZsyzSkxm" resultMap="ZsyzSkxmResult">
         <include refid="selectZsyzSkxmVo"/>
-        <where>  
-            <if test="isHs != null  and isHs != ''"> and is_hs = #{isHs}</if>
-            <if test="xmmc != null  and xmmc != ''"> and xmmc = #{xmmc}</if>
-            <if test="pzwh != null  and pzwh != ''"> and pzwh = #{pzwh}</if>
-            <if test="yyzz != null  and yyzz != ''"> and yyzz = #{yyzz}</if>
-            <if test="szdqId != null  and szdqId != ''"> and szdq_id = #{szdqId}</if>
-            <if test="szdqName != null  and szdqName != ''"> and szdq_name like concat('%', #{szdqName}, '%')</if>
-            <if test="sscy != null  and sscy != ''"> and sscy = #{sscy}</if>
-            <if test="xxcy != null  and xxcy != ''"> and xxcy = #{xxcy}</if>
-            <if test="zdcy != null  and zdcy != ''"> and zdcy = #{zdcy}</if>
-            <if test="isLt != null  and isLt != ''"> and is_lt = #{isLt}</if>
-            <if test="isFzzlfdcy != null  and isFzzlfdcy != ''"> and is_fzzlfdcy = #{isFzzlfdcy}</if>
-            <if test="tzfs != null  and tzfs != ''"> and tzfs = #{tzfs}</if>
-            <if test="rkTime != null "> and rk_time = #{rkTime}</if>
-            <if test="kgjsTime != null "> and kgjs_time = #{kgjsTime}</if>
-            <if test="jswcTime != null "> and jswc_time = #{jswcTime}</if>
-            <if test="ztze != null  and ztze != ''"> and ztze = #{ztze}</if>
-            <if test="swzj != null  and swzj != ''"> and swzj = #{swzj}</if>
-            <if test="jsjd != null  and jsjd != ''"> and jsjd = #{jsjd}</if>
-            <if test="xmnr != null  and xmnr != ''"> and xmnr = #{xmnr}</if>
-            <if test="czwt != null  and czwt != ''"> and czwt = #{czwt}</if>
-            <if test="isSh != null  and isSh != ''"> and is_sh = #{isSh}</if>
-            <if test="shName != null  and shName != ''"> and sh_name like concat('%', #{shName}, '%')</if>
-            <if test="shTime != null "> and sh_time = #{shTime}</if>
-            <if test="shJy != null  and shJy != ''"> and sh_jy = #{shJy}</if>
-            <if test="deptId != null "> and dept_id = #{deptId}</if>
-        </where>
+        where 1=1
+            <if test="isHs != null  and isHs != ''"> and z.is_hs = #{isHs}</if>
+            <if test="xmmc != null  and xmmc != ''"> and z.xmmc = #{xmmc}</if>
+            <if test="pzwh != null  and pzwh != ''"> and z.pzwh = #{pzwh}</if>
+            <if test="yyzz != null  and yyzz != ''"> and z.yyzz = #{yyzz}</if>
+            <if test="szdqId != null  and szdqId != ''"> and z.szdq_id = #{szdqId}</if>
+            <if test="szdqName != null  and szdqName != ''"> and z.szdq_name like concat('%', #{szdqName}, '%')</if>
+            <if test="sscy != null  and sscy != ''"> and z.sscy = #{sscy}</if>
+            <if test="xxcy != null  and xxcy != ''"> and z.xxcy = #{xxcy}</if>
+            <if test="zdcy != null  and zdcy != ''"> and z.zdcy = #{zdcy}</if>
+            <if test="isLt != null  and isLt != ''"> and z.is_lt = #{isLt}</if>
+            <if test="isFzzlfdcy != null  and isFzzlfdcy != ''"> and z.is_fzzlfdcy = #{isFzzlfdcy}</if>
+            <if test="tzfs != null  and tzfs != ''"> and z.tzfs = #{tzfs}</if>
+            <if test="rkTime != null "> and z.rk_time = #{rkTime}</if>
+            <if test="kgjsTime != null "> and z.kgjs_time = #{kgjsTime}</if>
+            <if test="jswcTime != null "> and z.jswc_time = #{jswcTime}</if>
+            <if test="ztze != null  and ztze != ''"> and z.ztze = #{ztze}</if>
+            <if test="swzj != null  and swzj != ''"> and z.swzj = #{swzj}</if>
+            <if test="jsjd != null  and jsjd != ''"> and z.jsjd = #{jsjd}</if>
+            <if test="xmnr != null  and xmnr != ''"> and z.xmnr = #{xmnr}</if>
+            <if test="czwt != null  and czwt != ''"> and z.czwt = #{czwt}</if>
+            <if test="isSh != null  and isSh != ''"> and z.is_sh = #{isSh}</if>
+            <if test="shName != null  and shName != ''"> and z.sh_name like concat('%', #{shName}, '%')</if>
+            <if test="shTime != null "> and z.sh_time = #{shTime}</if>
+            <if test="shJy != null  and shJy != ''"> and z.sh_jy = #{shJy}</if>
+
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+        order by create_time DESC
     </select>
     
     <select id="selectZsyzSkxmById" parameterType="Long" resultMap="ZsyzSkxmResult">
         <include refid="selectZsyzSkxmVo"/>
-        where id = #{id}
+        where z.id = #{id}
     </select>
         
     <insert id="insertZsyzSkxm" parameterType="ZsyzSkxm" useGeneratedKeys="true" keyProperty="id">