Browse Source

Merge branch 'dev_0814' of http://121.42.41.42:7070/r/esua-epdc-cloud into dev_0814

dev
qushutong 6 years ago
parent
commit
6063e3a9c4
  1. 6
      esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/entity/BaseEpdcEntity.java
  2. 5
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/Constant.java
  3. 4
      esua-epdc/epdc-gateway/pom.xml
  4. 13
      esua-epdc/epdc-module/epdc-user/epdc-user-client/pom.xml
  5. 54
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserTagDTO.java
  6. 12
      esua-epdc/epdc-module/epdc-user/epdc-user-server/pom.xml
  7. 102
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserTagController.java
  8. 33
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserTagDao.java
  9. 53
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserTagEntity.java
  10. 52
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/UserTagExcel.java
  11. 47
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/UserTagRedis.java
  12. 47
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserTagService.java
  13. 113
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserTagServiceImpl.java
  14. 19
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserTagDao.xml

6
esua-epdc/epdc-commons/epdc-commons-mybatis/src/main/java/com/elink/esua/epdc/commons/mybatis/entity/BaseEpdcEntity.java

@ -8,10 +8,7 @@
package com.elink.esua.epdc.commons.mybatis.entity; package com.elink.esua.epdc.commons.mybatis.entity;
import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
@ -68,6 +65,7 @@ public abstract class BaseEpdcEntity implements Serializable {
* 是否已删除(0-未删除1-已删除) * 是否已删除(0-未删除1-已删除)
*/ */
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
@TableLogic
private String delFlag; private String delFlag;
} }

5
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/Constant.java

@ -60,6 +60,11 @@ public interface Constant {
*/ */
String CREATE_DATE = "create_date"; String CREATE_DATE = "create_date";
/**
* 创建时间字段名
*/
String CREATED_TIME = "created_time";
/** /**
* 数据权限过滤 * 数据权限过滤
*/ */

4
esua-epdc/epdc-gateway/pom.xml

@ -101,8 +101,8 @@
<!-- <gateway.routes.epdc-issue-server.uri>http://127.0.0.1:9066</gateway.routes.epdc-issue-server.uri>--> <!-- <gateway.routes.epdc-issue-server.uri>http://127.0.0.1:9066</gateway.routes.epdc-issue-server.uri>-->
<gateway.routes.epdc-services-server.uri>lb://epdc-services-server</gateway.routes.epdc-services-server.uri> <gateway.routes.epdc-services-server.uri>lb://epdc-services-server</gateway.routes.epdc-services-server.uri>
<!-- <gateway.routes.epdc-services-server.uri>http://127.0.0.1:9067</gateway.routes.epdc-services-server.uri>--> <!-- <gateway.routes.epdc-services-server.uri>http://127.0.0.1:9067</gateway.routes.epdc-services-server.uri>-->
<gateway.routes.epdc-user-server.uri>lb://epdc-user-server</gateway.routes.epdc-user-server.uri> <!--<gateway.routes.epdc-user-server.uri>lb://epdc-user-server</gateway.routes.epdc-user-server.uri>-->
<!-- <gateway.routes.epdc-user-server.uri>http://127.0.0.1:9068</gateway.routes.epdc-user-server.uri>--> <gateway.routes.epdc-user-server.uri>http://127.0.0.1:9068</gateway.routes.epdc-user-server.uri>
<gateway.routes.epdc-demo-server.uri>lb://epdc-demo-server</gateway.routes.epdc-demo-server.uri> <gateway.routes.epdc-demo-server.uri>lb://epdc-demo-server</gateway.routes.epdc-demo-server.uri>
<!-- nacos --> <!-- nacos -->
<nacos.register-enabled>false</nacos.register-enabled> <nacos.register-enabled>false</nacos.register-enabled>

13
esua-epdc/epdc-module/epdc-user/epdc-user-client/pom.xml

@ -7,9 +7,22 @@
<groupId>com.esua.epdc</groupId> <groupId>com.esua.epdc</groupId>
<version>1.0.0</version> <version>1.0.0</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>epdc-user-client</artifactId> <artifactId>epdc-user-client</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>com.esua.epdc</groupId>
<artifactId>epdc-commons-tools</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
</build>
</project> </project>

54
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserTagDTO.java

@ -0,0 +1,54 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 用户标签表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@Data
public class UserTagDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String id;
private String tagName;
private String tagDesc;
private Integer revision;
private String createdBy;
private Date createdTime;
private String updatedBy;
private Date updatedTime;
private String delFlag;
}

12
esua-epdc/epdc-module/epdc-user/epdc-user-server/pom.xml

