diff --git a/erp_web/pages/materials/materialcategory.html b/erp_web/pages/materials/materialcategory.html index 9bd1fe3f..908a0641 100644 --- a/erp_web/pages/materials/materialcategory.html +++ b/erp_web/pages/materials/materialcategory.html @@ -15,65 +15,53 @@ - -
- - - - - - - - - - -
名称: - -  类别: - - - -   - 查询   - 重置 -
-
-
-
+ +
-
+ + + + - + - + + + + + +
上级目录 + + + + +
名称 + data-options="required:true,validType:'length[2,30]'" style="width: 200px;height: 20px"/> +
层次编号 - +
上级序号 - - +
备注 + +
@@ -82,169 +70,18 @@ 取消 +
+
diff --git a/erp_web/pages/materials/materialcategory_forselect.html b/erp_web/pages/materials/materialcategory_forselect.html new file mode 100644 index 00000000..0d82f32b --- /dev/null +++ b/erp_web/pages/materials/materialcategory_forselect.html @@ -0,0 +1,45 @@ + + + + 商品类别选择 + + + + + + + + + + + + + + +
+ +
+ + + + \ No newline at end of file diff --git a/sql/jsh_erp.sql b/sql/jsh_erp.sql index 003c3ceb..e49423cd 100644 --- a/sql/jsh_erp.sql +++ b/sql/jsh_erp.sql @@ -5291,3 +5291,51 @@ end; // DELIMITER ; +-- ---------------------------- +-- 时间:2019年2月18日 +-- version:1.0.3 +-- 此次更新修改产品类型表jsh_materialcategory,添加一些字段 +-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新 +-- ---------------------------- +-- ---------------------------- +-- 产品类型表添加字段sort,显示顺序 +-- ---------------------------- +alter table jsh_materialcategory add sort varchar(10) DEFAULT null COMMENT '显示顺序'; +-- ---------------------------- +-- 产品类型表添加字段status,状态,0系统默认,1启用,2删除 +-- ---------------------------- +alter table jsh_materialcategory add status varchar(1) DEFAULT '0' COMMENT '状态,0系统默认,1启用,2删除'; +-- ---------------------------- +-- 产品类型表添加字段serial_no,编号 +-- ---------------------------- +alter table jsh_materialcategory add serial_no varchar(100) DEFAULT null COMMENT '编号'; +-- ---------------------------- +-- 产品类型表添加字段remark,备注 +-- ---------------------------- +alter table jsh_materialcategory add remark varchar(1024) DEFAULT null COMMENT '备注'; +-- ---------------------------- +-- 产品类型表添加字段create_time,创建时间 +-- ---------------------------- +alter table jsh_materialcategory add create_time datetime DEFAULT null COMMENT '创建时间'; +-- ---------------------------- +-- 产品类型表添加字段creator,创建人 +-- ---------------------------- +alter table jsh_materialcategory add creator bigint(20) DEFAULT null COMMENT '创建人'; +-- ---------------------------- +-- 产品类型表添加字段update_time,更新时间 +-- ---------------------------- +alter table jsh_materialcategory add update_time datetime DEFAULT null COMMENT '更新时间'; +-- ---------------------------- +-- 产品类型表添加字段updater,更新人 +-- ---------------------------- +alter table jsh_materialcategory add updater bigint(20) DEFAULT null COMMENT '更新人'; + +-- ---------------------------- +-- 去掉jsh_materialcategory外键 +-- ---------------------------- +ALTER TABLE jsh_materialcategory DROP FOREIGN KEY FK3EE7F725237A77D8; + +-- ---------------------------- +-- 修改根目录父节点id为-1 +-- ---------------------------- +update jsh_materialcategory set ParentId='-1' where id='1' diff --git a/sql/华夏ERP数据库设计汇总.xlsx b/sql/华夏ERP数据库设计汇总.xlsx index 54f9e10f..634e8785 100644 Binary files a/sql/华夏ERP数据库设计汇总.xlsx and b/sql/华夏ERP数据库设计汇总.xlsx differ diff --git a/src/main/java/com/jsh/erp/constants/BusinessConstants.java b/src/main/java/com/jsh/erp/constants/BusinessConstants.java index 2a502570..9da92a5f 100644 --- a/src/main/java/com/jsh/erp/constants/BusinessConstants.java +++ b/src/main/java/com/jsh/erp/constants/BusinessConstants.java @@ -70,6 +70,19 @@ public class BusinessConstants { public static final String SEQ_TO_STRING_LESS_INSERT = "0"; //单据编号 public static final String DEPOT_NUMBER_SEQ = "depot_number_seq"; + /** + * 商品类别根目录id + * */ + public static final Long MATERIAL_CATEGORY_ROOT_ID = 1L; + /** + * 商品类别状态 + * 0系统默认,1启用,2删除 + * */ + public static final String MATERIAL_CATEGORY_STATUS_DEFAULT = "0"; + public static final String MATERIAL_CATEGORY_STATUS_ENABLE = "1"; + public static final String MATERIAL_CATEGORY_STATUS_DELETE = "2"; + + diff --git a/src/main/java/com/jsh/erp/constants/ExceptionConstants.java b/src/main/java/com/jsh/erp/constants/ExceptionConstants.java index 8056ad58..36eae9fd 100644 --- a/src/main/java/com/jsh/erp/constants/ExceptionConstants.java +++ b/src/main/java/com/jsh/erp/constants/ExceptionConstants.java @@ -59,6 +59,19 @@ public class ExceptionConstants { //商品库存不足 public static final int MATERIAL_STOCK_NOT_ENOUGH_CODE = 8000004; public static final String MATERIAL_STOCK_NOT_ENOUGH_MSG = "商品:%s库存不足"; + /** + * 商品类别信息 + * type = 75 + * */ + //添加商品类别信息失败 + public static final int MATERIAL_CATEGORY_ADD_FAILED_CODE = 7500000; + public static final String MATERIAL_CATEGORY_ADD_FAILED_MSG = "添加商品类别信息失败"; + //删除商品类别信息失败 + public static final int MATERIAL_CATEGORY_DELETE_FAILED_CODE = 7500001; + public static final String MATERIAL_CATEGORY_DELETE_FAILED_MSG = "删除商品类别信息失败"; + //修改商品类别信息失败 + public static final int MATERIAL_CATEGORY_EDIT_FAILED_CODE = 7500002; + public static final String MATERIAL_CATEGORY_EDIT_FAILED_MSG = "添加商品类别信息失败"; /** * 标准正常返回/操作成功返回 diff --git a/src/main/java/com/jsh/erp/controller/MaterialCategoryController.java b/src/main/java/com/jsh/erp/controller/MaterialCategoryController.java index 1d088810..6f31a606 100644 --- a/src/main/java/com/jsh/erp/controller/MaterialCategoryController.java +++ b/src/main/java/com/jsh/erp/controller/MaterialCategoryController.java @@ -1,69 +1,163 @@ -package com.jsh.erp.controller; - -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.jsh.erp.datasource.entities.MaterialCategory; -import com.jsh.erp.service.materialCategory.MaterialCategoryService; -import com.jsh.erp.utils.BaseResponseInfo; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * @author ji—sheng—hua 华夏ERP - */ -@RestController -@RequestMapping(value = "/materialCategory") -public class MaterialCategoryController { - private Logger logger = LoggerFactory.getLogger(MaterialCategoryController.class); - - @Resource - private MaterialCategoryService materialCategoryService; - - @GetMapping(value = "/getAllList") - public BaseResponseInfo getAllList(@RequestParam("parentId") Long parentId, HttpServletRequest request) { - BaseResponseInfo res = new BaseResponseInfo(); - try { - List materialCategoryList = materialCategoryService.getAllList(parentId); - res.code = 200; - res.data = materialCategoryList; - } catch(Exception e){ - e.printStackTrace(); - res.code = 500; - res.data = "获取数据失败"; - } - return res; - } - - /** - * 根据id来查询商品名称 - * @param id - * @param request - * @return - */ - @GetMapping(value = "/findById") - public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request) { - BaseResponseInfo res = new BaseResponseInfo(); - try { - List dataList = materialCategoryService.findById(id); - JSONObject outer = new JSONObject(); - if (null != dataList) { - for (MaterialCategory mc : dataList) { - outer.put("name", mc.getName()); - outer.put("parentId", mc.getParentid()); - } - } - res.code = 200; - res.data = outer; - } catch(Exception e){ - e.printStackTrace(); - res.code = 500; - res.data = "获取数据失败"; - } - return res; - } -} +package com.jsh.erp.controller; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.google.gson.JsonObject; +import com.jsh.erp.constants.ExceptionConstants; +import com.jsh.erp.datasource.entities.MaterialCategory; +import com.jsh.erp.datasource.entities.SerialNumberEx; +import com.jsh.erp.datasource.vo.TreeNode; +import com.jsh.erp.exception.BusinessRunTimeException; +import com.jsh.erp.service.materialCategory.MaterialCategoryService; +import com.jsh.erp.utils.BaseResponseInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; + +/** + * @author ji—sheng—hua 华夏ERP + */ +@RestController +@RequestMapping(value = "/materialCategory") +public class MaterialCategoryController { + private Logger logger = LoggerFactory.getLogger(MaterialCategoryController.class); + + @Resource + private MaterialCategoryService materialCategoryService; + + @GetMapping(value = "/getAllList") + public BaseResponseInfo getAllList(@RequestParam("parentId") Long parentId, HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + List materialCategoryList = materialCategoryService.getAllList(parentId); + res.code = 200; + res.data = materialCategoryList; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + + /** + * 根据id来查询商品名称 + * @param id + * @param request + * @return + */ + @RequestMapping(value = "/findById") + public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest request) { + BaseResponseInfo res = new BaseResponseInfo(); + try { + List dataList = materialCategoryService.findById(id); + JSONObject outer = new JSONObject(); + if (null != dataList) { + for (MaterialCategory mc : dataList) { + outer.put("id", mc.getId()); + outer.put("name", mc.getName()); + outer.put("parentId", mc.getParentid()); + List dataParentList = materialCategoryService.findById(mc.getParentid()); + if(dataParentList!=null&&dataParentList.size()>0){ + outer.put("parentName", dataParentList.get(0).getName()); + } + outer.put("sort", mc.getSort()); + outer.put("serialNo", mc.getSerialNo()); + outer.put("remark", mc.getRemark()); + } + } + res.code = 200; + res.data = outer; + } catch(Exception e){ + e.printStackTrace(); + res.code = 500; + res.data = "获取数据失败"; + } + return res; + } + /** + * create by: cjl + * description: + * 获取商品类别树数据 + * create time: 2019/2/19 11:49 + * @Param: + * @return com.alibaba.fastjson.JSONArray + */ + @RequestMapping(value = "/getMaterialCategoryTree") + public JSONArray getMaterialCategoryTree() throws Exception{ + JSONArray arr=new JSONArray(); + List materialCategoryTree = materialCategoryService.getMaterialCategoryTree(); + if(materialCategoryTree!=null&&materialCategoryTree.size()>0){ + for(TreeNode node:materialCategoryTree){ + String str=JSON.toJSONString(node); + JSONObject obj=JSON.parseObject(str); + arr.add(obj) ; + } + } + return arr; + } + /** + * create by: cjl + * description: + * 新增商品类别数据 + * create time: 2019/2/19 17:17 + * @Param: beanJson + * @return java.lang.Object + */ + @RequestMapping(value = "/addMaterialCategory") + public Object addMaterialCategory(@RequestParam("info") String beanJson) throws Exception { + JSONObject result = ExceptionConstants.standardSuccess(); + MaterialCategory mc= JSON.parseObject(beanJson, MaterialCategory.class); + int i= materialCategoryService.addMaterialCategory(mc); + if(i<1){ + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_CATEGORY_ADD_FAILED_CODE, + ExceptionConstants.MATERIAL_CATEGORY_ADD_FAILED_MSG); + } + return result; + } + /** + * create by: cjl + * description: + * 修改商品类别数据 + * create time: 2019/2/20 9:30 + * @Param: beanJson + * @return java.lang.Object + */ + @RequestMapping(value = "/editMaterialCategory") + public Object editMaterialCategory(@RequestParam("info") String beanJson) throws Exception { + JSONObject result = ExceptionConstants.standardSuccess(); + MaterialCategory mc= JSON.parseObject(beanJson, MaterialCategory.class); + int i= materialCategoryService.editMaterialCategory(mc); + if(i<1){ + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_CATEGORY_ADD_FAILED_CODE, + ExceptionConstants.MATERIAL_CATEGORY_ADD_FAILED_MSG); + } + return result; + } + /** + * create by: cjl + * description: + * 批量删除商品类别信息 + * create time: 2019/2/19 17:26 + * @Param: ids + * @return java.lang.Object + */ + @RequestMapping(value = "/batchDeleteMaterialCategory") + public Object batchDeleteMaterialCategory(@RequestParam("ids") String ids) throws Exception { + JSONObject result = ExceptionConstants.standardSuccess(); + int i= materialCategoryService.batchDeleteMaterialCategoryByIds(ids); + if(i<1){ + throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_CATEGORY_DELETE_FAILED_CODE, + ExceptionConstants.MATERIAL_CATEGORY_DELETE_FAILED_MSG); + } + return result; + } +} diff --git a/src/main/java/com/jsh/erp/datasource/entities/MaterialCategory.java b/src/main/java/com/jsh/erp/datasource/entities/MaterialCategory.java index fe948130..2f22622d 100644 --- a/src/main/java/com/jsh/erp/datasource/entities/MaterialCategory.java +++ b/src/main/java/com/jsh/erp/datasource/entities/MaterialCategory.java @@ -1,131 +1,389 @@ -package com.jsh.erp.datasource.entities; - -public class MaterialCategory { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column jsh_materialcategory.Id - * - * @mbggenerated - */ - private Long id; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column jsh_materialcategory.Name - * - * @mbggenerated - */ - private String name; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column jsh_materialcategory.CategoryLevel - * - * @mbggenerated - */ - private Short categorylevel; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database column jsh_materialcategory.ParentId - * - * @mbggenerated - */ - private Long parentid; - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column jsh_materialcategory.Id - * - * @return the value of jsh_materialcategory.Id - * - * @mbggenerated - */ - public Long getId() { - return id; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column jsh_materialcategory.Id - * - * @param id the value for jsh_materialcategory.Id - * - * @mbggenerated - */ - public void setId(Long id) { - this.id = id; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column jsh_materialcategory.Name - * - * @return the value of jsh_materialcategory.Name - * - * @mbggenerated - */ - public String getName() { - return name; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column jsh_materialcategory.Name - * - * @param name the value for jsh_materialcategory.Name - * - * @mbggenerated - */ - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column jsh_materialcategory.CategoryLevel - * - * @return the value of jsh_materialcategory.CategoryLevel - * - * @mbggenerated - */ - public Short getCategorylevel() { - return categorylevel; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column jsh_materialcategory.CategoryLevel - * - * @param categorylevel the value for jsh_materialcategory.CategoryLevel - * - * @mbggenerated - */ - public void setCategorylevel(Short categorylevel) { - this.categorylevel = categorylevel; - } - - /** - * This method was generated by MyBatis Generator. - * This method returns the value of the database column jsh_materialcategory.ParentId - * - * @return the value of jsh_materialcategory.ParentId - * - * @mbggenerated - */ - public Long getParentid() { - return parentid; - } - - /** - * This method was generated by MyBatis Generator. - * This method sets the value of the database column jsh_materialcategory.ParentId - * - * @param parentid the value for jsh_materialcategory.ParentId - * - * @mbggenerated - */ - public void setParentid(Long parentid) { - this.parentid = parentid; - } +package com.jsh.erp.datasource.entities; + +import java.util.Date; + +public class MaterialCategory { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_materialcategory.Id + * + * @mbggenerated + */ + private Long id; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_materialcategory.Name + * + * @mbggenerated + */ + private String name; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_materialcategory.CategoryLevel + * + * @mbggenerated + */ + private Short categorylevel; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_materialcategory.ParentId + * + * @mbggenerated + */ + private Long parentid; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_materialcategory.sort + * + * @mbggenerated + */ + private String sort; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_materialcategory.status + * + * @mbggenerated + */ + private String status; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_materialcategory.serial_no + * + * @mbggenerated + */ + private String serialNo; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_materialcategory.remark + * + * @mbggenerated + */ + private String remark; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_materialcategory.create_time + * + * @mbggenerated + */ + private Date createTime; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_materialcategory.creator + * + * @mbggenerated + */ + private Long creator; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_materialcategory.update_time + * + * @mbggenerated + */ + private Date updateTime; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column jsh_materialcategory.updater + * + * @mbggenerated + */ + private Long updater; + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_materialcategory.Id + * + * @return the value of jsh_materialcategory.Id + * + * @mbggenerated + */ + public Long getId() { + return id; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_materialcategory.Id + * + * @param id the value for jsh_materialcategory.Id + * + * @mbggenerated + */ + public void setId(Long id) { + this.id = id; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_materialcategory.Name + * + * @return the value of jsh_materialcategory.Name + * + * @mbggenerated + */ + public String getName() { + return name; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_materialcategory.Name + * + * @param name the value for jsh_materialcategory.Name + * + * @mbggenerated + */ + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_materialcategory.CategoryLevel + * + * @return the value of jsh_materialcategory.CategoryLevel + * + * @mbggenerated + */ + public Short getCategorylevel() { + return categorylevel; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_materialcategory.CategoryLevel + * + * @param categorylevel the value for jsh_materialcategory.CategoryLevel + * + * @mbggenerated + */ + public void setCategorylevel(Short categorylevel) { + this.categorylevel = categorylevel; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_materialcategory.ParentId + * + * @return the value of jsh_materialcategory.ParentId + * + * @mbggenerated + */ + public Long getParentid() { + return parentid; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_materialcategory.ParentId + * + * @param parentid the value for jsh_materialcategory.ParentId + * + * @mbggenerated + */ + public void setParentid(Long parentid) { + this.parentid = parentid; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_materialcategory.sort + * + * @return the value of jsh_materialcategory.sort + * + * @mbggenerated + */ + public String getSort() { + return sort; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_materialcategory.sort + * + * @param sort the value for jsh_materialcategory.sort + * + * @mbggenerated + */ + public void setSort(String sort) { + this.sort = sort == null ? null : sort.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_materialcategory.status + * + * @return the value of jsh_materialcategory.status + * + * @mbggenerated + */ + public String getStatus() { + return status; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_materialcategory.status + * + * @param status the value for jsh_materialcategory.status + * + * @mbggenerated + */ + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_materialcategory.serial_no + * + * @return the value of jsh_materialcategory.serial_no + * + * @mbggenerated + */ + public String getSerialNo() { + return serialNo; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_materialcategory.serial_no + * + * @param serialNo the value for jsh_materialcategory.serial_no + * + * @mbggenerated + */ + public void setSerialNo(String serialNo) { + this.serialNo = serialNo == null ? null : serialNo.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_materialcategory.remark + * + * @return the value of jsh_materialcategory.remark + * + * @mbggenerated + */ + public String getRemark() { + return remark; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_materialcategory.remark + * + * @param remark the value for jsh_materialcategory.remark + * + * @mbggenerated + */ + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_materialcategory.create_time + * + * @return the value of jsh_materialcategory.create_time + * + * @mbggenerated + */ + public Date getCreateTime() { + return createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_materialcategory.create_time + * + * @param createTime the value for jsh_materialcategory.create_time + * + * @mbggenerated + */ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_materialcategory.creator + * + * @return the value of jsh_materialcategory.creator + * + * @mbggenerated + */ + public Long getCreator() { + return creator; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_materialcategory.creator + * + * @param creator the value for jsh_materialcategory.creator + * + * @mbggenerated + */ + public void setCreator(Long creator) { + this.creator = creator; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_materialcategory.update_time + * + * @return the value of jsh_materialcategory.update_time + * + * @mbggenerated + */ + public Date getUpdateTime() { + return updateTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_materialcategory.update_time + * + * @param updateTime the value for jsh_materialcategory.update_time + * + * @mbggenerated + */ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column jsh_materialcategory.updater + * + * @return the value of jsh_materialcategory.updater + * + * @mbggenerated + */ + public Long getUpdater() { + return updater; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column jsh_materialcategory.updater + * + * @param updater the value for jsh_materialcategory.updater + * + * @mbggenerated + */ + public void setUpdater(Long updater) { + this.updater = updater; + } } \ No newline at end of file diff --git a/src/main/java/com/jsh/erp/datasource/entities/MaterialCategoryExample.java b/src/main/java/com/jsh/erp/datasource/entities/MaterialCategoryExample.java index 3c7fe5b3..49ef2ea1 100644 --- a/src/main/java/com/jsh/erp/datasource/entities/MaterialCategoryExample.java +++ b/src/main/java/com/jsh/erp/datasource/entities/MaterialCategoryExample.java @@ -1,552 +1,1073 @@ -package com.jsh.erp.datasource.entities; - -import java.util.ArrayList; -import java.util.List; - -public class MaterialCategoryExample { - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - protected String orderByClause; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - protected boolean distinct; - - /** - * This field was generated by MyBatis Generator. - * This field corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - protected List oredCriteria; - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - public MaterialCategoryExample() { - oredCriteria = new ArrayList(); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - public void setOrderByClause(String orderByClause) { - this.orderByClause = orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - public String getOrderByClause() { - return orderByClause; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - public void setDistinct(boolean distinct) { - this.distinct = distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - public boolean isDistinct() { - return distinct; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - public List getOredCriteria() { - return oredCriteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - public void or(Criteria criteria) { - oredCriteria.add(criteria); - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - public Criteria or() { - Criteria criteria = createCriteriaInternal(); - oredCriteria.add(criteria); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - public Criteria createCriteria() { - Criteria criteria = createCriteriaInternal(); - if (oredCriteria.size() == 0) { - oredCriteria.add(criteria); - } - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - protected Criteria createCriteriaInternal() { - Criteria criteria = new Criteria(); - return criteria; - } - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - public void clear() { - oredCriteria.clear(); - orderByClause = null; - distinct = false; - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - protected abstract static class GeneratedCriteria { - protected List criteria; - - protected GeneratedCriteria() { - super(); - criteria = new ArrayList(); - } - - public boolean isValid() { - return criteria.size() > 0; - } - - public List getAllCriteria() { - return criteria; - } - - public List getCriteria() { - return criteria; - } - - protected void addCriterion(String condition) { - if (condition == null) { - throw new RuntimeException("Value for condition cannot be null"); - } - criteria.add(new Criterion(condition)); - } - - protected void addCriterion(String condition, Object value, String property) { - if (value == null) { - throw new RuntimeException("Value for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value)); - } - - protected void addCriterion(String condition, Object value1, Object value2, String property) { - if (value1 == null || value2 == null) { - throw new RuntimeException("Between values for " + property + " cannot be null"); - } - criteria.add(new Criterion(condition, value1, value2)); - } - - public Criteria andIdIsNull() { - addCriterion("Id is null"); - return (Criteria) this; - } - - public Criteria andIdIsNotNull() { - addCriterion("Id is not null"); - return (Criteria) this; - } - - public Criteria andIdEqualTo(Long value) { - addCriterion("Id =", value, "id"); - return (Criteria) this; - } - - public Criteria andIdNotEqualTo(Long value) { - addCriterion("Id <>", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThan(Long value) { - addCriterion("Id >", value, "id"); - return (Criteria) this; - } - - public Criteria andIdGreaterThanOrEqualTo(Long value) { - addCriterion("Id >=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThan(Long value) { - addCriterion("Id <", value, "id"); - return (Criteria) this; - } - - public Criteria andIdLessThanOrEqualTo(Long value) { - addCriterion("Id <=", value, "id"); - return (Criteria) this; - } - - public Criteria andIdIn(List values) { - addCriterion("Id in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdNotIn(List values) { - addCriterion("Id not in", values, "id"); - return (Criteria) this; - } - - public Criteria andIdBetween(Long value1, Long value2) { - addCriterion("Id between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andIdNotBetween(Long value1, Long value2) { - addCriterion("Id not between", value1, value2, "id"); - return (Criteria) this; - } - - public Criteria andNameIsNull() { - addCriterion("Name is null"); - return (Criteria) this; - } - - public Criteria andNameIsNotNull() { - addCriterion("Name is not null"); - return (Criteria) this; - } - - public Criteria andNameEqualTo(String value) { - addCriterion("Name =", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotEqualTo(String value) { - addCriterion("Name <>", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThan(String value) { - addCriterion("Name >", value, "name"); - return (Criteria) this; - } - - public Criteria andNameGreaterThanOrEqualTo(String value) { - addCriterion("Name >=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThan(String value) { - addCriterion("Name <", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLessThanOrEqualTo(String value) { - addCriterion("Name <=", value, "name"); - return (Criteria) this; - } - - public Criteria andNameLike(String value) { - addCriterion("Name like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameNotLike(String value) { - addCriterion("Name not like", value, "name"); - return (Criteria) this; - } - - public Criteria andNameIn(List values) { - addCriterion("Name in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameNotIn(List values) { - addCriterion("Name not in", values, "name"); - return (Criteria) this; - } - - public Criteria andNameBetween(String value1, String value2) { - addCriterion("Name between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andNameNotBetween(String value1, String value2) { - addCriterion("Name not between", value1, value2, "name"); - return (Criteria) this; - } - - public Criteria andCategorylevelIsNull() { - addCriterion("CategoryLevel is null"); - return (Criteria) this; - } - - public Criteria andCategorylevelIsNotNull() { - addCriterion("CategoryLevel is not null"); - return (Criteria) this; - } - - public Criteria andCategorylevelEqualTo(Short value) { - addCriterion("CategoryLevel =", value, "categorylevel"); - return (Criteria) this; - } - - public Criteria andCategorylevelNotEqualTo(Short value) { - addCriterion("CategoryLevel <>", value, "categorylevel"); - return (Criteria) this; - } - - public Criteria andCategorylevelGreaterThan(Short value) { - addCriterion("CategoryLevel >", value, "categorylevel"); - return (Criteria) this; - } - - public Criteria andCategorylevelGreaterThanOrEqualTo(Short value) { - addCriterion("CategoryLevel >=", value, "categorylevel"); - return (Criteria) this; - } - - public Criteria andCategorylevelLessThan(Short value) { - addCriterion("CategoryLevel <", value, "categorylevel"); - return (Criteria) this; - } - - public Criteria andCategorylevelLessThanOrEqualTo(Short value) { - addCriterion("CategoryLevel <=", value, "categorylevel"); - return (Criteria) this; - } - - public Criteria andCategorylevelIn(List values) { - addCriterion("CategoryLevel in", values, "categorylevel"); - return (Criteria) this; - } - - public Criteria andCategorylevelNotIn(List values) { - addCriterion("CategoryLevel not in", values, "categorylevel"); - return (Criteria) this; - } - - public Criteria andCategorylevelBetween(Short value1, Short value2) { - addCriterion("CategoryLevel between", value1, value2, "categorylevel"); - return (Criteria) this; - } - - public Criteria andCategorylevelNotBetween(Short value1, Short value2) { - addCriterion("CategoryLevel not between", value1, value2, "categorylevel"); - return (Criteria) this; - } - - public Criteria andParentidIsNull() { - addCriterion("ParentId is null"); - return (Criteria) this; - } - - public Criteria andParentidIsNotNull() { - addCriterion("ParentId is not null"); - return (Criteria) this; - } - - public Criteria andParentidEqualTo(Long value) { - addCriterion("ParentId =", value, "parentid"); - return (Criteria) this; - } - - public Criteria andParentidNotEqualTo(Long value) { - addCriterion("ParentId <>", value, "parentid"); - return (Criteria) this; - } - - public Criteria andParentidGreaterThan(Long value) { - addCriterion("ParentId >", value, "parentid"); - return (Criteria) this; - } - - public Criteria andParentidGreaterThanOrEqualTo(Long value) { - addCriterion("ParentId >=", value, "parentid"); - return (Criteria) this; - } - - public Criteria andParentidLessThan(Long value) { - addCriterion("ParentId <", value, "parentid"); - return (Criteria) this; - } - - public Criteria andParentidLessThanOrEqualTo(Long value) { - addCriterion("ParentId <=", value, "parentid"); - return (Criteria) this; - } - - public Criteria andParentidIn(List values) { - addCriterion("ParentId in", values, "parentid"); - return (Criteria) this; - } - - public Criteria andParentidNotIn(List values) { - addCriterion("ParentId not in", values, "parentid"); - return (Criteria) this; - } - - public Criteria andParentidBetween(Long value1, Long value2) { - addCriterion("ParentId between", value1, value2, "parentid"); - return (Criteria) this; - } - - public Criteria andParentidNotBetween(Long value1, Long value2) { - addCriterion("ParentId not between", value1, value2, "parentid"); - return (Criteria) this; - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table jsh_materialcategory - * - * @mbggenerated do_not_delete_during_merge - */ - public static class Criteria extends GeneratedCriteria { - - protected Criteria() { - super(); - } - } - - /** - * This class was generated by MyBatis Generator. - * This class corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - public static class Criterion { - private String condition; - - private Object value; - - private Object secondValue; - - private boolean noValue; - - private boolean singleValue; - - private boolean betweenValue; - - private boolean listValue; - - private String typeHandler; - - public String getCondition() { - return condition; - } - - public Object getValue() { - return value; - } - - public Object getSecondValue() { - return secondValue; - } - - public boolean isNoValue() { - return noValue; - } - - public boolean isSingleValue() { - return singleValue; - } - - public boolean isBetweenValue() { - return betweenValue; - } - - public boolean isListValue() { - return listValue; - } - - public String getTypeHandler() { - return typeHandler; - } - - protected Criterion(String condition) { - super(); - this.condition = condition; - this.typeHandler = null; - this.noValue = true; - } - - protected Criterion(String condition, Object value, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.typeHandler = typeHandler; - if (value instanceof List) { - this.listValue = true; - } else { - this.singleValue = true; - } - } - - protected Criterion(String condition, Object value) { - this(condition, value, null); - } - - protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { - super(); - this.condition = condition; - this.value = value; - this.secondValue = secondValue; - this.typeHandler = typeHandler; - this.betweenValue = true; - } - - protected Criterion(String condition, Object value, Object secondValue) { - this(condition, value, secondValue, null); - } - } +package com.jsh.erp.datasource.entities; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class MaterialCategoryExample { + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + protected String orderByClause; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + protected boolean distinct; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + protected List oredCriteria; + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + public MaterialCategoryExample() { + oredCriteria = new ArrayList(); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + public String getOrderByClause() { + return orderByClause; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + public boolean isDistinct() { + return distinct; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + public List getOredCriteria() { + return oredCriteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("Id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("Id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("Id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("Id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("Id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("Id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("Id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("Id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("Id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("Id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("Id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("Id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("Name is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("Name is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("Name =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("Name <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("Name >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("Name >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("Name <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("Name <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("Name like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("Name not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("Name in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("Name not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("Name between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("Name not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andCategorylevelIsNull() { + addCriterion("CategoryLevel is null"); + return (Criteria) this; + } + + public Criteria andCategorylevelIsNotNull() { + addCriterion("CategoryLevel is not null"); + return (Criteria) this; + } + + public Criteria andCategorylevelEqualTo(Short value) { + addCriterion("CategoryLevel =", value, "categorylevel"); + return (Criteria) this; + } + + public Criteria andCategorylevelNotEqualTo(Short value) { + addCriterion("CategoryLevel <>", value, "categorylevel"); + return (Criteria) this; + } + + public Criteria andCategorylevelGreaterThan(Short value) { + addCriterion("CategoryLevel >", value, "categorylevel"); + return (Criteria) this; + } + + public Criteria andCategorylevelGreaterThanOrEqualTo(Short value) { + addCriterion("CategoryLevel >=", value, "categorylevel"); + return (Criteria) this; + } + + public Criteria andCategorylevelLessThan(Short value) { + addCriterion("CategoryLevel <", value, "categorylevel"); + return (Criteria) this; + } + + public Criteria andCategorylevelLessThanOrEqualTo(Short value) { + addCriterion("CategoryLevel <=", value, "categorylevel"); + return (Criteria) this; + } + + public Criteria andCategorylevelIn(List values) { + addCriterion("CategoryLevel in", values, "categorylevel"); + return (Criteria) this; + } + + public Criteria andCategorylevelNotIn(List values) { + addCriterion("CategoryLevel not in", values, "categorylevel"); + return (Criteria) this; + } + + public Criteria andCategorylevelBetween(Short value1, Short value2) { + addCriterion("CategoryLevel between", value1, value2, "categorylevel"); + return (Criteria) this; + } + + public Criteria andCategorylevelNotBetween(Short value1, Short value2) { + addCriterion("CategoryLevel not between", value1, value2, "categorylevel"); + return (Criteria) this; + } + + public Criteria andParentidIsNull() { + addCriterion("ParentId is null"); + return (Criteria) this; + } + + public Criteria andParentidIsNotNull() { + addCriterion("ParentId is not null"); + return (Criteria) this; + } + + public Criteria andParentidEqualTo(Long value) { + addCriterion("ParentId =", value, "parentid"); + return (Criteria) this; + } + + public Criteria andParentidNotEqualTo(Long value) { + addCriterion("ParentId <>", value, "parentid"); + return (Criteria) this; + } + + public Criteria andParentidGreaterThan(Long value) { + addCriterion("ParentId >", value, "parentid"); + return (Criteria) this; + } + + public Criteria andParentidGreaterThanOrEqualTo(Long value) { + addCriterion("ParentId >=", value, "parentid"); + return (Criteria) this; + } + + public Criteria andParentidLessThan(Long value) { + addCriterion("ParentId <", value, "parentid"); + return (Criteria) this; + } + + public Criteria andParentidLessThanOrEqualTo(Long value) { + addCriterion("ParentId <=", value, "parentid"); + return (Criteria) this; + } + + public Criteria andParentidIn(List values) { + addCriterion("ParentId in", values, "parentid"); + return (Criteria) this; + } + + public Criteria andParentidNotIn(List values) { + addCriterion("ParentId not in", values, "parentid"); + return (Criteria) this; + } + + public Criteria andParentidBetween(Long value1, Long value2) { + addCriterion("ParentId between", value1, value2, "parentid"); + return (Criteria) this; + } + + public Criteria andParentidNotBetween(Long value1, Long value2) { + addCriterion("ParentId not between", value1, value2, "parentid"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(String value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(String value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(String value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(String value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(String value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(String value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLike(String value) { + addCriterion("sort like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotLike(String value) { + addCriterion("sort not like", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(String value1, String value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(String value1, String value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("status is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("status is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(String value) { + addCriterion("status =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(String value) { + addCriterion("status <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(String value) { + addCriterion("status >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(String value) { + addCriterion("status >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(String value) { + addCriterion("status <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(String value) { + addCriterion("status <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLike(String value) { + addCriterion("status like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotLike(String value) { + addCriterion("status not like", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("status in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("status not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(String value1, String value2) { + addCriterion("status between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(String value1, String value2) { + addCriterion("status not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andSerialNoIsNull() { + addCriterion("serial_no is null"); + return (Criteria) this; + } + + public Criteria andSerialNoIsNotNull() { + addCriterion("serial_no is not null"); + return (Criteria) this; + } + + public Criteria andSerialNoEqualTo(String value) { + addCriterion("serial_no =", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotEqualTo(String value) { + addCriterion("serial_no <>", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoGreaterThan(String value) { + addCriterion("serial_no >", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoGreaterThanOrEqualTo(String value) { + addCriterion("serial_no >=", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoLessThan(String value) { + addCriterion("serial_no <", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoLessThanOrEqualTo(String value) { + addCriterion("serial_no <=", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoLike(String value) { + addCriterion("serial_no like", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotLike(String value) { + addCriterion("serial_no not like", value, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoIn(List values) { + addCriterion("serial_no in", values, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotIn(List values) { + addCriterion("serial_no not in", values, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoBetween(String value1, String value2) { + addCriterion("serial_no between", value1, value2, "serialNo"); + return (Criteria) this; + } + + public Criteria andSerialNoNotBetween(String value1, String value2) { + addCriterion("serial_no not between", value1, value2, "serialNo"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreatorIsNull() { + addCriterion("creator is null"); + return (Criteria) this; + } + + public Criteria andCreatorIsNotNull() { + addCriterion("creator is not null"); + return (Criteria) this; + } + + public Criteria andCreatorEqualTo(Long value) { + addCriterion("creator =", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotEqualTo(Long value) { + addCriterion("creator <>", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThan(Long value) { + addCriterion("creator >", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorGreaterThanOrEqualTo(Long value) { + addCriterion("creator >=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThan(Long value) { + addCriterion("creator <", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorLessThanOrEqualTo(Long value) { + addCriterion("creator <=", value, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorIn(List values) { + addCriterion("creator in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotIn(List values) { + addCriterion("creator not in", values, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorBetween(Long value1, Long value2) { + addCriterion("creator between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andCreatorNotBetween(Long value1, Long value2) { + addCriterion("creator not between", value1, value2, "creator"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNull() { + addCriterion("updater is null"); + return (Criteria) this; + } + + public Criteria andUpdaterIsNotNull() { + addCriterion("updater is not null"); + return (Criteria) this; + } + + public Criteria andUpdaterEqualTo(Long value) { + addCriterion("updater =", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotEqualTo(Long value) { + addCriterion("updater <>", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThan(Long value) { + addCriterion("updater >", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterGreaterThanOrEqualTo(Long value) { + addCriterion("updater >=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThan(Long value) { + addCriterion("updater <", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterLessThanOrEqualTo(Long value) { + addCriterion("updater <=", value, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterIn(List values) { + addCriterion("updater in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotIn(List values) { + addCriterion("updater not in", values, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterBetween(Long value1, Long value2) { + addCriterion("updater between", value1, value2, "updater"); + return (Criteria) this; + } + + public Criteria andUpdaterNotBetween(Long value1, Long value2) { + addCriterion("updater not between", value1, value2, "updater"); + return (Criteria) this; + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table jsh_materialcategory + * + * @mbggenerated do_not_delete_during_merge + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + /** + * This class was generated by MyBatis Generator. + * This class corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } } \ No newline at end of file diff --git a/src/main/java/com/jsh/erp/datasource/mappers/MaterialCategoryMapper.java b/src/main/java/com/jsh/erp/datasource/mappers/MaterialCategoryMapper.java index 9a25dd1b..f594f394 100644 --- a/src/main/java/com/jsh/erp/datasource/mappers/MaterialCategoryMapper.java +++ b/src/main/java/com/jsh/erp/datasource/mappers/MaterialCategoryMapper.java @@ -1,106 +1,96 @@ -package com.jsh.erp.datasource.mappers; - -import com.jsh.erp.datasource.entities.MaterialCategory; -import com.jsh.erp.datasource.entities.MaterialCategoryExample; -import java.util.List; -import org.apache.ibatis.annotations.Param; - -public interface MaterialCategoryMapper { - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - int countByExample(MaterialCategoryExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - int deleteByExample(MaterialCategoryExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - int deleteByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - int insert(MaterialCategory record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - int insertSelective(MaterialCategory record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - List selectByExample(MaterialCategoryExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - MaterialCategory selectByPrimaryKey(Long id); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - int updateByExampleSelective(@Param("record") MaterialCategory record, @Param("example") MaterialCategoryExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - int updateByExample(@Param("record") MaterialCategory record, @Param("example") MaterialCategoryExample example); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - int updateByPrimaryKeySelective(MaterialCategory record); - - /** - * This method was generated by MyBatis Generator. - * This method corresponds to the database table jsh_materialcategory - * - * @mbggenerated - */ - int updateByPrimaryKey(MaterialCategory record); - - List selectByConditionMaterialCategory( - @Param("name") String name, - @Param("parentId") Integer parentId, - @Param("offset") Integer offset, - @Param("rows") Integer rows); - - int countsByMaterialCategory( - @Param("name") String name, - @Param("parentId") Integer parentId); +package com.jsh.erp.datasource.mappers; + +import com.jsh.erp.datasource.entities.MaterialCategory; +import com.jsh.erp.datasource.entities.MaterialCategoryExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface MaterialCategoryMapper { + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + int countByExample(MaterialCategoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + int deleteByExample(MaterialCategoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + int deleteByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + int insert(MaterialCategory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + int insertSelective(MaterialCategory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + List selectByExample(MaterialCategoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + MaterialCategory selectByPrimaryKey(Long id); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + int updateByExampleSelective(@Param("record") MaterialCategory record, @Param("example") MaterialCategoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + int updateByExample(@Param("record") MaterialCategory record, @Param("example") MaterialCategoryExample example); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + int updateByPrimaryKeySelective(MaterialCategory record); + + /** + * This method was generated by MyBatis Generator. + * This method corresponds to the database table jsh_materialcategory + * + * @mbggenerated + */ + int updateByPrimaryKey(MaterialCategory record); } \ No newline at end of file diff --git a/src/main/java/com/jsh/erp/datasource/mappers/MaterialCategoryMapperEx.java b/src/main/java/com/jsh/erp/datasource/mappers/MaterialCategoryMapperEx.java new file mode 100644 index 00000000..e31814d1 --- /dev/null +++ b/src/main/java/com/jsh/erp/datasource/mappers/MaterialCategoryMapperEx.java @@ -0,0 +1,35 @@ +package com.jsh.erp.datasource.mappers; + +import com.jsh.erp.datasource.entities.MaterialCategory; +import com.jsh.erp.datasource.vo.TreeNode; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * Description + * + * @Author: cjl + * @Date: 2019/2/18 17:23 + */ +public interface MaterialCategoryMapperEx { + List selectByConditionMaterialCategory( + @Param("name") String name, + @Param("parentId") Integer parentId, + @Param("offset") Integer offset, + @Param("rows") Integer rows); + + int countsByMaterialCategory( + @Param("name") String name, + @Param("parentId") Integer parentId); + + List getNodeTree(); + List getNextNodeTree(@Param("id") Long id); + + int addMaterialCategory(MaterialCategory mc); + + int batchDeleteMaterialCategoryByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]); + + int editMaterialCategory(MaterialCategory mc); +} diff --git a/src/main/java/com/jsh/erp/datasource/vo/TreeNode.java b/src/main/java/com/jsh/erp/datasource/vo/TreeNode.java new file mode 100644 index 00000000..b7025f3b --- /dev/null +++ b/src/main/java/com/jsh/erp/datasource/vo/TreeNode.java @@ -0,0 +1,96 @@ +package com.jsh.erp.datasource.vo; + +import java.util.List; + +/** + * Description + * 树形结构基本元素 + * @Author: cjl + * @Date: 2019/2/19 11:27 + */ +public class TreeNode { + /** + * id主键 + * */ + private Long id; + /** + * text显示的文本 + * */ + private String text; + /** + *state节点状态,'open' 或 'closed',默认:'open'。如果为'closed'的时候,将不自动展开该节点。 + * */ + private String state="open"; + /** + *iconCls 节点图标id + * */ + private String iconCls; + /** + * checked 是否被选中 + * */ + private boolean checked; + /** + *attributes 自定义属性 + * */ + private String attributes; + /** + * children 子节点 + * */ + private List children; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getIconCls() { + return iconCls; + } + + public void setIconCls(String iconCls) { + this.iconCls = iconCls; + } + + public boolean isChecked() { + return checked; + } + + public void setChecked(boolean checked) { + this.checked = checked; + } + + public String getAttributes() { + return attributes; + } + + public void setAttributes(String attributes) { + this.attributes = attributes; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } +} diff --git a/src/main/java/com/jsh/erp/service/materialCategory/MaterialCategoryService.java b/src/main/java/com/jsh/erp/service/materialCategory/MaterialCategoryService.java index 6f808611..56cad692 100644 --- a/src/main/java/com/jsh/erp/service/materialCategory/MaterialCategoryService.java +++ b/src/main/java/com/jsh/erp/service/materialCategory/MaterialCategoryService.java @@ -1,9 +1,14 @@ package com.jsh.erp.service.materialCategory; import com.alibaba.fastjson.JSONObject; +import com.jsh.erp.constants.BusinessConstants; import com.jsh.erp.datasource.entities.MaterialCategory; import com.jsh.erp.datasource.entities.MaterialCategoryExample; +import com.jsh.erp.datasource.entities.User; import com.jsh.erp.datasource.mappers.MaterialCategoryMapper; +import com.jsh.erp.datasource.mappers.MaterialCategoryMapperEx; +import com.jsh.erp.datasource.vo.TreeNode; +import com.jsh.erp.service.user.UserService; import com.jsh.erp.utils.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -12,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import java.util.Date; import java.util.List; @Service @@ -20,6 +26,10 @@ public class MaterialCategoryService { @Resource private MaterialCategoryMapper materialCategoryMapper; + @Resource + private MaterialCategoryMapperEx materialCategoryMapperEx; + @Resource + private UserService userService; public MaterialCategory getMaterialCategory(long id) { return materialCategoryMapper.selectByPrimaryKey(id); @@ -38,11 +48,11 @@ public class MaterialCategoryService { } public List select(String name, Integer parentId, int offset, int rows) { - return materialCategoryMapper.selectByConditionMaterialCategory(name, parentId, offset, rows); + return materialCategoryMapperEx.selectByConditionMaterialCategory(name, parentId, offset, rows); } public int countMaterialCategory(String name, Integer parentId) { - return materialCategoryMapper.countsByMaterialCategory(name, parentId); + return materialCategoryMapperEx.countsByMaterialCategory(name, parentId); } @Transactional(value = "transactionManager", rollbackFor = Exception.class) @@ -80,4 +90,68 @@ public class MaterialCategoryService { example.createCriteria().andIdEqualTo(id); return materialCategoryMapper.selectByExample(example); } + /** + * create by: cjl + * description: + *获取商品类别树数据 + * create time: 2019/2/19 14:30 + * @Param: + * @return java.util.List + */ + public List getMaterialCategoryTree() throws Exception{ + return materialCategoryMapperEx.getNodeTree(); + } + /** + * create by: cjl + * description: + * 新增商品类别信息 + * create time: 2019/2/19 16:30 + * @Param: mc + * @return void + */ + public int addMaterialCategory(MaterialCategory mc) throws Exception { + if(mc==null){ + return 0; + } + if(mc.getParentid()==null){ + //没有给定父级目录的id,默认设置父级目录为根目录 + mc.setParentid(BusinessConstants.MATERIAL_CATEGORY_ROOT_ID); + } + //数据状态新增时默认设置为启用 + mc.setStatus(BusinessConstants.MATERIAL_CATEGORY_STATUS_ENABLE); + Date date=new Date(); + User userInfo=userService.getCurrentUser(); + //创建时间 + mc.setCreateTime(date); + //创建人 + mc.setCreator(userInfo==null?null:userInfo.getId()); + //更新时间 + mc.setUpdateTime(date); + //更新人 + mc.setUpdater(userInfo==null?null:userInfo.getId()); + return materialCategoryMapperEx.addMaterialCategory(mc); + } + + public int batchDeleteMaterialCategoryByIds(String ids) throws Exception { + //更新时间 + Date updateDate =new Date(); + //更新人 + User userInfo=userService.getCurrentUser(); + Long updater=userInfo==null?null:userInfo.getId(); + StringBuffer sb=new StringBuffer(); + String strArray[]=ids.split(","); + if(strArray.length<1){ + return 0; + } + return materialCategoryMapperEx.batchDeleteMaterialCategoryByIds(updateDate,updater,strArray); + } + + public int editMaterialCategory(MaterialCategory mc) { + //更新时间 + mc.setUpdateTime(new Date()); + //更新人 + User userInfo=userService.getCurrentUser(); + mc.setUpdater(userInfo==null?null:userInfo.getId()); + return materialCategoryMapperEx.editMaterialCategory(mc); + } } diff --git a/src/main/resources/mapper_xml/MaterialCategoryMapper.xml b/src/main/resources/mapper_xml/MaterialCategoryMapper.xml index 8fccced5..1cf6be85 100644 --- a/src/main/resources/mapper_xml/MaterialCategoryMapper.xml +++ b/src/main/resources/mapper_xml/MaterialCategoryMapper.xml @@ -1,5 +1,5 @@ - - + + - Id, Name, CategoryLevel, ParentId + Id, Name, CategoryLevel, ParentId, sort, status, serial_no, remark, create_time, + creator, update_time, updater