qushutong 6 years ago
parent
commit
2bde21ddac
  1. 81
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserWxFormIdDTO.java
  2. 20
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcUserWxFormIdFormDTO.java
  3. 23
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcUserWxFormIdSaveFormDTO.java
  4. 101
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAooUserWxFormIdController.java
  5. 94
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserWxFormIdController.java
  6. 41
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserWxFormIdDao.java
  7. 51
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserWxFormIdEntity.java
  8. 62
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/UserWxFormIdExcel.java
  9. 47
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/redis/UserWxFormIdRedis.java
  10. 104
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserWxFormIdService.java
  11. 107
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserWxFormIdServiceImpl.java
  12. 29
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserWxFormIdDao.xml

81
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/UserWxFormIdDTO.java

@ -0,0 +1,81 @@
/**
* 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 qu qu@elink-cn.com
* @since v1.0.0 2019-09-26
*/
@Data
public class UserWxFormIdDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 微信openId
*/
private String wxOpenId;
/**
* 微信formId
*/
private String wxFormId;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
/**
* 删除标记
*/
private String delFlag;
}

20
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcUserWxFormIdFormDTO.java

@ -0,0 +1,20 @@
package com.elink.esua.epdc.dto.epdc.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @author: qushutong
* @Date: 2019/9/26 14:14
* @Description: 发送完消息之后删除
*/
@Data
public class EpdcUserWxFormIdFormDTO implements Serializable {
private static final long serialVersionUID = 1708791774502867360L;
@NotBlank(message = "id不能为空")
private String id;
}

23
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/dto/epdc/form/EpdcUserWxFormIdSaveFormDTO.java

@ -0,0 +1,23 @@
package com.elink.esua.epdc.dto.epdc.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @author: qushutong
* @Date: 2019/9/26 14:14
* @Description: 保存formid
*/
@Data
public class EpdcUserWxFormIdSaveFormDTO implements Serializable {
private static final long serialVersionUID = 5579624182759030906L;
@NotBlank(message = "wxOpenId不能为空")
private String wxOpenId;
@NotBlank(message = "wxFormId不能为空")
private String wxFormId;
}

101
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAooUserWxFormIdController.java

@ -0,0 +1,101 @@
/**
* 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.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.dto.UserWxFormIdDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserWxFormIdFormDTO;
import com.elink.esua.epdc.dto.epdc.form.EpdcUserWxFormIdSaveFormDTO;
import com.elink.esua.epdc.excel.UserWxFormIdExcel;
import com.elink.esua.epdc.service.UserWxFormIdService;
import org.springframework.beans.BeanUtils;
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 qu qu@elink-cn.com
* @since v1.0.0 2019-09-26
*/
@RestController
@RequestMapping("wxformid")
public class EpdcAooUserWxFormIdController {
@Autowired
private UserWxFormIdService userWxFormIdService;
/***
* 完成推送之后删除用过的formid
* @param dto
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author qushutong
* @date 2019/9/26 14:15
*/
@PostMapping("deleteById")
public Result deleteById(@RequestBody EpdcUserWxFormIdFormDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
userWxFormIdService.deleteById(dto.getId());
return new Result();
}
/***
* 新增一跳
* @param dto
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author qushutong
* @date 2019/9/26 14:25
*/
@PostMapping("save")
public Result delete(@RequestBody EpdcUserWxFormIdSaveFormDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
UserWxFormIdDTO userWxFormIdDTO = new UserWxFormIdDTO();
BeanUtils.copyProperties(dto, userWxFormIdDTO);
userWxFormIdService.save(userWxFormIdDTO);
return new Result();
}
/***
* 查出最新一条记录
* @param openId
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.UserWxFormIdDTO>
* @author qushutong
* @date 2019/9/26 14:11
*/
@GetMapping("getByOpenId/{openId}")
public Result<UserWxFormIdDTO> get(@PathVariable("openId") String openId) {
UserWxFormIdDTO data = userWxFormIdService.getByOpenId(openId);
return new Result<UserWxFormIdDTO>().ok(data);
}
}

94
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/UserWxFormIdController.java

@ -0,0 +1,94 @@
/**
* 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.UserWxFormIdDTO;
import com.elink.esua.epdc.excel.UserWxFormIdExcel;
import com.elink.esua.epdc.service.UserWxFormIdService;
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 qu qu@elink-cn.com
* @since v1.0.0 2019-09-26
*/
@RestController
@RequestMapping("userwxformid")
public class UserWxFormIdController {
@Autowired
private UserWxFormIdService userWxFormIdService;
@GetMapping("page")
public Result<PageData<UserWxFormIdDTO>> page(@RequestParam Map<String, Object> params){
PageData<UserWxFormIdDTO> page = userWxFormIdService.page(params);
return new Result<PageData<UserWxFormIdDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<UserWxFormIdDTO> get(@PathVariable("id") String id){
UserWxFormIdDTO data = userWxFormIdService.get(id);
return new Result<UserWxFormIdDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody UserWxFormIdDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
userWxFormIdService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody UserWxFormIdDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
userWxFormIdService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
userWxFormIdService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<UserWxFormIdDTO> list = userWxFormIdService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, UserWxFormIdExcel.class);
}
}

