From 5da448b87908d16ac007efedbb7b1a0ab1cb372a Mon Sep 17 00:00:00 2001 From: luqingyang <lqy5492@163.com> Date: 星期一, 23 十月 2023 15:10:46 +0800 Subject: [PATCH] 物品分类的增删改查 --- consum-base/src/main/java/com/consum/base/service/BaseGoodsTemplateServiceImpl.java | 37 +++ consum-base/src/main/java/com/consum/base/Constants.java | 11 + consum-base/src/main/java/com/consum/base/controller/BaseCategoryController.java | 155 ++++++++++++++ consum-base/src/main/java/com/consum/base/pojo/BaseCategoryParam.java | 54 ++++ consum-model-pojo/src/main/java/com/consum/model/po/BaseCategory.java | 132 ++++++++++++ consum-model-pojo/src/main/java/com/consum/model/po/BaseCategory_mapper.java | 92 ++++++++ consum-base/src/main/java/com/consum/base/service/BaseCategoryServiceImpl.java | 143 +++++++++++++ 7 files changed, 622 insertions(+), 2 deletions(-) diff --git a/consum-base/src/main/java/com/consum/base/Constants.java b/consum-base/src/main/java/com/consum/base/Constants.java index a67098e..32c7e8c 100644 --- a/consum-base/src/main/java/com/consum/base/Constants.java +++ b/consum-base/src/main/java/com/consum/base/Constants.java @@ -42,4 +42,15 @@ // 鏄惁瀹屾垚 public static final Integer PROJECT_YES = 1;// 宸插畬鎴� public static final Integer PROJECT_NO = 0;// 鏈畬鎴� + + //鐗╁搧鍒嗙被灞傜骇锛�1锛�2锛�3锛� + public static final Integer LEVELS_ONE = 1; + public static final Integer LEVELS_TWO = 2; + public static final Integer LEVELS_THREE = 3; + + //鐗╁搧鍒嗙被STATES 1=姝e父锛�2=绂佺敤锛�3=宸插垹闄� + public static final Integer CATEGORY_ENABLE = 1; + public static final Integer CATEGORY_DISABLE = 2; + public static final Integer CATEGORY_DELETED = 3; + } diff --git a/consum-base/src/main/java/com/consum/base/controller/BaseCategoryController.java b/consum-base/src/main/java/com/consum/base/controller/BaseCategoryController.java new file mode 100644 index 0000000..c75352f --- /dev/null +++ b/consum-base/src/main/java/com/consum/base/controller/BaseCategoryController.java @@ -0,0 +1,155 @@ +package com.consum.base.controller; + +import com.consum.base.BaseController; +import com.consum.base.pojo.BaseCategoryParam; +import com.consum.base.service.BaseCategoryServiceImpl; +import com.consum.base.service.BaseGoodsTemplateServiceImpl; +import com.consum.model.po.BaseCategory; +import com.iplatform.model.po.S_user_core; +import com.walker.db.page.GenericPager; +import com.walker.infrastructure.utils.StringUtils; +import com.walker.web.ResponseValue; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @Description 鐗╁搧鍒嗙被 + * @Author 鍗㈠簡闃� + * @Date 2023/10/23 + */ +@RestController +@RequestMapping("/pc/base/category") +public class BaseCategoryController extends BaseController { + + @Autowired + private BaseCategoryServiceImpl baseCategoryService; + + @Autowired + private BaseGoodsTemplateServiceImpl baseGoodsTemplateService; + + /** + * @Description 鏂板鍒嗙被 + * @Author 鍗㈠簡闃� + * @Date 2023/10/23 + */ + @PostMapping("/add") + public ResponseValue add(@RequestBody BaseCategoryParam param) { + if (StringUtils.isEmpty(param.getCategoryName())) { + return ResponseValue.error("鍒嗙被鍚嶇О涓虹┖"); + } + if (param.getOrderNumber() == null) { + return ResponseValue.error("椤哄簭鍙蜂负绌�"); + } + //鍒ゆ柇鍚屼竴鐖剁被id涓嬪垎绫诲悕绉版槸鍚﹂噸澶� + BaseCategory category = this.baseCategoryService.getByCategoryNameAndFatherCategoryId(param.getCategoryName(),param.getFatherCategoryId()); + if (category != null) { + return ResponseValue.error("鍒嗙被鍚嶇О宸插瓨鍦�"); + } + +// int result = this.baseCategoryService.add(param,this.getCurrentUser()); + int result = this.baseCategoryService.add(param); + if(result>0) return ResponseValue.success(1); + return ResponseValue.error("鏂板澶辫触锛�"); + } + + /** + * @Description 鐗╁搧鍒嗙被鍒楄〃鏌ヨ + * @Author 鍗㈠簡闃� + * @Date 2023/10/23 + */ + @GetMapping("/list") + public ResponseValue queryBaseCategoryList(BaseCategoryParam param) { +// S_user_core currentUser = this.getCurrentUser(); +// if (currentUser == null) { +// return ResponseValue.error("鐧诲綍鐢ㄦ埛淇℃伅涓嶅瓨鍦�"); +// } + GenericPager<BaseCategory> pager = this.baseCategoryService.queryBaseCategoryList(param); + return ResponseValue.success(pager); + } + + /** + * @Description 缂栬緫 + * @Author 鍗㈠簡闃� + * @Date 2023/10/23 + */ + @PostMapping("/edit") + public ResponseValue edit(@RequestBody BaseCategory baseCategory) { + Long id = baseCategory.getId(); + if (id == null || id.longValue() <= 0) { + return ResponseValue.error("缂栬緫鐨勭墿鍝佸垎绫讳笉瀛樺湪"); + } + if (StringUtils.isEmpty(baseCategory.getCategoryName())) { + return ResponseValue.error("鍒嗙被鍚嶇О涓虹┖"); + } + if (baseCategory.getOrderNumber() == null) { + return ResponseValue.error("椤哄簭鍙蜂负绌�"); + } + //鍒ゆ柇鍚屼竴鐖剁被id涓嬪垎绫诲悕绉版槸鍚﹂噸澶� + BaseCategory category = this.baseCategoryService.getByCategoryNameAndFatherCategoryId(baseCategory.getCategoryName(),baseCategory.getFatherCategoryId()); + if (category != null) { + return ResponseValue.error("鍒嗙被鍚嶇О宸插瓨鍦�"); + } + // S_user_core currentUser = this.getCurrentUser(); +// if (currentUser == null) { +// return ResponseValue.error("鐧诲綍鐢ㄦ埛淇℃伅涓嶅瓨鍦�"); +// } + int num = this.baseCategoryService.updateBaseCategory(baseCategory); + return num>0 ? ResponseValue.success(1):ResponseValue.error("缂栬緫澶辫触锛�"); + } + + /** + * 淇敼鐘舵�� + * @author 鍗㈠簡闃� + * @date 2023/9/27 + */ + //鍒嗙被涓嬫湁姝e父鐘舵�佺殑鐗╁搧鏃讹紝涓嶅厑璁哥鐢� + @PostMapping("/updStatus") + public ResponseValue updateStatus(@RequestBody BaseCategory baseCategory){ + if (baseCategory==null || baseCategory.getId() ==null || baseCategory.getStates() == null) { + return ResponseValue.error("鍙傛暟閿欒"); + } + //鏍规嵁鍒嗙被id鍜岀姸鎬佹煡璇㈢墿鍝佹ā鐗� + List<BaseCategory> list = this.baseGoodsTemplateService.getByCategoryId(baseCategory.getId()); + if (baseCategory.getStates() == 2 && !CollectionUtils.isEmpty(list)) { + return ResponseValue.error("鍒嗙被涓嬫湁姝e父鐘舵�佺殑鐗╁搧锛屼笉鍏佽绂佺敤"); + } + + int num = this.baseCategoryService.updateStatus(baseCategory); + return num>0 ? ResponseValue.success(1):ResponseValue.error("淇敼澶辫触锛�"); + } + + /** + * @Description 鏍规嵁鑺傜偣id鍒犻櫎鑺傜偣(閫昏緫鍒犻櫎) + * @Author 鍗㈠簡闃� + * @Date 2023/10/23 + */ + @DeleteMapping("/del") + public ResponseValue updateById(@RequestBody BaseCategory baseCategory){ + if (baseCategory.getId() == null) { + return ResponseValue.error("鍒嗙被id涓虹┖"); + } + //S_user_core currentUser = this.getCurrentUser(); + int num = this.baseCategoryService.updateById(baseCategory); + + return num>0 ? ResponseValue.success(1):ResponseValue.error("鍒犻櫎澶辫触锛�"); + } + + /** + * 鏍规嵁鑺傜偣id鏌ヨ鑺傜偣璇︽儏 + * @author 鍗㈠簡闃� + * @date 2023/9/26 + */ + @GetMapping("/detail") + public ResponseValue getById(Long id){ + if (id == null) { + return ResponseValue.error("鍒嗙被id涓虹┖"); + } + BaseCategory baseCategory = this.baseCategoryService.getById(id); + if (baseCategory == null) return ResponseValue.error("鏌ヨ澶辫触锛�"); + return ResponseValue.success("鏌ヨ鎴愬姛!",baseCategory); + } +} + diff --git a/consum-base/src/main/java/com/consum/base/pojo/BaseCategoryParam.java b/consum-base/src/main/java/com/consum/base/pojo/BaseCategoryParam.java new file mode 100644 index 0000000..2ed21c1 --- /dev/null +++ b/consum-base/src/main/java/com/consum/base/pojo/BaseCategoryParam.java @@ -0,0 +1,54 @@ +package com.consum.base.pojo; + +import com.walker.web.param.ParamRequest; + +public class BaseCategoryParam extends ParamRequest { + private Long fatherCategoryId; + private String categoryName; + /** + * 鍒嗚绫诲埆锛欰锛孊锛孋 + */ + private String classification; + private Integer orderNumber; + private Integer states; + + public Long getFatherCategoryId() { + return fatherCategoryId; + } + + public void setFatherCategoryId(Long fatherCategoryId) { + this.fatherCategoryId = fatherCategoryId; + } + + public String getCategoryName() { + return categoryName; + } + + public void setCategoryName(String categoryName) { + this.categoryName = categoryName; + } + + public String getClassification() { + return classification; + } + + public void setClassification(String classification) { + this.classification = classification; + } + + public Integer getOrderNumber() { + return orderNumber; + } + + public void setOrderNumber(Integer orderNumber) { + this.orderNumber = orderNumber; + } + + public Integer getStates() { + return states; + } + + public void setStates(Integer states) { + this.states = states; + } +} diff --git a/consum-base/src/main/java/com/consum/base/service/BaseCategoryServiceImpl.java b/consum-base/src/main/java/com/consum/base/service/BaseCategoryServiceImpl.java new file mode 100644 index 0000000..8813bbd --- /dev/null +++ b/consum-base/src/main/java/com/consum/base/service/BaseCategoryServiceImpl.java @@ -0,0 +1,143 @@ +package com.consum.base.service; + +import com.consum.base.Constants; +import com.consum.base.pojo.BaseCategoryParam; +import com.consum.base.util.IdUtil; +import com.consum.model.po.BaseCategory; +import com.walker.db.page.GenericPager; +import com.walker.infrastructure.utils.DateUtils; +import com.walker.infrastructure.utils.StringUtils; +import com.walker.jdbc.service.BaseServiceImpl; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import java.util.HashMap; + +/** + * @Description 鐗╁搧鍒嗙被 + * @Author 鍗㈠簡闃� + * @Date 2023/10/23 + */ +@Service +public class BaseCategoryServiceImpl extends BaseServiceImpl { + + /** + * @Description 鏂板鍒嗙被 + * @Author 鍗㈠簡闃� + * @Date 2023/10/23 + */ +// public int add(BaseCategoryParam param, S_user_core currentUser) { + public int add(BaseCategoryParam param) { + BaseCategory baseCategory = new BaseCategory(); + BeanUtils.copyProperties(param, baseCategory); + baseCategory.setId(IdUtil.generateId()); + //灞傜骇 + if (baseCategory.getFatherCategoryId() == 0L) { //涓�绾у垎绫� + baseCategory.setLevels(Constants.LEVELS_ONE); + } else { + //鏍规嵁鐖剁被id鏌ヨ涓婄骇鍒嗙被淇℃伅 + BaseCategory category = this.get(new BaseCategory(baseCategory.getFatherCategoryId())); + if (category.getFatherCategoryId() == 0L) { //浜岀骇鍒嗙被 + baseCategory.setLevels(Constants.LEVELS_TWO); + } else { //涓夌骇鍒嗙被 + baseCategory.setLevels(Constants.LEVELS_THREE); + } + } + //TODO 鍒涘缓浜篿d鍜屽垱寤轰汉濮撳悕 +// baseCategory.setCreateUserId(currentUser.getId()); +// baseCategory.setCreateUserName(currentUser.getUser_name()); + //鍒涘缓鏃堕棿 + baseCategory.setCreateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); + + return this.insert(baseCategory); + } + + /** + * @Description 鏍规嵁鍒嗙被鍚嶇О鍜岀埗绫籭d鏌ヨ鍒嗙被 + * @Author 鍗㈠簡闃� + * @Date 2023/10/23 + * @param categoryName + * @param fatherCategoryId + */ + public BaseCategory getByCategoryNameAndFatherCategoryId(String categoryName, Long fatherCategoryId) { + StringBuilder sql = new StringBuilder("SELECT * FROM base_category WHERE 1 = 1 "); + HashMap<String, Object> paramts = new HashMap<>(); + + //鍒嗙被鍚嶇О + sql.append(" and category_name =:category_name "); + paramts.put("category_name", categoryName); + //鐖剁被id + sql.append(" and father_category_id =:father_category_id "); + paramts.put("father_category_id", fatherCategoryId); + + return this.get(sql.toString(), paramts, new BaseCategory()); + } + + /** + * @Description 鐗╁搧鍒嗙被鍒楄〃鏌ヨ + * @Author 鍗㈠簡闃� + * @Date 2023/10/23 + */ + public GenericPager<BaseCategory> queryBaseCategoryList(BaseCategoryParam param) { + StringBuilder sql = new StringBuilder("SELECT * FROM base_category WHERE 1 = 1 "); + HashMap<String, Object> paramts = new HashMap<>(); + + //鍒嗙被鍚嶇О + if (!StringUtils.isEmpty(param.getCategoryName())) { + sql.append(" and category_name like:category_name "); + paramts.put("category_name", StringUtils.CHAR_PERCENT + param.getCategoryName() + StringUtils.CHAR_PERCENT); + } + //绫诲埆 + if (!StringUtils.isEmpty(param.getClassification())) { + sql.append(" and classification =:classification "); + paramts.put("classification", param.getClassification()); + } + //鐘舵�� + if (param.getStates() != null) { + sql.append(" and status =:status "); + paramts.put("status", param.getStates()); + } + sql.append(" ORDER BY ORDER_NUMBER,CREATE_TIME DESC "); + return selectSplit(sql.toString(), paramts, new BaseCategory()); + } + + /** + * @Description 缂栬緫 + * @Author 鍗㈠簡闃� + * @Date 2023/10/23 + */ + public int updateBaseCategory(BaseCategory baseCategory) { + return this.update(baseCategory); + } + + /** + * 淇敼鐘舵�� + * @author 鍗㈠簡闃� + * @date 2023/9/27 + */ + public int updateStatus(BaseCategory baseCategory) { + return this.update(baseCategory); + } + + /** + * @Description 鏍规嵁鑺傜偣id鍒犻櫎鑺傜偣(閫昏緫鍒犻櫎) + * @Author 鍗㈠簡闃� + * @Date 2023/10/23 + */ + public int updateById(BaseCategory baseCategory) { + baseCategory.setStates(Constants.CATEGORY_DELETED); + //鍒犻櫎鏃堕棿 + baseCategory.setDTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); + //TODO 鍒犻櫎浜篿d鍜屽垹闄や汉濮撳悕 + return this.update(baseCategory); + } + + /** + * 鏍规嵁鑺傜偣id鏌ヨ鑺傜偣璇︽儏 + * @author 鍗㈠簡闃� + * @date 2023/9/26 + */ + public BaseCategory getById(Long id) { + return this.get(new BaseCategory(id)); + } +} diff --git a/consum-base/src/main/java/com/consum/base/service/BaseGoodsTemplateServiceImpl.java b/consum-base/src/main/java/com/consum/base/service/BaseGoodsTemplateServiceImpl.java new file mode 100644 index 0000000..8b383bc --- /dev/null +++ b/consum-base/src/main/java/com/consum/base/service/BaseGoodsTemplateServiceImpl.java @@ -0,0 +1,37 @@ +package com.consum.base.service; + +import com.consum.model.po.BaseCategory; +import com.walker.jdbc.service.BaseServiceImpl; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.List; + +/** + * @Description 鐗╁搧妯℃澘 + * @Author 鍗㈠簡闃� + * @Date 2023/10/23 + */ +@Service +public class BaseGoodsTemplateServiceImpl extends BaseServiceImpl { + + /** + * @Description 鏍规嵁鍒嗙被id鍜岀姸鎬佹煡璇㈢墿鍝佹ā鐗� + * @Author 鍗㈠簡闃� + * @Date 2023/10/23 + * @return + */ + public List<BaseCategory> getByCategoryId(Long categoryId) { + StringBuilder sql = new StringBuilder("SELECT * FROM base_goods_template WHERE 1 = 1 "); + HashMap<String, Object> paramts = new HashMap<>(); + + //鍒嗙被id + if (categoryId != null) { + sql.append(" and category_id =:category_id "); + paramts.put("category_id", categoryId); + } + sql.append(" and states =1 "); + + return this.select(sql.toString(), paramts, new BaseCategory()); + } +} diff --git a/consum-model-pojo/src/main/java/com/consum/model/po/BaseCategory.java b/consum-model-pojo/src/main/java/com/consum/model/po/BaseCategory.java index 6ad7b38..0732556 100644 --- a/consum-model-pojo/src/main/java/com/consum/model/po/BaseCategory.java +++ b/consum-model-pojo/src/main/java/com/consum/model/po/BaseCategory.java @@ -44,6 +44,30 @@ @JsonIgnore protected boolean isset_fatherCategoryId = false; + private Long createUserId = null; + @JsonIgnore + protected boolean isset_createUserId = false; + + private Long createTime = null; + @JsonIgnore + protected boolean isset_createTime = false; + + private String createUserName = null; + @JsonIgnore + protected boolean isset_createUserName = false; + + private Long dTime = null; + @JsonIgnore + protected boolean isset_dTime = false; + + private Long dUserId = null; + @JsonIgnore + protected boolean isset_dUserId = false; + + private String dUserName = null; + @JsonIgnore + protected boolean isset_dUserName = false; + /** * 榛樿鏋勯�犲嚱鏁� */ @@ -163,6 +187,90 @@ return this.fatherCategoryId == null; } + public Long getCreateUserId() { + return this.createUserId; + } + + public void setCreateUserId(Long createUserId) { + this.createUserId = createUserId; + this.isset_createUserId = true; + } + + @JsonIgnore + public boolean isEmptyCreateUserId() { + return this.createUserId == null; + } + + public Long getCreateTime() { + return this.createTime; + } + + public void setCreateTime(Long createTime) { + this.createTime = createTime; + this.isset_createTime = true; + } + + @JsonIgnore + public boolean isEmptyCreateTime() { + return this.createTime == null; + } + + public String getCreateUserName() { + return this.createUserName; + } + + public void setCreateUserName(String createUserName) { + this.createUserName = createUserName; + this.isset_createUserName = true; + } + + @JsonIgnore + public boolean isEmptyCreateUserName() { + return this.createUserName == null || this.createUserName.length() == 0; + } + + public Long getDTime() { + return this.dTime; + } + + public void setDTime(Long dTime) { + this.dTime = dTime; + this.isset_dTime = true; + } + + @JsonIgnore + public boolean isEmptyDTime() { + return this.dTime == null; + } + + public Long getDUserId() { + return this.dUserId; + } + + public void setDUserId(Long dUserId) { + this.dUserId = dUserId; + this.isset_dUserId = true; + } + + @JsonIgnore + public boolean isEmptyDUserId() { + return this.dUserId == null; + } + + public String getDUserName() { + return this.dUserName; + } + + public void setDUserName(String dUserName) { + this.dUserName = dUserName; + this.isset_dUserName = true; + } + + @JsonIgnore + public boolean isEmptyDUserName() { + return this.dUserName == null || this.dUserName.length() == 0; + } + /** * 閲嶅啓 toString() 鏂规硶 */ @@ -176,6 +284,12 @@ .append("states=").append(this.states) .append("levels=").append(this.levels) .append("fatherCategoryId=").append(this.fatherCategoryId) + .append("createUserId=").append(this.createUserId) + .append("createTime=").append(this.createTime) + .append("createUserName=").append(this.createUserName) + .append("dTime=").append(this.dTime) + .append("dUserId=").append(this.dUserId) + .append("dUserName=").append(this.dUserName) .toString(); } @@ -211,6 +325,24 @@ if (this.isset_fatherCategoryId) { base_category.setFatherCategoryId(this.getFatherCategoryId()); } + if (this.isset_createUserId) { + base_category.setCreateUserId(this.getCreateUserId()); + } + if (this.isset_createTime) { + base_category.setCreateTime(this.getCreateTime()); + } + if (this.isset_createUserName) { + base_category.setCreateUserName(this.getCreateUserName()); + } + if (this.isset_dTime) { + base_category.setDTime(this.getDTime()); + } + if (this.isset_dUserId) { + base_category.setDUserId(this.getDUserId()); + } + if (this.isset_dUserName) { + base_category.setDUserName(this.getDUserName()); + } return base_category; } } diff --git a/consum-model-pojo/src/main/java/com/consum/model/po/BaseCategory_mapper.java b/consum-model-pojo/src/main/java/com/consum/model/po/BaseCategory_mapper.java index ca37218..29dc5b1 100644 --- a/consum-model-pojo/src/main/java/com/consum/model/po/BaseCategory_mapper.java +++ b/consum-model-pojo/src/main/java/com/consum/model/po/BaseCategory_mapper.java @@ -34,6 +34,12 @@ public static final String States = "states"; public static final String Levels = "levels"; public static final String FatherCategoryId = "father_category_id"; + public static final String CreateUserId = "create_user_id"; + public static final String CreateTime = "create_time"; + public static final String CreateUserName = "create_user_name"; + public static final String DTime = "d_time"; + public static final String DUserId = "d_user_id"; + public static final String DUserName = "d_user_name"; /** * 榛樿鏋勯�犲嚱鏁� @@ -64,6 +70,24 @@ } if (baseCategory.isset_fatherCategoryId) { this.setFatherCategoryId(baseCategory.getFatherCategoryId()); + } + if (baseCategory.isset_createUserId) { + this.setCreateUserId(baseCategory.getCreateUserId()); + } + if (baseCategory.isset_createTime) { + this.setCreateTime(baseCategory.getCreateTime()); + } + if (baseCategory.isset_createUserName) { + this.setCreateUserName(baseCategory.getCreateUserName()); + } + if (baseCategory.isset_dTime) { + this.setDTime(baseCategory.getDTime()); + } + if (baseCategory.isset_dUserId) { + this.setDUserId(baseCategory.getDUserId()); + } + if (baseCategory.isset_dUserName) { + this.setDUserName(baseCategory.getDUserName()); } // 鍘绘帀锛�2022-09-07 // this.setDatabaseName_(base_category.getDatabaseName_()); @@ -114,6 +138,12 @@ ib.set(States, this.getStates(), this.isset_states); ib.set(Levels, this.getLevels(), this.isset_levels); ib.set(FatherCategoryId, this.getFatherCategoryId(), this.isset_fatherCategoryId); + ib.set(CreateUserId, this.getCreateUserId(), this.isset_createUserId); + ib.set(CreateTime, this.getCreateTime(), this.isset_createTime); + ib.set(CreateUserName, this.getCreateUserName(), this.isset_createUserName); + ib.set(DTime, this.getDTime(), this.isset_dTime); + ib.set(DUserId, this.getDUserId(), this.isset_dUserId); + ib.set(DUserName, this.getDUserName(), this.isset_dUserName); return ib.genMapSql(); } @@ -129,6 +159,12 @@ ub.set(States, this.getStates(), this.isset_states); ub.set(Levels, this.getLevels(), this.isset_levels); ub.set(FatherCategoryId, this.getFatherCategoryId(), this.isset_fatherCategoryId); + ub.set(CreateUserId, this.getCreateUserId(), this.isset_createUserId); + ub.set(CreateTime, this.getCreateTime(), this.isset_createTime); + ub.set(CreateUserName, this.getCreateUserName(), this.isset_createUserName); + ub.set(DTime, this.getDTime(), this.isset_dTime); + ub.set(DUserId, this.getDUserId(), this.isset_dUserId); + ub.set(DUserName, this.getDUserName(), this.isset_dUserName); ub.where(this.getPkName_(), this.getPkValue_()); return ub.genMapSql(); } @@ -145,6 +181,12 @@ ub.set(States, this.getStates(), this.isset_states); ub.set(Levels, this.getLevels(), this.isset_levels); ub.set(FatherCategoryId, this.getFatherCategoryId(), this.isset_fatherCategoryId); + ub.set(CreateUserId, this.getCreateUserId(), this.isset_createUserId); + ub.set(CreateTime, this.getCreateTime(), this.isset_createTime); + ub.set(CreateUserName, this.getCreateUserName(), this.isset_createUserName); + ub.set(DTime, this.getDTime(), this.isset_dTime); + ub.set(DUserId, this.getDUserId(), this.isset_dUserId); + ub.set(DUserName, this.getDUserName(), this.isset_dUserName); return ub.genMapSql(where, parameters); } @@ -160,6 +202,12 @@ ub.set(States, this.getStates(), this.isset_states); ub.set(Levels, this.getLevels(), this.isset_levels); ub.set(FatherCategoryId, this.getFatherCategoryId(), this.isset_fatherCategoryId); + ub.set(CreateUserId, this.getCreateUserId(), this.isset_createUserId); + ub.set(CreateTime, this.getCreateTime(), this.isset_createTime); + ub.set(CreateUserName, this.getCreateUserName(), this.isset_createUserName); + ub.set(DTime, this.getDTime(), this.isset_dTime); + ub.set(DUserId, this.getDUserId(), this.isset_dUserId); + ub.set(DUserName, this.getDUserName(), this.isset_dUserName); return ub.genArraySql(where, parameters); } @@ -207,7 +255,7 @@ */ @Override public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { - return new SqlAndParameters<>("select id, category_name, classification, order_number, states, levels, father_category_id from " + this.getTableName_() + " " + where, parameters); + return new SqlAndParameters<>("select id, category_name, classification, order_number, states, levels, father_category_id, create_user_id, create_time, create_user_name, d_time, d_user_id, d_user_name from " + this.getTableName_() + " " + where, parameters); } /** @@ -215,7 +263,7 @@ */ @Override public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { - return new SqlAndParameters<>("select id, category_name, classification, order_number, states, levels, father_category_id from " + this.getTableName_() + " " + where, parameters); + return new SqlAndParameters<>("select id, category_name, classification, order_number, states, levels, father_category_id, create_user_id, create_time, create_user_name, d_time, d_user_id, d_user_name from " + this.getTableName_() + " " + where, parameters); } /** @@ -292,6 +340,46 @@ base_category.setFatherCategoryId(rs.getLong(columnIndex)); } } + columnIndex = resultSetUtils.findColumn(rs, BaseCategory_mapper.CreateUserId); + if (columnIndex > 0) { + if (rs.getBigDecimal(columnIndex) == null) { + base_category.setCreateUserId(null); + } else { + base_category.setCreateUserId(rs.getLong(columnIndex)); + } + } + columnIndex = resultSetUtils.findColumn(rs, BaseCategory_mapper.CreateTime); + if (columnIndex > 0) { + if (rs.getBigDecimal(columnIndex) == null) { + base_category.setCreateTime(null); + } else { + base_category.setCreateTime(rs.getLong(columnIndex)); + } + } + columnIndex = resultSetUtils.findColumn(rs, BaseCategory_mapper.CreateUserName); + if (columnIndex > 0) { + base_category.setCreateUserName(rs.getString(columnIndex)); + } + columnIndex = resultSetUtils.findColumn(rs, BaseCategory_mapper.DTime); + if (columnIndex > 0) { + if (rs.getBigDecimal(columnIndex) == null) { + base_category.setDTime(null); + } else { + base_category.setDTime(rs.getLong(columnIndex)); + } + } + columnIndex = resultSetUtils.findColumn(rs, BaseCategory_mapper.DUserId); + if (columnIndex > 0) { + if (rs.getBigDecimal(columnIndex) == null) { + base_category.setDUserId(null); + } else { + base_category.setDUserId(rs.getLong(columnIndex)); + } + } + columnIndex = resultSetUtils.findColumn(rs, BaseCategory_mapper.DUserName); + if (columnIndex > 0) { + base_category.setDUserName(rs.getString(columnIndex)); + } return base_category; } } -- Gitblit v1.9.1