Commit 586fc239 by tyfanchz

删除无用功能、产品列表和代码集相关功能开发

1 parent 97e9f958
Showing 39 changed files with 498 additions and 711 deletions
package com.glsx.smart.controller; package com.glsx.smart.controller;
import java.util.List; import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo;
import com.glsx.smart.dao.entity.SmartProduct; import com.glsx.smart.dao.entity.SmartProduct;
import com.glsx.smart.pojo.SmartProductReq;
import com.glsx.smart.service.SmartProductService; import com.glsx.smart.service.SmartProductService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -19,12 +23,15 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -19,12 +23,15 @@ import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@RequestMapping("/product") @RequestMapping("/product")
public class ProductController { public class ProductController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired @Autowired
private SmartProductService productService; private SmartProductService productService;
@RequestMapping(value = "/getList", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/getList", method = {RequestMethod.GET, RequestMethod.POST})
public List<SmartProduct> getList(SmartProduct product) { public PageInfo<SmartProduct> getList(SmartProductReq req) {
return productService.getList(product); logger.info("/product/getList param: {}", JSON.toJSONString(req));
return productService.getList(req);
} }
@RequestMapping(value = "/getById", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/getById", method = {RequestMethod.GET, RequestMethod.POST})
......
...@@ -3,6 +3,8 @@ package com.glsx.smart.controller; ...@@ -3,6 +3,8 @@ package com.glsx.smart.controller;
import java.util.List; import java.util.List;
import com.glsx.smart.dao.entity.SmartProductType; import com.glsx.smart.dao.entity.SmartProductType;
import com.glsx.smart.service.SmartProductTypeService; import com.glsx.smart.service.SmartProductTypeService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -19,6 +21,8 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -19,6 +21,8 @@ import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@RequestMapping("/productType") @RequestMapping("/productType")
public class ProductTypeController { public class ProductTypeController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired @Autowired
private SmartProductTypeService productTypeService; private SmartProductTypeService productTypeService;
......
...@@ -3,6 +3,8 @@ package com.glsx.smart.controller; ...@@ -3,6 +3,8 @@ package com.glsx.smart.controller;
import java.util.List; import java.util.List;
import com.glsx.smart.dao.entity.SmartScene; import com.glsx.smart.dao.entity.SmartScene;
import com.glsx.smart.service.SmartSceneService; import com.glsx.smart.service.SmartSceneService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -19,6 +21,8 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -19,6 +21,8 @@ import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@RequestMapping("/scene") @RequestMapping("/scene")
public class SceneController { public class SceneController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired @Autowired
private SmartSceneService sceneService; private SmartSceneService sceneService;
......
...@@ -3,6 +3,8 @@ package com.glsx.smart.controller; ...@@ -3,6 +3,8 @@ package com.glsx.smart.controller;
import java.util.List; import java.util.List;
import com.glsx.smart.dao.entity.SmartSceneTemplate; import com.glsx.smart.dao.entity.SmartSceneTemplate;
import com.glsx.smart.service.SmartSceneTemplateService; import com.glsx.smart.service.SmartSceneTemplateService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -18,6 +20,8 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -18,6 +20,8 @@ import org.springframework.web.bind.annotation.RestController;
*/ */
@RestController @RestController
public class SceneTemplateController { public class SceneTemplateController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired @Autowired
private SmartSceneTemplateService sceneTemplateService; private SmartSceneTemplateService sceneTemplateService;
......
package com.glsx.smart.controller; package com.glsx.smart.controller;
import java.util.List; import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo;
import com.glsx.smart.dao.entity.SmartSysCode; import com.glsx.smart.dao.entity.SmartSysCode;
import com.glsx.smart.pojo.SmartSysCodeReq;
import com.glsx.smart.service.SmartSysCodeService; import com.glsx.smart.service.SmartSysCodeService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
...@@ -18,11 +22,14 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -18,11 +22,14 @@ import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@RequestMapping("/sysCode") @RequestMapping("/sysCode")
public class SysCodeController { public class SysCodeController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired @Autowired
private SmartSysCodeService sysCodeService; private SmartSysCodeService sysCodeService;
@RequestMapping(value = "/getList", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/getList", method = {RequestMethod.GET, RequestMethod.POST})
public List<SmartSysCode> getList(SmartSysCode sysCode) { public PageInfo<SmartSysCode> getList(SmartSysCodeReq req) {
return sysCodeService.getList(sysCode); this.logger.info("$$$$ /sysCode/getList param: {}", JSON.toJSONString(req));
return sysCodeService.getList(req);
} }
} }
package com.glsx.smart.controller; package com.glsx.smart.controller;
import com.glsx.smart.dao.entity.SmartSysFile;
import com.glsx.smart.service.SmartSysFileService; import com.glsx.smart.service.SmartSysFileService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
...@@ -16,8 +19,10 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -16,8 +19,10 @@ import org.springframework.web.multipart.MultipartFile;
* @date 2021-03-15 * @date 2021-03-15
*/ */
@RestController @RestController
@RequestMapping("/file") @RequestMapping("/sysFile")
public class FileController { public class SysFileController {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired @Autowired
private SmartSysFileService sysFileService; private SmartSysFileService sysFileService;
...@@ -26,8 +31,11 @@ public class FileController { ...@@ -26,8 +31,11 @@ public class FileController {
} }
@RequestMapping(value = "/deleteFile", method = {RequestMethod.POST}) @RequestMapping(value = "/updateFile", method = {RequestMethod.POST})
public void deleteFile(String fileUrl) { public void updateFile(SmartSysFile sysFile) {
// 实现流程:
// 1、根据 sysFile.id 获取数据库原来的文件记录;
// 2、删除对应 url 的文件;
// 3、更新传来的文件信息到数据库中。
} }
} }
...@@ -4,8 +4,8 @@ import javax.persistence.GeneratedValue; ...@@ -4,8 +4,8 @@ import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date; import java.util.Date;
import com.glsx.smart.pojo.BaseDTO;
/** /**
* <p>Description: * <p>Description:
...@@ -20,7 +20,26 @@ import com.glsx.smart.pojo.BaseDTO; ...@@ -20,7 +20,26 @@ import com.glsx.smart.pojo.BaseDTO;
* 车家智能产品数据表 * 车家智能产品数据表
*/ */
@Table(name = "smart_product") @Table(name = "smart_product")
public class SmartProduct extends BaseDTO { public class SmartProduct {
/**
* 产品类型名称
*/
@Transient
private String typeName;
/**
* 接入平台名称
*/
@Transient
private String platformName;
/**
* 配网模式名称
*/
@Transient
private String networkName;
/** /**
* 标识ID * 标识ID
*/ */
...@@ -93,6 +112,30 @@ public class SmartProduct extends BaseDTO { ...@@ -93,6 +112,30 @@ public class SmartProduct extends BaseDTO {
*/ */
private Long updateBy; private Long updateBy;
public String getTypeName() {
return typeName;
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
public String getPlatformName() {
return platformName;
}
public void setPlatformName(String platformName) {
this.platformName = platformName;
}
public String getNetworkName() {
return networkName;
}
public void setNetworkName(String networkName) {
this.networkName = networkName;
}
public Long getId() { public Long getId() {
return id; return id;
} }
...@@ -207,25 +250,24 @@ public class SmartProduct extends BaseDTO { ...@@ -207,25 +250,24 @@ public class SmartProduct extends BaseDTO {
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); return "SmartProduct{" +
sb.append(getClass().getSimpleName()); "typeName='" + typeName + '\'' +
sb.append(" ["); ", platformName='" + platformName + '\'' +
sb.append("Hash = ").append(hashCode()); ", networkName='" + networkName + '\'' +
sb.append(", id=").append(id); ", id=" + id +
sb.append(", productName=").append(productName); ", productName='" + productName + '\'' +
sb.append(", icon=").append(icon); ", icon=" + icon +
sb.append(", typeId=").append(typeId); ", typeId=" + typeId +
sb.append(", shopProductId=").append(shopProductId); ", shopProductId='" + shopProductId + '\'' +
sb.append(", platformKey=").append(platformKey); ", platformKey='" + platformKey + '\'' +
sb.append(", platformProductId=").append(platformProductId); ", platformProductId='" + platformProductId + '\'' +
sb.append(", networkKey=").append(networkKey); ", networkKey='" + networkKey + '\'' +
sb.append(", status=").append(status); ", status=" + status +
sb.append(", remark=").append(remark); ", remark='" + remark + '\'' +
sb.append(", createTime=").append(createTime); ", createTime=" + createTime +
sb.append(", createBy=").append(createBy); ", createBy=" + createBy +
sb.append(", updateTime=").append(updateTime); ", updateTime=" + updateTime +
sb.append(", updateBy=").append(updateBy); ", updateBy=" + updateBy +
sb.append("]"); "} " + super.toString();
return sb.toString();
} }
} }
...@@ -5,7 +5,6 @@ import javax.persistence.GenerationType; ...@@ -5,7 +5,6 @@ import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.util.Date; import java.util.Date;
import com.glsx.smart.pojo.BaseDTO;
/** /**
* <p>Description: * <p>Description:
...@@ -20,7 +19,7 @@ import com.glsx.smart.pojo.BaseDTO; ...@@ -20,7 +19,7 @@ import com.glsx.smart.pojo.BaseDTO;
* 车家智能系统代码集表 * 车家智能系统代码集表
*/ */
@Table(name = "smart_sys_code") @Table(name = "smart_sys_code")
public class SmartSysCode extends BaseDTO { public class SmartSysCode {
/** /**
* 标识ID * 标识ID
*/ */
......
...@@ -2,6 +2,7 @@ package com.glsx.smart.dao.mapper; ...@@ -2,6 +2,7 @@ package com.glsx.smart.dao.mapper;
import java.util.List; import java.util.List;
import com.glsx.smart.dao.entity.SmartProduct; import com.glsx.smart.dao.entity.SmartProduct;
import com.glsx.smart.pojo.SmartProductReq;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -15,6 +16,9 @@ import org.apache.ibatis.annotations.Param; ...@@ -15,6 +16,9 @@ import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
public interface SmartProductMapper extends tk.mybatis.mapper.common.Mapper<SmartProduct> { public interface SmartProductMapper extends tk.mybatis.mapper.common.Mapper<SmartProduct> {
List<SmartProduct> getList(SmartProductReq req);
int insertOrUpdate(SmartProduct record); int insertOrUpdate(SmartProduct record);
int insertOrUpdateSelective(SmartProduct record); int insertOrUpdateSelective(SmartProduct record);
......
...@@ -2,6 +2,7 @@ package com.glsx.smart.dao.mapper; ...@@ -2,6 +2,7 @@ package com.glsx.smart.dao.mapper;
import java.util.List; import java.util.List;
import com.glsx.smart.dao.entity.SmartSysCode; import com.glsx.smart.dao.entity.SmartSysCode;
import com.glsx.smart.pojo.SmartSysCodeReq;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -15,6 +16,8 @@ import org.apache.ibatis.annotations.Param; ...@@ -15,6 +16,8 @@ import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
public interface SmartSysCodeMapper extends tk.mybatis.mapper.common.Mapper<SmartSysCode> { public interface SmartSysCodeMapper extends tk.mybatis.mapper.common.Mapper<SmartSysCode> {
List<SmartSysCode> getList(SmartSysCodeReq req);
int insertOrUpdate(SmartSysCode record); int insertOrUpdate(SmartSysCode record);
int insertOrUpdateSelective(SmartSysCode record); int insertOrUpdateSelective(SmartSysCode record);
......
package com.glsx.smart.exception;
/**
* <p>Description:
* <p>Project: chejia-smart
*
* @author wbh
* @date 2021-03-16
*/
public class BusinessException extends RuntimeException {
private Integer code;
private String message;
public BusinessException() {}
public BusinessException(ResultEnum resultEnum) {
this.code = resultEnum.getCode();
this.message = resultEnum.getMessage();
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
@Override
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
package com.glsx.smart.exception;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
/**
* <p>Description:
* <p>Project: chejia-smart
*
* @author wbh
* @date 2021-03-16
*/
@RestControllerAdvice
public class BusinessExceptionHandler {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
@ExceptionHandler(BusinessException.class)
public void handleBusinessException(BusinessException e) {
logger.error("!!!! ERROR", e);
}
}
package com.glsx.smart.exception;
/**
* <p>Description:
* <p>Project: chejia-smart
*
* @author wbh
* @date 2021-03-16
*/
public enum ResultEnum {
SUCCESS(200, "成功"),
ERROR(500, "系统异常"),
PARAM_ERROR(1001, "参数错误"),
ID_NOT_FOUND(1002, "ID不存在"),
PRODUCT_NOT_FOUND(2001, "产品ID未找到"),
;
private final Integer code;
private final String message;
ResultEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
public Integer getCode() {
return code;
}
public String getMessage() {
return message;
}
}
package com.glsx.smart.pojo;
/**
* <p>Description:
* <p>Project: chejia-smart
*
* @author wbh
* @date 2021-03-16
*/
public class SmartProductReq extends BaseDTO {
}
package com.glsx.smart.pojo;
/**
* <p>Description:
* <p>Project: chejia-smart
*
* @author wbh
* @date 2021-03-16
*/
public class SmartSysCodeReq extends BaseDTO {
/**
* 字典类型
*/
private String dictType;
/**
* 字典键值
*/
private String dictKey;
/**
* 字典值
*/
private String dictValue;
/**
* 父级键值
*/
private String parentKey;
public String getDictType() {
return dictType;
}
public void setDictType(String dictType) {
this.dictType = dictType;
}
public String getDictKey() {
return dictKey;
}
public void setDictKey(String dictKey) {
this.dictKey = dictKey;
}
public String getDictValue() {
return dictValue;
}
public void setDictValue(String dictValue) {
this.dictValue = dictValue;
}
public String getParentKey() {
return parentKey;
}
public void setParentKey(String parentKey) {
this.parentKey = parentKey;
}
@Override
public String toString() {
return "SmartSysCodeReq{" +
"dictType='" + dictType + '\'' +
", dictKey='" + dictKey + '\'' +
", dictValue='" + dictValue + '\'' +
", parentKey='" + parentKey + '\'' +
"} " + super.toString();
}
}
...@@ -13,10 +13,10 @@ import org.slf4j.LoggerFactory; ...@@ -13,10 +13,10 @@ import org.slf4j.LoggerFactory;
* @date 2021-03-15 * @date 2021-03-15
*/ */
public abstract class BaseService { public abstract class BaseService {
protected Logger logger = LoggerFactory.getLogger(this.getClass()); protected final Logger logger = LoggerFactory.getLogger(this.getClass());
/** /**
* 按需开启分页 * 按需开启分页,调用此方法后需紧跟查询 sql,否则分页将不生效
* *
* @param req 请求体 * @param req 请求体
* @param <T> 继承自 {@link BaseDTO} * @param <T> 继承自 {@link BaseDTO}
......
package com.glsx.smart.service; package com.glsx.smart.service;
import java.util.List; import com.github.pagehelper.PageInfo;
import com.glsx.smart.dao.entity.SmartProduct; import com.glsx.smart.dao.entity.SmartProduct;
import com.glsx.smart.pojo.SmartProductReq;
/** /**
* <p>Description: * <p>Description:
...@@ -12,7 +13,7 @@ import com.glsx.smart.dao.entity.SmartProduct; ...@@ -12,7 +13,7 @@ import com.glsx.smart.dao.entity.SmartProduct;
*/ */
public interface SmartProductService { public interface SmartProductService {
List<SmartProduct> getList(SmartProduct product); PageInfo<SmartProduct> getList(SmartProductReq req);
SmartProduct getById(Long id); SmartProduct getById(Long id);
...@@ -20,43 +21,7 @@ public interface SmartProductService { ...@@ -20,43 +21,7 @@ public interface SmartProductService {
void getCommandSetById(Long id); void getCommandSetById(Long id);
void checkShopProductIdValid(String shopProductId); void checkShopProductId(String shopProductId);
void putOn(Long id);
void putOff(Long id);
long countByExample(SmartProduct example);
int deleteByExample(SmartProduct example);
int deleteByPrimaryKey(Long id);
int insert(SmartProduct record);
int insertOrUpdate(SmartProduct record);
int insertOrUpdateSelective(SmartProduct record);
int insertSelective(SmartProduct record);
List<SmartProduct> selectByExample(SmartProduct example);
SmartProduct selectByPrimaryKey(Long id);
int updateByExampleSelective(SmartProduct record, SmartProduct example);
int updateByExample(SmartProduct record, SmartProduct example);
int updateByPrimaryKeySelective(SmartProduct record);
int updateByPrimaryKey(SmartProduct record);
int updateBatch(List<SmartProduct> list);
int updateBatchSelective(List<SmartProduct> list);
int batchInsert(List<SmartProduct> list);
void putOnOff(Long id);
} }
...@@ -12,35 +12,17 @@ import com.glsx.smart.dao.entity.SmartProductTypeParam; ...@@ -12,35 +12,17 @@ import com.glsx.smart.dao.entity.SmartProductTypeParam;
*/ */
public interface SmartProductTypeParamService { public interface SmartProductTypeParamService {
int deleteByExample(SmartProductTypeParam example);
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
int insert(SmartProductTypeParam record);
int insertOrUpdate(SmartProductTypeParam record);
int insertOrUpdateSelective(SmartProductTypeParam record);
int insertSelective(SmartProductTypeParam record); int insertSelective(SmartProductTypeParam record);
List<SmartProductTypeParam> selectByExample(SmartProductTypeParam example); List<SmartProductTypeParam> selectByExample(SmartProductTypeParam example);
SmartProductTypeParam selectByPrimaryKey(Long id); SmartProductTypeParam selectByPrimaryKey(Long id);
int updateByExampleSelective(SmartProductTypeParam record,
SmartProductTypeParam example);
int updateByExample(SmartProductTypeParam record, SmartProductTypeParam example);
int updateByPrimaryKeySelective(SmartProductTypeParam record); int updateByPrimaryKeySelective(SmartProductTypeParam record);
int updateByPrimaryKey(SmartProductTypeParam record);
int updateBatch(List<SmartProductTypeParam> list);
int updateBatchSelective(List<SmartProductTypeParam> list); int updateBatchSelective(List<SmartProductTypeParam> list);
int batchInsert(List<SmartProductTypeParam> list); int batchInsert(List<SmartProductTypeParam> list);
} }
...@@ -19,36 +19,4 @@ public interface SmartProductTypeService { ...@@ -19,36 +19,4 @@ public interface SmartProductTypeService {
void save(SmartProductType productType); void save(SmartProductType productType);
List<String> getShopTagList(); List<String> getShopTagList();
int deleteByExample(SmartProductType example);
int deleteByPrimaryKey(Long id);
int insert(SmartProductType record);
int insertOrUpdate(SmartProductType record);
int insertOrUpdateSelective(SmartProductType record);
int insertSelective(SmartProductType record);
List<SmartProductType> selectByExample(SmartProductType example);
SmartProductType selectByPrimaryKey(Long id);
int updateByExampleSelective(SmartProductType record, SmartProductType example);
int updateByExample(SmartProductType record, SmartProductType example);
int updateByPrimaryKeySelective(SmartProductType record);
int updateByPrimaryKey(SmartProductType record);
int updateBatch(List<SmartProductType> list);
int updateBatchSelective(List<SmartProductType> list);
int batchInsert(List<SmartProductType> list);
} }
...@@ -12,34 +12,19 @@ import com.glsx.smart.dao.entity.SmartSceneData; ...@@ -12,34 +12,19 @@ import com.glsx.smart.dao.entity.SmartSceneData;
*/ */
public interface SmartSceneDataService { public interface SmartSceneDataService {
int deleteByExample(SmartSceneData example);
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
int insert(SmartSceneData record);
int insertOrUpdate(SmartSceneData record); int insertOrUpdate(SmartSceneData record);
int insertOrUpdateSelective(SmartSceneData record);
int insertSelective(SmartSceneData record); int insertSelective(SmartSceneData record);
List<SmartSceneData> selectByExample(SmartSceneData example); List<SmartSceneData> selectByExample(SmartSceneData example);
SmartSceneData selectByPrimaryKey(Long id); SmartSceneData selectByPrimaryKey(Long id);
int updateByExampleSelective(SmartSceneData record, SmartSceneData example);
int updateByExample(SmartSceneData record, SmartSceneData example);
int updateByPrimaryKeySelective(SmartSceneData record); int updateByPrimaryKeySelective(SmartSceneData record);
int updateByPrimaryKey(SmartSceneData record);
int updateBatch(List<SmartSceneData> list);
int updateBatchSelective(List<SmartSceneData> list); int updateBatchSelective(List<SmartSceneData> list);
int batchInsert(List<SmartSceneData> list); int batchInsert(List<SmartSceneData> list);
} }
...@@ -12,32 +12,18 @@ import com.glsx.smart.dao.entity.SmartScene; ...@@ -12,32 +12,18 @@ import com.glsx.smart.dao.entity.SmartScene;
*/ */
public interface SmartSceneService { public interface SmartSceneService {
int deleteByExample(SmartScene example);
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
int insert(SmartScene record);
int insertOrUpdate(SmartScene record); int insertOrUpdate(SmartScene record);
int insertOrUpdateSelective(SmartScene record);
int insertSelective(SmartScene record); int insertSelective(SmartScene record);
List<SmartScene> selectByExample(SmartScene example); List<SmartScene> selectByExample(SmartScene example);
SmartScene selectByPrimaryKey(Long id); SmartScene selectByPrimaryKey(Long id);
int updateByExampleSelective(SmartScene record, SmartScene example);
int updateByExample(SmartScene record, SmartScene example);
int updateByPrimaryKeySelective(SmartScene record); int updateByPrimaryKeySelective(SmartScene record);
int updateByPrimaryKey(SmartScene record);
int updateBatch(List<SmartScene> list);
int updateBatchSelective(List<SmartScene> list); int updateBatchSelective(List<SmartScene> list);
int batchInsert(List<SmartScene> list); int batchInsert(List<SmartScene> list);
......
...@@ -12,32 +12,18 @@ import com.glsx.smart.dao.entity.SmartSceneTemplate; ...@@ -12,32 +12,18 @@ import com.glsx.smart.dao.entity.SmartSceneTemplate;
*/ */
public interface SmartSceneTemplateService { public interface SmartSceneTemplateService {
int deleteByExample(SmartSceneTemplate example);
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
int insert(SmartSceneTemplate record);
int insertOrUpdate(SmartSceneTemplate record); int insertOrUpdate(SmartSceneTemplate record);
int insertOrUpdateSelective(SmartSceneTemplate record);
int insertSelective(SmartSceneTemplate record); int insertSelective(SmartSceneTemplate record);
List<SmartSceneTemplate> selectByExample(SmartSceneTemplate example); List<SmartSceneTemplate> selectByExample(SmartSceneTemplate example);
SmartSceneTemplate selectByPrimaryKey(Long id); SmartSceneTemplate selectByPrimaryKey(Long id);
int updateByExampleSelective(SmartSceneTemplate record, SmartSceneTemplate example);
int updateByExample(SmartSceneTemplate record, SmartSceneTemplate example);
int updateByPrimaryKeySelective(SmartSceneTemplate record); int updateByPrimaryKeySelective(SmartSceneTemplate record);
int updateByPrimaryKey(SmartSceneTemplate record);
int updateBatch(List<SmartSceneTemplate> list);
int updateBatchSelective(List<SmartSceneTemplate> list); int updateBatchSelective(List<SmartSceneTemplate> list);
int batchInsert(List<SmartSceneTemplate> list); int batchInsert(List<SmartSceneTemplate> list);
......
package com.glsx.smart.service; package com.glsx.smart.service;
import java.util.List; import java.util.List;
import com.github.pagehelper.PageInfo;
import com.glsx.smart.dao.entity.SmartSysCode; import com.glsx.smart.dao.entity.SmartSysCode;
import com.glsx.smart.pojo.SmartSysCodeReq;
/** /**
* <p>Description: * <p>Description:
...@@ -12,35 +14,21 @@ import com.glsx.smart.dao.entity.SmartSysCode; ...@@ -12,35 +14,21 @@ import com.glsx.smart.dao.entity.SmartSysCode;
*/ */
public interface SmartSysCodeService { public interface SmartSysCodeService {
List<SmartSysCode> getList(SmartSysCode sysCode); PageInfo<SmartSysCode> getList(SmartSysCodeReq req);
int deleteByExample(SmartSysCode example);
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
int insert(SmartSysCode record);
int insertOrUpdate(SmartSysCode record); int insertOrUpdate(SmartSysCode record);
int insertOrUpdateSelective(SmartSysCode record);
int insertSelective(SmartSysCode record); int insertSelective(SmartSysCode record);
List<SmartSysCode> selectByExample(SmartSysCode example); List<SmartSysCode> selectByExample(SmartSysCode example);
SmartSysCode selectByPrimaryKey(Long id); SmartSysCode selectByPrimaryKey(Long id);
int updateByExampleSelective(SmartSysCode record, SmartSysCode example);
int updateByExample(SmartSysCode record, SmartSysCode example);
int updateByPrimaryKeySelective(SmartSysCode record); int updateByPrimaryKeySelective(SmartSysCode record);
int updateByPrimaryKey(SmartSysCode record);
int updateBatch(List<SmartSysCode> list);
int updateBatchSelective(List<SmartSysCode> list); int updateBatchSelective(List<SmartSysCode> list);
int batchInsert(List<SmartSysCode> list); int batchInsert(List<SmartSysCode> list);
......
...@@ -12,32 +12,18 @@ import com.glsx.smart.dao.entity.SmartSysFile; ...@@ -12,32 +12,18 @@ import com.glsx.smart.dao.entity.SmartSysFile;
*/ */
public interface SmartSysFileService { public interface SmartSysFileService {
int deleteByExample(SmartSysFile example);
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
int insert(SmartSysFile record);
int insertOrUpdate(SmartSysFile record); int insertOrUpdate(SmartSysFile record);
int insertOrUpdateSelective(SmartSysFile record);
int insertSelective(SmartSysFile record); int insertSelective(SmartSysFile record);
List<SmartSysFile> selectByExample(SmartSysFile example); List<SmartSysFile> selectByExample(SmartSysFile example);
SmartSysFile selectByPrimaryKey(Long id); SmartSysFile selectByPrimaryKey(Long id);
int updateByExampleSelective(SmartSysFile record, SmartSysFile example);
int updateByExample(SmartSysFile record, SmartSysFile example);
int updateByPrimaryKeySelective(SmartSysFile record); int updateByPrimaryKeySelective(SmartSysFile record);
int updateByPrimaryKey(SmartSysFile record);
int updateBatch(List<SmartSysFile> list);
int updateBatchSelective(List<SmartSysFile> list); int updateBatchSelective(List<SmartSysFile> list);
int batchInsert(List<SmartSysFile> list); int batchInsert(List<SmartSysFile> list);
......
...@@ -12,32 +12,18 @@ import com.glsx.smart.dao.entity.SmartTemplateParam; ...@@ -12,32 +12,18 @@ import com.glsx.smart.dao.entity.SmartTemplateParam;
*/ */
public interface SmartTemplateParamService { public interface SmartTemplateParamService {
int deleteByExample(SmartTemplateParam example);
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
int insert(SmartTemplateParam record);
int insertOrUpdate(SmartTemplateParam record); int insertOrUpdate(SmartTemplateParam record);
int insertOrUpdateSelective(SmartTemplateParam record);
int insertSelective(SmartTemplateParam record); int insertSelective(SmartTemplateParam record);
List<SmartTemplateParam> selectByExample(SmartTemplateParam example); List<SmartTemplateParam> selectByExample(SmartTemplateParam example);
SmartTemplateParam selectByPrimaryKey(Long id); SmartTemplateParam selectByPrimaryKey(Long id);
int updateByExampleSelective(SmartTemplateParam record, SmartTemplateParam example);
int updateByExample(SmartTemplateParam record, SmartTemplateParam example);
int updateByPrimaryKeySelective(SmartTemplateParam record); int updateByPrimaryKeySelective(SmartTemplateParam record);
int updateByPrimaryKey(SmartTemplateParam record);
int updateBatch(List<SmartTemplateParam> list);
int updateBatchSelective(List<SmartTemplateParam> list); int updateBatchSelective(List<SmartTemplateParam> list);
int batchInsert(List<SmartTemplateParam> list); int batchInsert(List<SmartTemplateParam> list);
......
...@@ -12,32 +12,18 @@ import com.glsx.smart.dao.entity.SmartUserRelation; ...@@ -12,32 +12,18 @@ import com.glsx.smart.dao.entity.SmartUserRelation;
*/ */
public interface SmartUserRelationService { public interface SmartUserRelationService {
int deleteByExample(SmartUserRelation example);
int deleteByPrimaryKey(Long id); int deleteByPrimaryKey(Long id);
int insert(SmartUserRelation record);
int insertOrUpdate(SmartUserRelation record); int insertOrUpdate(SmartUserRelation record);
int insertOrUpdateSelective(SmartUserRelation record);
int insertSelective(SmartUserRelation record); int insertSelective(SmartUserRelation record);
List<SmartUserRelation> selectByExample(SmartUserRelation example); List<SmartUserRelation> selectByExample(SmartUserRelation example);
SmartUserRelation selectByPrimaryKey(Long id); SmartUserRelation selectByPrimaryKey(Long id);
int updateByExampleSelective(SmartUserRelation record, SmartUserRelation example);
int updateByExample(SmartUserRelation record, SmartUserRelation example);
int updateByPrimaryKeySelective(SmartUserRelation record); int updateByPrimaryKeySelective(SmartUserRelation record);
int updateByPrimaryKey(SmartUserRelation record);
int updateBatch(List<SmartUserRelation> list);
int updateBatchSelective(List<SmartUserRelation> list); int updateBatchSelective(List<SmartUserRelation> list);
int batchInsert(List<SmartUserRelation> list); int batchInsert(List<SmartUserRelation> list);
......
...@@ -2,11 +2,16 @@ package com.glsx.smart.service.impl; ...@@ -2,11 +2,16 @@ package com.glsx.smart.service.impl;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import com.github.pagehelper.PageInfo;
import com.glsx.smart.dao.entity.SmartProduct; import com.glsx.smart.dao.entity.SmartProduct;
import com.glsx.smart.dao.mapper.SmartProductMapper; import com.glsx.smart.dao.mapper.SmartProductMapper;
import com.glsx.smart.exception.BusinessException;
import com.glsx.smart.exception.ResultEnum;
import com.glsx.smart.pojo.SmartProductReq;
import com.glsx.smart.service.BaseService; import com.glsx.smart.service.BaseService;
import com.glsx.smart.service.SmartProductService; import com.glsx.smart.service.SmartProductService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/** /**
* <p>Description: * <p>Description:
...@@ -18,131 +23,69 @@ import org.springframework.stereotype.Service; ...@@ -18,131 +23,69 @@ import org.springframework.stereotype.Service;
@Service @Service
public class SmartProductServiceImpl extends BaseService implements SmartProductService { public class SmartProductServiceImpl extends BaseService implements SmartProductService {
@Resource @Resource
private SmartProductMapper productMapper; private SmartProductMapper productMapper;
/**
* 获取产品列表。
*
* @param req 请求体
* @return 结果
*/
@Override @Override
public List<SmartProduct> getList(SmartProduct product) { public PageInfo<SmartProduct> getList(SmartProductReq req) {
super.startPagination(product); super.startPagination(req);
List<SmartProduct> productList = productMapper.select(product); List<SmartProduct> productList = productMapper.getList(req);
return productList; PageInfo<SmartProduct> pageInfo = PageInfo.of(productList);
return pageInfo;
} }
/**
* 根据 id 查询产品详情。
*
* @param id 产品 id
* @return 结果
*/
@Override @Override
public SmartProduct getById(Long id) { public SmartProduct getById(Long id) {
return productMapper.selectByPrimaryKey(id); SmartProduct product = productMapper.selectByPrimaryKey(id);
return product;
} }
/**
* 保存产品。无则插入,有则更新。
*
* @param product 产品
*/
@Override @Override
@Transactional
public void save(SmartProduct product) { public void save(SmartProduct product) {
SmartProduct record = productMapper.selectByPrimaryKey(product.getId()); if (product.getId() == null) {
if (record == null) { super.logger.info("$$$$ Starting inserting...");
productMapper.insertSelective(product); productMapper.insertSelective(product);
} else { } else {
super.logger.info("$$$$ Starting updating...");
SmartProduct record = productMapper.selectByPrimaryKey(product.getId());
if (record != null) {
productMapper.updateByPrimaryKeySelective(product); productMapper.updateByPrimaryKeySelective(product);
} else {
throw new BusinessException(ResultEnum.PRODUCT_NOT_FOUND);
} }
} }
@Override
public void getCommandSetById(Long id) {
}
@Override
public void checkShopProductIdValid(String shopProductId) {
}
@Override
public void putOn(Long id) {
}
@Override
public void putOff(Long id) {
}
@Override
public long countByExample(SmartProduct example) {
return productMapper.selectCount(new SmartProduct());
}
@Override
public int deleteByExample(SmartProduct example) {
return productMapper.deleteByExample(example);
}
@Override
public int deleteByPrimaryKey(Long id) {
return productMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(SmartProduct record) {
return productMapper.insert(record);
}
@Override
public int insertOrUpdate(SmartProduct record) {
return productMapper.insertOrUpdate(record);
}
@Override
public int insertOrUpdateSelective(SmartProduct record) {
return productMapper.insertOrUpdateSelective(record);
}
@Override
public int insertSelective(SmartProduct record) {
return productMapper.insertSelective(record);
}
@Override
public List<SmartProduct> selectByExample(SmartProduct example) {
return productMapper.selectByExample(example);
}
@Override
public SmartProduct selectByPrimaryKey(Long id) {
return productMapper.selectByPrimaryKey(id);
}
@Override
public int updateByExampleSelective(SmartProduct record, SmartProduct example) {
return productMapper.updateByExampleSelective(record, example);
} }
@Override @Override
public int updateByExample(SmartProduct record, SmartProduct example) { public void getCommandSetById(Long id) {
return productMapper.updateByExample(record, example);
}
@Override
public int updateByPrimaryKeySelective(SmartProduct record) {
return productMapper.updateByPrimaryKeySelective(record);
} }
@Override @Override
public int updateByPrimaryKey(SmartProduct record) { public void checkShopProductId(String shopProductId) {
return productMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<SmartProduct> list) {
return productMapper.updateBatch(list);
} }
@Override @Override
public int updateBatchSelective(List<SmartProduct> list) { public void putOnOff(Long id) {
return productMapper.updateBatchSelective(list);
}
@Override
public int batchInsert(List<SmartProduct> list) {
return productMapper.batchInsert(list);
} }
} }
...@@ -22,38 +22,18 @@ public class SmartProductTypeParamServiceImpl implements SmartProductTypeParamSe ...@@ -22,38 +22,18 @@ public class SmartProductTypeParamServiceImpl implements SmartProductTypeParamSe
private SmartProductTypeParamMapper smartProductTypeParamMapper; private SmartProductTypeParamMapper smartProductTypeParamMapper;
@Override @Override
public int deleteByExample(SmartProductTypeParam example) {
return smartProductTypeParamMapper.deleteByExample(example);
}
@Override
public int deleteByPrimaryKey(Long id) { public int deleteByPrimaryKey(Long id) {
return smartProductTypeParamMapper.deleteByPrimaryKey(id); return smartProductTypeParamMapper.deleteByPrimaryKey(id);
} }
@Override @Override
public int insert(SmartProductTypeParam record) {
return smartProductTypeParamMapper.insert(record);
}
@Override
public int insertOrUpdate(SmartProductTypeParam record) {
return smartProductTypeParamMapper.insertOrUpdate(record);
}
@Override
public int insertOrUpdateSelective(SmartProductTypeParam record) {
return smartProductTypeParamMapper.insertOrUpdateSelective(record);
}
@Override
public int insertSelective(SmartProductTypeParam record) { public int insertSelective(SmartProductTypeParam record) {
return smartProductTypeParamMapper.insertSelective(record); return smartProductTypeParamMapper.insertSelective(record);
} }
@Override @Override
public List<SmartProductTypeParam> selectByExample(SmartProductTypeParam example) { public List<SmartProductTypeParam> selectByExample(SmartProductTypeParam example) {
return smartProductTypeParamMapper.selectByExample(example); return smartProductTypeParamMapper.select(example);
} }
@Override @Override
...@@ -62,32 +42,11 @@ public class SmartProductTypeParamServiceImpl implements SmartProductTypeParamSe ...@@ -62,32 +42,11 @@ public class SmartProductTypeParamServiceImpl implements SmartProductTypeParamSe
} }
@Override @Override
public int updateByExampleSelective(SmartProductTypeParam record,
SmartProductTypeParam example) {
return smartProductTypeParamMapper.updateByExampleSelective(record, example);
}
@Override
public int updateByExample(SmartProductTypeParam record, SmartProductTypeParam example) {
return smartProductTypeParamMapper.updateByExample(record, example);
}
@Override
public int updateByPrimaryKeySelective(SmartProductTypeParam record) { public int updateByPrimaryKeySelective(SmartProductTypeParam record) {
return smartProductTypeParamMapper.updateByPrimaryKeySelective(record); return smartProductTypeParamMapper.updateByPrimaryKeySelective(record);
} }
@Override @Override
public int updateByPrimaryKey(SmartProductTypeParam record) {
return smartProductTypeParamMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<SmartProductTypeParam> list) {
return smartProductTypeParamMapper.updateBatch(list);
}
@Override
public int updateBatchSelective(List<SmartProductTypeParam> list) { public int updateBatchSelective(List<SmartProductTypeParam> list) {
return smartProductTypeParamMapper.updateBatchSelective(list); return smartProductTypeParamMapper.updateBatchSelective(list);
} }
...@@ -96,5 +55,4 @@ public class SmartProductTypeParamServiceImpl implements SmartProductTypeParamSe ...@@ -96,5 +55,4 @@ public class SmartProductTypeParamServiceImpl implements SmartProductTypeParamSe
public int batchInsert(List<SmartProductTypeParam> list) { public int batchInsert(List<SmartProductTypeParam> list) {
return smartProductTypeParamMapper.batchInsert(list); return smartProductTypeParamMapper.batchInsert(list);
} }
} }
package com.glsx.smart.service.impl; package com.glsx.smart.service.impl;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List; import java.util.List;
import com.glsx.smart.dao.entity.SmartProductType; import com.glsx.smart.dao.entity.SmartProductType;
import com.glsx.smart.dao.mapper.SmartProductTypeMapper; import com.glsx.smart.dao.mapper.SmartProductTypeMapper;
import com.glsx.smart.exception.BusinessException;
import com.glsx.smart.exception.ResultEnum;
import com.glsx.smart.service.SmartProductTypeService; import com.glsx.smart.service.SmartProductTypeService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -17,7 +20,6 @@ import org.springframework.stereotype.Service; ...@@ -17,7 +20,6 @@ import org.springframework.stereotype.Service;
@Service @Service
public class SmartProductTypeServiceImpl implements SmartProductTypeService { public class SmartProductTypeServiceImpl implements SmartProductTypeService {
@Resource @Resource
private SmartProductTypeMapper productTypeMapper; private SmartProductTypeMapper productTypeMapper;
...@@ -33,94 +35,20 @@ public class SmartProductTypeServiceImpl implements SmartProductTypeService { ...@@ -33,94 +35,20 @@ public class SmartProductTypeServiceImpl implements SmartProductTypeService {
@Override @Override
public void save(SmartProductType productType) { public void save(SmartProductType productType) {
SmartProductType record = productTypeMapper.selectByPrimaryKey( if (productType.getId() == null) {
productType.getId());
if (record == null) {
productTypeMapper.insertSelective(productType); productTypeMapper.insertSelective(productType);
} else { } else {
SmartProductType record = productTypeMapper.selectByPrimaryKey(productType.getId());
if (record != null) {
productTypeMapper.updateByPrimaryKeySelective(productType); productTypeMapper.updateByPrimaryKeySelective(productType);
} else {
throw new BusinessException(ResultEnum.ID_NOT_FOUND);
} }
} }
@Override
public List<String> getShopTagList() {
return null;
}
@Override
public int deleteByExample(SmartProductType example) {
return productTypeMapper.deleteByExample(example);
}
@Override
public int deleteByPrimaryKey(Long id) {
return productTypeMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(SmartProductType record) {
return productTypeMapper.insert(record);
}
@Override
public int insertOrUpdate(SmartProductType record) {
return productTypeMapper.insertOrUpdate(record);
}
@Override
public int insertOrUpdateSelective(SmartProductType record) {
return productTypeMapper.insertOrUpdateSelective(record);
}
@Override
public int insertSelective(SmartProductType record) {
return productTypeMapper.insertSelective(record);
}
@Override
public List<SmartProductType> selectByExample(SmartProductType example) {
return productTypeMapper.selectByExample(example);
}
@Override
public SmartProductType selectByPrimaryKey(Long id) {
return productTypeMapper.selectByPrimaryKey(id);
}
@Override
public int updateByExampleSelective(SmartProductType record, SmartProductType example) {
return productTypeMapper.updateByExampleSelective(record, example);
}
@Override
public int updateByExample(SmartProductType record, SmartProductType example) {
return productTypeMapper.updateByExample(record, example);
}
@Override
public int updateByPrimaryKeySelective(SmartProductType record) {
return productTypeMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(SmartProductType record) {
return productTypeMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<SmartProductType> list) {
return productTypeMapper.updateBatch(list);
}
@Override
public int updateBatchSelective(List<SmartProductType> list) {
return productTypeMapper.updateBatchSelective(list);
} }
@Override @Override
public int batchInsert(List<SmartProductType> list) { public List<String> getShopTagList() {
return productTypeMapper.batchInsert(list); return Arrays.asList("牛逼", "干翻苹果");
} }
} }
...@@ -4,6 +4,8 @@ import javax.annotation.Resource; ...@@ -4,6 +4,8 @@ import javax.annotation.Resource;
import java.util.List; import java.util.List;
import com.glsx.smart.dao.entity.SmartSceneData; import com.glsx.smart.dao.entity.SmartSceneData;
import com.glsx.smart.dao.mapper.SmartSceneDataMapper; import com.glsx.smart.dao.mapper.SmartSceneDataMapper;
import com.glsx.smart.exception.BusinessException;
import com.glsx.smart.exception.ResultEnum;
import com.glsx.smart.service.SmartSceneDataService; import com.glsx.smart.service.SmartSceneDataService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -22,28 +24,22 @@ public class SmartSceneDataServiceImpl implements SmartSceneDataService { ...@@ -22,28 +24,22 @@ public class SmartSceneDataServiceImpl implements SmartSceneDataService {
private SmartSceneDataMapper smartSceneDataMapper; private SmartSceneDataMapper smartSceneDataMapper;
@Override @Override
public int deleteByExample(SmartSceneData example) {
return smartSceneDataMapper.deleteByExample(example);
}
@Override
public int deleteByPrimaryKey(Long id) { public int deleteByPrimaryKey(Long id) {
return smartSceneDataMapper.deleteByPrimaryKey(id); return smartSceneDataMapper.deleteByPrimaryKey(id);
} }
@Override @Override
public int insert(SmartSceneData record) { public int insertOrUpdate(SmartSceneData sceneData) {
return smartSceneDataMapper.insert(record); if (sceneData.getId() == null) {
return smartSceneDataMapper.insertOrUpdateSelective(sceneData);
} else {
SmartSceneData record = smartSceneDataMapper.selectByPrimaryKey(sceneData.getId());
if (record != null) {
return smartSceneDataMapper.updateByPrimaryKeySelective(sceneData);
} else {
throw new BusinessException(ResultEnum.ID_NOT_FOUND);
} }
@Override
public int insertOrUpdate(SmartSceneData record) {
return smartSceneDataMapper.insertOrUpdate(record);
} }
@Override
public int insertOrUpdateSelective(SmartSceneData record) {
return smartSceneDataMapper.insertOrUpdateSelective(record);
} }
@Override @Override
...@@ -53,7 +49,7 @@ public class SmartSceneDataServiceImpl implements SmartSceneDataService { ...@@ -53,7 +49,7 @@ public class SmartSceneDataServiceImpl implements SmartSceneDataService {
@Override @Override
public List<SmartSceneData> selectByExample(SmartSceneData example) { public List<SmartSceneData> selectByExample(SmartSceneData example) {
return smartSceneDataMapper.selectByExample(example); return smartSceneDataMapper.select(example);
} }
@Override @Override
...@@ -62,31 +58,11 @@ public class SmartSceneDataServiceImpl implements SmartSceneDataService { ...@@ -62,31 +58,11 @@ public class SmartSceneDataServiceImpl implements SmartSceneDataService {
} }
@Override @Override
public int updateByExampleSelective(SmartSceneData record, SmartSceneData example) {
return smartSceneDataMapper.updateByExampleSelective(record, example);
}
@Override
public int updateByExample(SmartSceneData record, SmartSceneData example) {
return smartSceneDataMapper.updateByExample(record, example);
}
@Override
public int updateByPrimaryKeySelective(SmartSceneData record) { public int updateByPrimaryKeySelective(SmartSceneData record) {
return smartSceneDataMapper.updateByPrimaryKeySelective(record); return smartSceneDataMapper.updateByPrimaryKeySelective(record);
} }
@Override @Override
public int updateByPrimaryKey(SmartSceneData record) {
return smartSceneDataMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<SmartSceneData> list) {
return smartSceneDataMapper.updateBatch(list);
}
@Override
public int updateBatchSelective(List<SmartSceneData> list) { public int updateBatchSelective(List<SmartSceneData> list) {
return smartSceneDataMapper.updateBatchSelective(list); return smartSceneDataMapper.updateBatchSelective(list);
} }
...@@ -95,5 +71,4 @@ public class SmartSceneDataServiceImpl implements SmartSceneDataService { ...@@ -95,5 +71,4 @@ public class SmartSceneDataServiceImpl implements SmartSceneDataService {
public int batchInsert(List<SmartSceneData> list) { public int batchInsert(List<SmartSceneData> list) {
return smartSceneDataMapper.batchInsert(list); return smartSceneDataMapper.batchInsert(list);
} }
} }
...@@ -4,6 +4,8 @@ import javax.annotation.Resource; ...@@ -4,6 +4,8 @@ import javax.annotation.Resource;
import java.util.List; import java.util.List;
import com.glsx.smart.dao.entity.SmartScene; import com.glsx.smart.dao.entity.SmartScene;
import com.glsx.smart.dao.mapper.SmartSceneMapper; import com.glsx.smart.dao.mapper.SmartSceneMapper;
import com.glsx.smart.exception.BusinessException;
import com.glsx.smart.exception.ResultEnum;
import com.glsx.smart.service.SmartSceneService; import com.glsx.smart.service.SmartSceneService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -22,38 +24,32 @@ public class SmartSceneServiceImpl implements SmartSceneService { ...@@ -22,38 +24,32 @@ public class SmartSceneServiceImpl implements SmartSceneService {
private SmartSceneMapper smartSceneMapper; private SmartSceneMapper smartSceneMapper;
@Override @Override
public int deleteByExample(SmartScene example) {
return smartSceneMapper.deleteByExample(example);
}
@Override
public int deleteByPrimaryKey(Long id) { public int deleteByPrimaryKey(Long id) {
return smartSceneMapper.deleteByPrimaryKey(id); return smartSceneMapper.deleteByPrimaryKey(id);
} }
@Override @Override
public int insert(SmartScene record) { public int insertOrUpdate(SmartScene scene) {
return smartSceneMapper.insert(record); if (scene.getId() == null) {
return smartSceneMapper.insertSelective(scene);
} else {
SmartScene record = smartSceneMapper.selectByPrimaryKey(scene.getId());
if (record != null) {
return smartSceneMapper.updateByPrimaryKeySelective(scene);
} else {
throw new BusinessException(ResultEnum.ID_NOT_FOUND);
} }
@Override
public int insertOrUpdate(SmartScene record) {
return smartSceneMapper.insertOrUpdate(record);
} }
@Override
public int insertOrUpdateSelective(SmartScene record) {
return smartSceneMapper.insertOrUpdateSelective(record);
} }
@Override @Override
public int insertSelective(SmartScene record) { public int insertSelective(SmartScene scene) {
return smartSceneMapper.insertSelective(record); return smartSceneMapper.insertSelective(scene);
} }
@Override @Override
public List<SmartScene> selectByExample(SmartScene example) { public List<SmartScene> selectByExample(SmartScene example) {
return smartSceneMapper.selectByExample(example); return smartSceneMapper.select(example);
} }
@Override @Override
...@@ -62,31 +58,11 @@ public class SmartSceneServiceImpl implements SmartSceneService { ...@@ -62,31 +58,11 @@ public class SmartSceneServiceImpl implements SmartSceneService {
} }
@Override @Override
public int updateByExampleSelective(SmartScene record, SmartScene example) {
return smartSceneMapper.updateByExampleSelective(record, example);
}
@Override
public int updateByExample(SmartScene record, SmartScene example) {
return smartSceneMapper.updateByExample(record, example);
}
@Override
public int updateByPrimaryKeySelective(SmartScene record) { public int updateByPrimaryKeySelective(SmartScene record) {
return smartSceneMapper.updateByPrimaryKeySelective(record); return smartSceneMapper.updateByPrimaryKeySelective(record);
} }
@Override @Override
public int updateByPrimaryKey(SmartScene record) {
return smartSceneMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<SmartScene> list) {
return smartSceneMapper.updateBatch(list);
}
@Override
public int updateBatchSelective(List<SmartScene> list) { public int updateBatchSelective(List<SmartScene> list) {
return smartSceneMapper.updateBatchSelective(list); return smartSceneMapper.updateBatchSelective(list);
} }
......
...@@ -4,6 +4,8 @@ import javax.annotation.Resource; ...@@ -4,6 +4,8 @@ import javax.annotation.Resource;
import java.util.List; import java.util.List;
import com.glsx.smart.dao.entity.SmartSceneTemplate; import com.glsx.smart.dao.entity.SmartSceneTemplate;
import com.glsx.smart.dao.mapper.SmartSceneTemplateMapper; import com.glsx.smart.dao.mapper.SmartSceneTemplateMapper;
import com.glsx.smart.exception.BusinessException;
import com.glsx.smart.exception.ResultEnum;
import com.glsx.smart.service.SmartSceneTemplateService; import com.glsx.smart.service.SmartSceneTemplateService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -22,28 +24,23 @@ public class SmartSceneTemplateServiceImpl implements SmartSceneTemplateService ...@@ -22,28 +24,23 @@ public class SmartSceneTemplateServiceImpl implements SmartSceneTemplateService
private SmartSceneTemplateMapper smartSceneTemplateMapper; private SmartSceneTemplateMapper smartSceneTemplateMapper;
@Override @Override
public int deleteByExample(SmartSceneTemplate example) {
return smartSceneTemplateMapper.deleteByExample(example);
}
@Override
public int deleteByPrimaryKey(Long id) { public int deleteByPrimaryKey(Long id) {
return smartSceneTemplateMapper.deleteByPrimaryKey(id); return smartSceneTemplateMapper.deleteByPrimaryKey(id);
} }
@Override @Override
public int insert(SmartSceneTemplate record) { public int insertOrUpdate(SmartSceneTemplate sceneTemplate) {
return smartSceneTemplateMapper.insert(record); if (sceneTemplate.getId() == null) {
return smartSceneTemplateMapper.insertSelective(sceneTemplate);
} else {
SmartSceneTemplate record = smartSceneTemplateMapper.selectByPrimaryKey(
sceneTemplate.getId());
if (record != null) {
return smartSceneTemplateMapper.updateByPrimaryKeySelective(sceneTemplate);
} else {
throw new BusinessException(ResultEnum.ID_NOT_FOUND);
} }
@Override
public int insertOrUpdate(SmartSceneTemplate record) {
return smartSceneTemplateMapper.insertOrUpdate(record);
} }
@Override
public int insertOrUpdateSelective(SmartSceneTemplate record) {
return smartSceneTemplateMapper.insertOrUpdateSelective(record);
} }
@Override @Override
...@@ -53,7 +50,7 @@ public class SmartSceneTemplateServiceImpl implements SmartSceneTemplateService ...@@ -53,7 +50,7 @@ public class SmartSceneTemplateServiceImpl implements SmartSceneTemplateService
@Override @Override
public List<SmartSceneTemplate> selectByExample(SmartSceneTemplate example) { public List<SmartSceneTemplate> selectByExample(SmartSceneTemplate example) {
return smartSceneTemplateMapper.selectByExample(example); return smartSceneTemplateMapper.select(example);
} }
@Override @Override
...@@ -62,32 +59,11 @@ public class SmartSceneTemplateServiceImpl implements SmartSceneTemplateService ...@@ -62,32 +59,11 @@ public class SmartSceneTemplateServiceImpl implements SmartSceneTemplateService
} }
@Override @Override
public int updateByExampleSelective(SmartSceneTemplate record,
SmartSceneTemplate example) {
return smartSceneTemplateMapper.updateByExampleSelective(record, example);
}
@Override
public int updateByExample(SmartSceneTemplate record, SmartSceneTemplate example) {
return smartSceneTemplateMapper.updateByExample(record, example);
}
@Override
public int updateByPrimaryKeySelective(SmartSceneTemplate record) { public int updateByPrimaryKeySelective(SmartSceneTemplate record) {
return smartSceneTemplateMapper.updateByPrimaryKeySelective(record); return smartSceneTemplateMapper.updateByPrimaryKeySelective(record);
} }
@Override @Override
public int updateByPrimaryKey(SmartSceneTemplate record) {
return smartSceneTemplateMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<SmartSceneTemplate> list) {
return smartSceneTemplateMapper.updateBatch(list);
}
@Override
public int updateBatchSelective(List<SmartSceneTemplate> list) { public int updateBatchSelective(List<SmartSceneTemplate> list) {
return smartSceneTemplateMapper.updateBatchSelective(list); return smartSceneTemplateMapper.updateBatchSelective(list);
} }
......
...@@ -2,8 +2,12 @@ package com.glsx.smart.service.impl; ...@@ -2,8 +2,12 @@ package com.glsx.smart.service.impl;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
import com.github.pagehelper.PageInfo;
import com.glsx.smart.dao.entity.SmartSysCode; import com.glsx.smart.dao.entity.SmartSysCode;
import com.glsx.smart.dao.mapper.SmartSysCodeMapper; import com.glsx.smart.dao.mapper.SmartSysCodeMapper;
import com.glsx.smart.exception.BusinessException;
import com.glsx.smart.exception.ResultEnum;
import com.glsx.smart.pojo.SmartSysCodeReq;
import com.glsx.smart.service.BaseService; import com.glsx.smart.service.BaseService;
import com.glsx.smart.service.SmartSysCodeService; import com.glsx.smart.service.SmartSysCodeService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -22,36 +26,39 @@ public class SmartSysCodeServiceImpl extends BaseService implements SmartSysCode ...@@ -22,36 +26,39 @@ public class SmartSysCodeServiceImpl extends BaseService implements SmartSysCode
@Resource @Resource
private SmartSysCodeMapper sysCodeMapper; private SmartSysCodeMapper sysCodeMapper;
/**
* 获取代码集列表
*
* @param req 请求
* @return 结果
*/
@Override @Override
public List<SmartSysCode> getList(SmartSysCode sysCode) { public PageInfo<SmartSysCode> getList(SmartSysCodeReq req) {
super.startPagination(sysCode); super.startPagination(req);
return sysCodeMapper.selectByExample(sysCode); List<SmartSysCode> sysCodeList = sysCodeMapper.getList(req);
PageInfo<SmartSysCode> pageInfo = new PageInfo<>(sysCodeList);
return pageInfo;
} }
@Override @Override
public int deleteByExample(SmartSysCode example) {
return sysCodeMapper.deleteByExample(example);
}
@Override
public int deleteByPrimaryKey(Long id) { public int deleteByPrimaryKey(Long id) {
return sysCodeMapper.deleteByPrimaryKey(id); return sysCodeMapper.deleteByPrimaryKey(id);
} }
@Override @Override
public int insert(SmartSysCode record) { public int insertOrUpdate(SmartSysCode sysCode) {
return sysCodeMapper.insert(record); if (sysCode.getId() == null) {
return sysCodeMapper.insertSelective(sysCode);
} else {
SmartSysCode record = sysCodeMapper.selectByPrimaryKey(
sysCode.getId());
if (record != null) {
return sysCodeMapper.updateByPrimaryKeySelective(sysCode);
} else {
throw new BusinessException(ResultEnum.ID_NOT_FOUND);
} }
@Override
public int insertOrUpdate(SmartSysCode record) {
return sysCodeMapper.insertOrUpdate(record);
} }
@Override
public int insertOrUpdateSelective(SmartSysCode record) {
return sysCodeMapper.insertOrUpdateSelective(record);
} }
@Override @Override
...@@ -61,7 +68,7 @@ public class SmartSysCodeServiceImpl extends BaseService implements SmartSysCode ...@@ -61,7 +68,7 @@ public class SmartSysCodeServiceImpl extends BaseService implements SmartSysCode
@Override @Override
public List<SmartSysCode> selectByExample(SmartSysCode example) { public List<SmartSysCode> selectByExample(SmartSysCode example) {
return sysCodeMapper.selectByExample(example); return sysCodeMapper.select(example);
} }
@Override @Override
...@@ -70,31 +77,11 @@ public class SmartSysCodeServiceImpl extends BaseService implements SmartSysCode ...@@ -70,31 +77,11 @@ public class SmartSysCodeServiceImpl extends BaseService implements SmartSysCode
} }
@Override @Override
public int updateByExampleSelective(SmartSysCode record, SmartSysCode example) {
return sysCodeMapper.updateByExampleSelective(record, example);
}
@Override
public int updateByExample(SmartSysCode record, SmartSysCode example) {
return sysCodeMapper.updateByExample(record, example);
}
@Override
public int updateByPrimaryKeySelective(SmartSysCode record) { public int updateByPrimaryKeySelective(SmartSysCode record) {
return sysCodeMapper.updateByPrimaryKeySelective(record); return sysCodeMapper.updateByPrimaryKeySelective(record);
} }
@Override @Override
public int updateByPrimaryKey(SmartSysCode record) {
return sysCodeMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<SmartSysCode> list) {
return sysCodeMapper.updateBatch(list);
}
@Override
public int updateBatchSelective(List<SmartSysCode> list) { public int updateBatchSelective(List<SmartSysCode> list) {
return sysCodeMapper.updateBatchSelective(list); return sysCodeMapper.updateBatchSelective(list);
} }
......
...@@ -4,6 +4,8 @@ import javax.annotation.Resource; ...@@ -4,6 +4,8 @@ import javax.annotation.Resource;
import java.util.List; import java.util.List;
import com.glsx.smart.dao.entity.SmartSysFile; import com.glsx.smart.dao.entity.SmartSysFile;
import com.glsx.smart.dao.mapper.SmartSysFileMapper; import com.glsx.smart.dao.mapper.SmartSysFileMapper;
import com.glsx.smart.exception.BusinessException;
import com.glsx.smart.exception.ResultEnum;
import com.glsx.smart.service.SmartSysFileService; import com.glsx.smart.service.SmartSysFileService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -22,28 +24,23 @@ public class SmartSysFileServiceImpl implements SmartSysFileService { ...@@ -22,28 +24,23 @@ public class SmartSysFileServiceImpl implements SmartSysFileService {
private SmartSysFileMapper smartSysFileMapper; private SmartSysFileMapper smartSysFileMapper;
@Override @Override
public int deleteByExample(SmartSysFile example) {
return smartSysFileMapper.deleteByExample(example);
}
@Override
public int deleteByPrimaryKey(Long id) { public int deleteByPrimaryKey(Long id) {
return smartSysFileMapper.deleteByPrimaryKey(id); return smartSysFileMapper.deleteByPrimaryKey(id);
} }
@Override @Override
public int insert(SmartSysFile record) { public int insertOrUpdate(SmartSysFile sysFile) {
return smartSysFileMapper.insert(record); if (sysFile.getId() == null) {
return smartSysFileMapper.insertSelective(sysFile);
} else {
SmartSysFile record = smartSysFileMapper.selectByPrimaryKey(
sysFile.getId());
if (record != null) {
return smartSysFileMapper.updateByPrimaryKeySelective(sysFile);
} else {
throw new BusinessException(ResultEnum.ID_NOT_FOUND);
} }
@Override
public int insertOrUpdate(SmartSysFile record) {
return smartSysFileMapper.insertOrUpdate(record);
} }
@Override
public int insertOrUpdateSelective(SmartSysFile record) {
return smartSysFileMapper.insertOrUpdateSelective(record);
} }
@Override @Override
...@@ -53,7 +50,7 @@ public class SmartSysFileServiceImpl implements SmartSysFileService { ...@@ -53,7 +50,7 @@ public class SmartSysFileServiceImpl implements SmartSysFileService {
@Override @Override
public List<SmartSysFile> selectByExample(SmartSysFile example) { public List<SmartSysFile> selectByExample(SmartSysFile example) {
return smartSysFileMapper.selectByExample(example); return smartSysFileMapper.select(example);
} }
@Override @Override
...@@ -62,31 +59,11 @@ public class SmartSysFileServiceImpl implements SmartSysFileService { ...@@ -62,31 +59,11 @@ public class SmartSysFileServiceImpl implements SmartSysFileService {
} }
@Override @Override
public int updateByExampleSelective(SmartSysFile record, SmartSysFile example) {
return smartSysFileMapper.updateByExampleSelective(record, example);
}
@Override
public int updateByExample(SmartSysFile record, SmartSysFile example) {
return smartSysFileMapper.updateByExample(record, example);
}
@Override
public int updateByPrimaryKeySelective(SmartSysFile record) { public int updateByPrimaryKeySelective(SmartSysFile record) {
return smartSysFileMapper.updateByPrimaryKeySelective(record); return smartSysFileMapper.updateByPrimaryKeySelective(record);
} }
@Override @Override
public int updateByPrimaryKey(SmartSysFile record) {
return smartSysFileMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<SmartSysFile> list) {
return smartSysFileMapper.updateBatch(list);
}
@Override
public int updateBatchSelective(List<SmartSysFile> list) { public int updateBatchSelective(List<SmartSysFile> list) {
return smartSysFileMapper.updateBatchSelective(list); return smartSysFileMapper.updateBatchSelective(list);
} }
......
...@@ -4,6 +4,8 @@ import javax.annotation.Resource; ...@@ -4,6 +4,8 @@ import javax.annotation.Resource;
import java.util.List; import java.util.List;
import com.glsx.smart.dao.entity.SmartTemplateParam; import com.glsx.smart.dao.entity.SmartTemplateParam;
import com.glsx.smart.dao.mapper.SmartTemplateParamMapper; import com.glsx.smart.dao.mapper.SmartTemplateParamMapper;
import com.glsx.smart.exception.BusinessException;
import com.glsx.smart.exception.ResultEnum;
import com.glsx.smart.service.SmartTemplateParamService; import com.glsx.smart.service.SmartTemplateParamService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -22,28 +24,23 @@ public class SmartTemplateParamServiceImpl implements SmartTemplateParamService ...@@ -22,28 +24,23 @@ public class SmartTemplateParamServiceImpl implements SmartTemplateParamService
private SmartTemplateParamMapper smartTemplateParamMapper; private SmartTemplateParamMapper smartTemplateParamMapper;
@Override @Override
public int deleteByExample(SmartTemplateParam example) {
return smartTemplateParamMapper.deleteByExample(example);
}
@Override
public int deleteByPrimaryKey(Long id) { public int deleteByPrimaryKey(Long id) {
return smartTemplateParamMapper.deleteByPrimaryKey(id); return smartTemplateParamMapper.deleteByPrimaryKey(id);
} }
@Override @Override
public int insert(SmartTemplateParam record) { public int insertOrUpdate(SmartTemplateParam templateParam) {
return smartTemplateParamMapper.insert(record); if (templateParam.getId() == null) {
return smartTemplateParamMapper.insertSelective(templateParam);
} else {
SmartTemplateParam record = smartTemplateParamMapper.selectByPrimaryKey(
templateParam.getId());
if (record != null) {
return smartTemplateParamMapper.updateByPrimaryKeySelective(templateParam);
} else {
throw new BusinessException(ResultEnum.ID_NOT_FOUND);
} }
@Override
public int insertOrUpdate(SmartTemplateParam record) {
return smartTemplateParamMapper.insertOrUpdate(record);
} }
@Override
public int insertOrUpdateSelective(SmartTemplateParam record) {
return smartTemplateParamMapper.insertOrUpdateSelective(record);
} }
@Override @Override
...@@ -53,7 +50,7 @@ public class SmartTemplateParamServiceImpl implements SmartTemplateParamService ...@@ -53,7 +50,7 @@ public class SmartTemplateParamServiceImpl implements SmartTemplateParamService
@Override @Override
public List<SmartTemplateParam> selectByExample(SmartTemplateParam example) { public List<SmartTemplateParam> selectByExample(SmartTemplateParam example) {
return smartTemplateParamMapper.selectByExample(example); return smartTemplateParamMapper.select(example);
} }
@Override @Override
...@@ -62,32 +59,11 @@ public class SmartTemplateParamServiceImpl implements SmartTemplateParamService ...@@ -62,32 +59,11 @@ public class SmartTemplateParamServiceImpl implements SmartTemplateParamService
} }
@Override @Override
public int updateByExampleSelective(SmartTemplateParam record,
SmartTemplateParam example) {
return smartTemplateParamMapper.updateByExampleSelective(record, example);
}
@Override
public int updateByExample(SmartTemplateParam record, SmartTemplateParam example) {
return smartTemplateParamMapper.updateByExample(record, example);
}
@Override
public int updateByPrimaryKeySelective(SmartTemplateParam record) { public int updateByPrimaryKeySelective(SmartTemplateParam record) {
return smartTemplateParamMapper.updateByPrimaryKeySelective(record); return smartTemplateParamMapper.updateByPrimaryKeySelective(record);
} }
@Override @Override
public int updateByPrimaryKey(SmartTemplateParam record) {
return smartTemplateParamMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<SmartTemplateParam> list) {
return smartTemplateParamMapper.updateBatch(list);
}
@Override
public int updateBatchSelective(List<SmartTemplateParam> list) { public int updateBatchSelective(List<SmartTemplateParam> list) {
return smartTemplateParamMapper.updateBatchSelective(list); return smartTemplateParamMapper.updateBatchSelective(list);
} }
......
...@@ -4,6 +4,8 @@ import javax.annotation.Resource; ...@@ -4,6 +4,8 @@ import javax.annotation.Resource;
import java.util.List; import java.util.List;
import com.glsx.smart.dao.entity.SmartUserRelation; import com.glsx.smart.dao.entity.SmartUserRelation;
import com.glsx.smart.dao.mapper.SmartUserRelationMapper; import com.glsx.smart.dao.mapper.SmartUserRelationMapper;
import com.glsx.smart.exception.BusinessException;
import com.glsx.smart.exception.ResultEnum;
import com.glsx.smart.service.SmartUserRelationService; import com.glsx.smart.service.SmartUserRelationService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -22,28 +24,23 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService { ...@@ -22,28 +24,23 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService {
private SmartUserRelationMapper smartUserRelationMapper; private SmartUserRelationMapper smartUserRelationMapper;
@Override @Override
public int deleteByExample(SmartUserRelation example) {
return smartUserRelationMapper.deleteByExample(example);
}
@Override
public int deleteByPrimaryKey(Long id) { public int deleteByPrimaryKey(Long id) {
return smartUserRelationMapper.deleteByPrimaryKey(id); return smartUserRelationMapper.deleteByPrimaryKey(id);
} }
@Override @Override
public int insert(SmartUserRelation record) { public int insertOrUpdate(SmartUserRelation userRelation) {
return smartUserRelationMapper.insert(record); if (userRelation.getId() == null) {
return smartUserRelationMapper.insertSelective(userRelation);
} else {
SmartUserRelation record = smartUserRelationMapper.selectByPrimaryKey(
userRelation.getId());
if (record != null) {
return smartUserRelationMapper.updateByPrimaryKeySelective(userRelation);
} else {
throw new BusinessException(ResultEnum.ID_NOT_FOUND);
} }
@Override
public int insertOrUpdate(SmartUserRelation record) {
return smartUserRelationMapper.insertOrUpdate(record);
} }
@Override
public int insertOrUpdateSelective(SmartUserRelation record) {
return smartUserRelationMapper.insertOrUpdateSelective(record);
} }
@Override @Override
...@@ -53,7 +50,7 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService { ...@@ -53,7 +50,7 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService {
@Override @Override
public List<SmartUserRelation> selectByExample(SmartUserRelation example) { public List<SmartUserRelation> selectByExample(SmartUserRelation example) {
return smartUserRelationMapper.selectByExample(example); return smartUserRelationMapper.select(example);
} }
@Override @Override
...@@ -62,32 +59,11 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService { ...@@ -62,32 +59,11 @@ public class SmartUserRelationServiceImpl implements SmartUserRelationService {
} }
@Override @Override
public int updateByExampleSelective(SmartUserRelation record,
SmartUserRelation example) {
return smartUserRelationMapper.updateByExampleSelective(record, example);
}
@Override
public int updateByExample(SmartUserRelation record, SmartUserRelation example) {
return smartUserRelationMapper.updateByExample(record, example);
}
@Override
public int updateByPrimaryKeySelective(SmartUserRelation record) { public int updateByPrimaryKeySelective(SmartUserRelation record) {
return smartUserRelationMapper.updateByPrimaryKeySelective(record); return smartUserRelationMapper.updateByPrimaryKeySelective(record);
} }
@Override @Override
public int updateByPrimaryKey(SmartUserRelation record) {
return smartUserRelationMapper.updateByPrimaryKey(record);
}
@Override
public int updateBatch(List<SmartUserRelation> list) {
return smartUserRelationMapper.updateBatch(list);
}
@Override
public int updateBatchSelective(List<SmartUserRelation> list) { public int updateBatchSelective(List<SmartUserRelation> list) {
return smartUserRelationMapper.updateBatchSelective(list); return smartUserRelationMapper.updateBatchSelective(list);
} }
......
...@@ -19,6 +19,6 @@ logging.path=/data/java_log/jetty/smartService/chejia-smart-service ...@@ -19,6 +19,6 @@ logging.path=/data/java_log/jetty/smartService/chejia-smart-service
# PageHelper # PageHelper
pagehelper.helperDialect=mysql pagehelper.helperDialect=mysql
pagehelper.reasonable=true #pagehelper.reasonable=true
pagehelper.supportMethodsArguments=true pagehelper.supportMethodsArguments=true
pagehelper.params=count=countSql pagehelper.params=count=countSql
...@@ -25,6 +25,30 @@ ...@@ -25,6 +25,30 @@
id, product_name, icon, type_id, shop_product_id, platform_key, platform_product_id, id, product_name, icon, type_id, shop_product_id, platform_key, platform_product_id,
network_key, `status`, remark, create_time, create_by, update_time, update_by network_key, `status`, remark, create_time, create_by, update_time, update_by
</sql> </sql>
<select id="getList" resultMap="BaseResultMap">
select sp.id, sp.product_name, sp.icon, sp.type_id, sp.shop_product_id, sp.platform_key,
sp.platform_product_id, sp.network_key, sp.status, sp.remark, sp.create_time,
sp.create_by, sp.update_time, sp.update_by,
spt.type_name typeName,
sscp.dict_value platformName,
sscn.dict_value networkName
from smart_product sp
left join smart_product_type spt on spt.id = sp.type_id
left join smart_sys_code sscp on sscp.dict_key = sp.platform_key
left join smart_sys_code sscn on sscn.dict_key = sp.network_key
<where>
<if test="startTime != null and startTime != ''">
</if>
<if test="endTime != null and endTime != ''">
</if>
</where>
order by sp.create_time desc
</select>
<update id="updateBatch" parameterType="java.util.List"> <update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated--> <!--@mbg.generated-->
update smart_product update smart_product
......
...@@ -24,6 +24,19 @@ ...@@ -24,6 +24,19 @@
id, dict_type, dict_key, dict_value, parent_key, sort, `status`, `level`, remark, id, dict_type, dict_key, dict_value, parent_key, sort, `status`, `level`, remark,
create_time, create_by, update_time, update_by create_time, create_by, update_time, update_by
</sql> </sql>
<select id="getList" resultMap="BaseResultMap">
select *
from smart_sys_code ssc
<where>
<if test="dictType != null and dictType != ''">
and ssc.dict_type = #{dictType,jdbcType=VARCHAR}
</if>
</where>
order by ssc.create_time desc, ssc.sort asc
</select>
<update id="updateBatch" parameterType="java.util.List"> <update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated--> <!--@mbg.generated-->
update smart_sys_code update smart_sys_code
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!