41
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/UserWxFormIdDao.java

@ -0,0 +1,41 @@
/**
* 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.dto.UserWxFormIdDTO;
import com.elink.esua.epdc.entity.UserWxFormIdEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 用户标签表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-09-26
*/
@Mapper
public interface UserWxFormIdDao extends BaseDao<UserWxFormIdEntity> {
/***
* 获取最新一条formid
* @param openId
* @return com.elink.esua.epdc.dto.UserWxFormIdDTO
* @author qushutong
* @date 2019/9/26 14:05
*/
UserWxFormIdDTO getByOpenId(String openId);
}

51
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/entity/UserWxFormIdEntity.java

@ -0,0 +1,51 @@
/**
* 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.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 用户标签表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-09-26
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_user_wx_form_id")
public class UserWxFormIdEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 微信openId
*/
private String wxOpenId;
/**
* 微信formId
*/
private String wxFormId;
}

62
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/UserWxFormIdExcel.java

@ -0,0 +1,62 @@
/**
* 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 qu qu@elink-cn.com
* @since v1.0.0 2019-09-26
*/
@Data
public class UserWxFormIdExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "微信openId")
private String wxOpenId;
@Excel(name = "微信formId")
private String wxFormId;
@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/UserWxFormIdRedis.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 qu qu@elink-cn.com
* @since v1.0.0 2019-09-26
*/
@Component
public class UserWxFormIdRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

104
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/UserWxFormIdService.java

@ -0,0 +1,104 @@
/**
* 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.UserWxFormIdDTO;
import com.elink.esua.epdc.entity.UserWxFormIdEntity;
import java.util.List;
import java.util.Map;
/**
* 用户标签表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-09-26
*/
public interface UserWxFormIdService extends BaseService<UserWxFormIdEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<UserWxFormIdDTO>
* @author generator
* @date 2019-09-26
*/
PageData<UserWxFormIdDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<UserWxFormIdDTO>
* @author generator
* @date 2019-09-26
*/
List<UserWxFormIdDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return UserWxFormIdDTO
* @author generator
* @date 2019-09-26
*/
UserWxFormIdDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2019-09-26
*/
void save(UserWxFormIdDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2019-09-26
*/
void update(UserWxFormIdDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2019-09-26
*/
void delete(String[] ids);
/***
* 获取最新一条formid
* @param openId
* @return com.elink.esua.epdc.dto.UserWxFormIdDTO
* @author qushutong
* @date 2019/9/26 14:03
*/
UserWxFormIdDTO getByOpenId(String openId);
}

107
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserWxFormIdServiceImpl.java

@ -0,0 +1,107 @@
/**
* 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.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.dao.UserWxFormIdDao;
import com.elink.esua.epdc.dto.UserWxFormIdDTO;
import com.elink.esua.epdc.entity.UserWxFormIdEntity;
import com.elink.esua.epdc.redis.UserWxFormIdRedis;
import com.elink.esua.epdc.service.UserWxFormIdService;
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 qu qu@elink-cn.com
* @since v1.0.0 2019-09-26
*/
@Service
public class UserWxFormIdServiceImpl extends BaseServiceImpl<UserWxFormIdDao, UserWxFormIdEntity> implements UserWxFormIdService {
@Override
public PageData<UserWxFormIdDTO> page(Map<String, Object> params) {
IPage<UserWxFormIdEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, UserWxFormIdDTO.class);
}
@Override
public List<UserWxFormIdDTO> list(Map<String, Object> params) {
List<UserWxFormIdEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, UserWxFormIdDTO.class);
}
private QueryWrapper<UserWxFormIdEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<UserWxFormIdEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public UserWxFormIdDTO get(String id) {
UserWxFormIdEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, UserWxFormIdDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(UserWxFormIdDTO dto) {
UserWxFormIdEntity entity = ConvertUtils.sourceToTarget(dto, UserWxFormIdEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(UserWxFormIdDTO dto) {
UserWxFormIdEntity entity = ConvertUtils.sourceToTarget(dto, UserWxFormIdEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public UserWxFormIdDTO getByOpenId(String openId) {
return baseDao.getByOpenId(openId);
}
}

29
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserWxFormIdDao.xml

@ -0,0 +1,29 @@
<?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.UserWxFormIdDao">
<resultMap type="com.elink.esua.epdc.entity.UserWxFormIdEntity" id="userWxFormIdMap">
<result property="id" column="ID"/>
<result property="wxOpenId" column="WX_OPEN_ID"/>
<result property="wxFormId" column="WX_FORM_ID"/>
<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>
<select id="getByOpenId" resultType="com.elink.esua.epdc.dao.UserWxFormIdDao">
SELECT
*
FROM
epdc_user_wx_form_id ei
WHERE
ei.WX_OPEN_ID = #{openId}
ORDER BY
ei.CREATED_TIME DESC
LIMIT 1
</select>
</mapper>
Loading…
Cancel
Save