@ -86,10 +86,10 @@
<spring.redis.password>elink@888</spring.redis.password> <spring.redis.password>elink@888</spring.redis.password>
<spring.datasource.druid.url> <spring.datasource.druid.url>
<![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_job?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]> <![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url> </spring.datasource.druid.url>
<spring.datasource.druid.username>epdc</spring.datasource.druid.username> <spring.datasource.druid.username>epdc</spring.datasource.druid.username>
<spring.datasource.druid.password>elink888</spring.datasource.druid.password> <spring.datasource.druid.password>elink833066</spring.datasource.druid.password>
<nacos.register-enabled>false</nacos.register-enabled> <nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr> <nacos.server-addr>47.104.224.45:8848</nacos.server-addr>
@ -109,10 +109,10 @@
<spring.redis.password>elink@888</spring.redis.password> <spring.redis.password>elink@888</spring.redis.password>
<spring.datasource.druid.url> <spring.datasource.druid.url>
<![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_job?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]> <![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url> </spring.datasource.druid.url>
<spring.datasource.druid.username>epdc</spring.datasource.druid.username> <spring.datasource.druid.username>epdc</spring.datasource.druid.username>
<spring.datasource.druid.password>elink888</spring.datasource.druid.password> <spring.datasource.druid.password>elink833066</spring.datasource.druid.password>
<nacos.register-enabled>false</nacos.register-enabled> <nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr> <nacos.server-addr>47.104.224.45:8848</nacos.server-addr>
@ -132,10 +132,10 @@
<spring.redis.password>elink@888</spring.redis.password> <spring.redis.password>elink@888</spring.redis.password>
<spring.datasource.druid.url> <spring.datasource.druid.url>
<![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_job?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]> <![CDATA[jdbc:mysql://47.104.224.45:3308/esua_epdc_user?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</spring.datasource.druid.url> </spring.datasource.druid.url>
<spring.datasource.druid.username>epdc</spring.datasource.druid.username> <spring.datasource.druid.username>epdc</spring.datasource.druid.username>
<spring.datasource.druid.password>elink888</spring.datasource.druid.password> <spring.datasource.druid.password>elink833066</spring.datasource.druid.password>
<nacos.register-enabled>false</nacos.register-enabled> <nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr> <nacos.server-addr>47.104.224.45:8848</nacos.server-addr>

102
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserTagController.java

@ -0,0 +1,102 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.dto.UserTagDTO;
import com.elink.esua.epdc.excel.UserTagExcel;
import com.elink.esua.epdc.service.UserTagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 用户标签表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@RestController
@RequestMapping("/usertag")
public class UserTagController {
@Autowired
private UserTagService userTagService;
@GetMapping("page")
public Result<PageData<UserTagDTO>> page(@RequestParam Map<String, Object> params){
PageData<UserTagDTO> page = userTagService.page(params);
return new Result<PageData<UserTagDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<UserTagDTO> get(@PathVariable("id") String id){
UserTagDTO data = userTagService.get(id);
return new Result<UserTagDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody UserTagDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
userTagService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody UserTagDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
userTagService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
userTagService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<UserTagDTO> list = userTagService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, UserTagExcel.class);
}
}

33
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserTagDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.entity.UserTagEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 用户标签表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@Mapper
public interface UserTagDao extends BaseDao<UserTagEntity> {
}

53
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserTagEntity.java

@ -0,0 +1,53 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEntity;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 用户标签表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_user_tag")
public class UserTagEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 标签名
*/
private String tagName;
/**
* 标签描述
*/
private String tagDesc;
}

52
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/UserTagExcel.java

@ -0,0 +1,52 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 用户标签表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@Data
public class UserTagExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "标签名")
private String tagName;
@Excel(name = "标签描述")
private String tagDesc;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
@Excel(name = "删除标记")
private String delFlag;
}

47
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/UserTagRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 用户标签表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@Component
public class UserTagRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

47
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserTagService.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.UserTagDTO;
import com.elink.esua.epdc.entity.UserTagEntity;
import java.util.List;
import java.util.Map;
/**
* 用户标签表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
public interface UserTagService extends BaseService<UserTagEntity> {
PageData<UserTagDTO> page(Map<String, Object> params);
List<UserTagDTO> list(Map<String, Object> params);
UserTagDTO get(String id);
void save(UserTagDTO dto);
void update(UserTagDTO dto);
void delete(String[] ids);
}

113
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserTagServiceImpl.java

@ -0,0 +1,113 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.enums.DelFlagEnum;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.Constant;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.dao.UserTagDao;
import com.elink.esua.epdc.dto.UserTagDTO;
import com.elink.esua.epdc.entity.UserTagEntity;
import com.elink.esua.epdc.redis.UserTagRedis;
import com.elink.esua.epdc.service.UserTagService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 用户标签表
*
* @author Mark sunlightcs@gmail.com
* @since v1.0.0 2019-09-02
*/
@Service
public class UserTagServiceImpl extends BaseServiceImpl<UserTagDao, UserTagEntity> implements UserTagService {
@Autowired
private UserTagRedis userTagRedis;
@Override
public PageData<UserTagDTO> page(Map<String, Object> params) {
IPage<UserTagEntity> page = baseDao.selectPage(
getPage(params, Constant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, UserTagDTO.class);
}
@Override
public List<UserTagDTO> list(Map<String, Object> params) {
List<UserTagEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, UserTagDTO.class);
}
private QueryWrapper<UserTagEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
QueryWrapper<UserTagEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
//wrapper.eq(Constant.DEL_FLAG, DelFlagEnum.NORMAL.value());
return wrapper;
}
@Override
public UserTagDTO get(String id) {
UserTagEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, UserTagDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(UserTagDTO dto) {
UserTagEntity entity = ConvertUtils.sourceToTarget(dto, UserTagEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(UserTagDTO dto) {
UserTagEntity entity = ConvertUtils.sourceToTarget(dto, UserTagEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
//逻辑删除
//logicDelete(ids, UserTagEntity.class);
//物理删除
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

19
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserTagDao.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.UserTagDao">
<resultMap type="com.elink.esua.epdc.entity.UserTagEntity" id="userTagMap">
<result property="id" column="ID"/>
<result property="tagName" column="TAG_NAME"/>
<result property="tagDesc" column="TAG_DESC"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="delFlag" column="DEL_FLAG"/>
</resultMap>
</mapper>
Loading…
Cancel
Save