Browse Source

负担量表的增改查,引导页查询修改

master
ma 4 years ago
parent
commit
73bce8a864
  1. 54
      src/main/java/com/ccsens/yanyuan/api/UserGuideController.java
  2. 66
      src/main/java/com/ccsens/yanyuan/api/ZaritController.java
  3. 19
      src/main/java/com/ccsens/yanyuan/bean/dto/GuideDto.java
  4. 39
      src/main/java/com/ccsens/yanyuan/bean/dto/ZaritDto.java
  5. 11
      src/main/java/com/ccsens/yanyuan/bean/po/Care.java
  6. 60
      src/main/java/com/ccsens/yanyuan/bean/po/CareExample.java
  7. 106
      src/main/java/com/ccsens/yanyuan/bean/po/UserGuide.java
  8. 691
      src/main/java/com/ccsens/yanyuan/bean/po/UserGuideExample.java
  9. 19
      src/main/java/com/ccsens/yanyuan/bean/vo/GuideVo.java
  10. 38
      src/main/java/com/ccsens/yanyuan/bean/vo/ZaritVo.java
  11. 30
      src/main/java/com/ccsens/yanyuan/persist/dao/CareDao.java
  12. 8
      src/main/java/com/ccsens/yanyuan/persist/dao/FamilyDao.java
  13. 21
      src/main/java/com/ccsens/yanyuan/persist/dao/UserGuideDao.java
  14. 30
      src/main/java/com/ccsens/yanyuan/persist/mapper/UserGuideMapper.java
  15. 24
      src/main/java/com/ccsens/yanyuan/service/IUserGuideService.java
  16. 36
      src/main/java/com/ccsens/yanyuan/service/IZaritService.java
  17. 45
      src/main/java/com/ccsens/yanyuan/service/UserGuideService.java
  18. 67
      src/main/java/com/ccsens/yanyuan/service/ZaritService.java
  19. 51
      src/main/resources/mapper_dao/CareDao.xml
  20. 19
      src/main/resources/mapper_dao/FamilyDao.xml
  21. 17
      src/main/resources/mapper_dao/UserGuideDao.xml
  22. 43
      src/main/resources/mapper_raw/CareMapper.xml
  23. 258
      src/main/resources/mapper_raw/UserGuideMapper.xml
  24. 3
      src/main/resources/mbg.xml

54
src/main/java/com/ccsens/yanyuan/api/UserGuideController.java

@ -0,0 +1,54 @@
package com.ccsens.yanyuan.api;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import com.ccsens.yanyuan.bean.dto.GuideDto;
import com.ccsens.yanyuan.bean.dto.ZaritDto;
import com.ccsens.yanyuan.bean.vo.GuideVo;
import com.ccsens.yanyuan.bean.vo.ZaritVo;
import com.ccsens.yanyuan.service.IUserGuideService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* @author AUSU
*/
@Api(tags = "受训连者(老人)" )
@Slf4j
@RestController
@RequestMapping("/guide")
public class UserGuideController {
@Resource
private IUserGuideService userGuideService;
@MustLogin
@ApiOperation(value = "查询是否显示引导页", notes = "查询是否显示引导页")
@RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<GuideVo.GuideStatus> queryGuide(@ApiParam @Validated @RequestBody QueryDto<GuideDto.QueryGuide> params) throws Exception{
log.info("查询是否显示引导页:{}",params);
GuideVo.GuideStatus guideStatus = userGuideService.queryGuide(params.getParam(),params.getUserId());
log.info("查询是否显示引导页结束{}",guideStatus);
return JsonResponse.newInstance().ok(guideStatus);
}
@MustLogin
@ApiOperation(value = "修改引导页状态", notes = "修改引导页状态")
@RequestMapping(value = "/update", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse updateGuide(@ApiParam @Validated @RequestBody QueryDto<GuideDto.QueryGuide> params) throws Exception{
log.info("修改引导页状态:{}",params);
userGuideService.updateGuide(params.getParam(),params.getUserId());
log.info("修改引导页状态结束");
return JsonResponse.newInstance().ok();
}
}

66
src/main/java/com/ccsens/yanyuan/api/ZaritController.java

@ -0,0 +1,66 @@
package com.ccsens.yanyuan.api;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.util.CodeError;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import com.ccsens.yanyuan.bean.dto.MedicineDto;
import com.ccsens.yanyuan.bean.dto.ZaritDto;
import com.ccsens.yanyuan.bean.vo.ZaritVo;
import com.ccsens.yanyuan.service.IZaritService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* @author AUSU
*/
@Api(tags = "Zarit照顾者负担量表" , description = "ZaritController | ")
@Slf4j
@RestController
@RequestMapping("/zarit")
public class ZaritController {
@Resource
private IZaritService zaritService;
@MustLogin
@ApiOperation(value = "查询照顾者负担表列表", notes = "查询照顾者负担表列表")
@RequestMapping(value = "/queryList", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ZaritVo.ZaritInfo>> queryList(@ApiParam @Validated @RequestBody QueryDto<ZaritDto.QueryZarit> params) throws Exception{
log.info("查询照顾者负担表列表:{}",params);
List<ZaritVo.ZaritInfo> zaritInfoList = zaritService.queryList(params.getParam(),params.getUserId());
log.info("查询照顾者负担表列表结束{}",zaritInfoList);
return JsonResponse.newInstance().ok(zaritInfoList);
}
@MustLogin
@ApiOperation(value = "查询负担量表历史记录", notes = "查询负担量表历史记录")
@RequestMapping(value = "/queryHistory", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<ZaritVo.ZaritInfo> queryHistory(@ApiParam @Validated @RequestBody QueryDto<ZaritDto.QueryZarit> params) throws Exception{
log.info("查询负担量表历史记录:{}",params);
ZaritVo.ZaritInfo zaritInfo = zaritService.queryHistory(params.getParam(),params.getUserId());
log.info("查询负担量表历史记录结束{}",zaritInfo);
return JsonResponse.newInstance().ok(zaritInfo);
}
@MustLogin
@ApiOperation(value = "添加负担量表", notes = "添加负担量表")
@RequestMapping(value = "/add", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<Long> addZarit(@ApiParam @Validated @RequestBody QueryDto<ZaritDto.AddZarit> params) throws Exception{
log.info("添加负担量表:{}",params);
Long zaritId = zaritService.addZarit(params.getParam(),params.getUserId());
log.info("添加负担量表结束{}",zaritId);
return JsonResponse.newInstance().ok(zaritId);
}
}

19
src/main/java/com/ccsens/yanyuan/bean/dto/GuideDto.java

@ -0,0 +1,19 @@
package com.ccsens.yanyuan.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author AUSU
*/
public class GuideDto {
@Data
@ApiModel("查询引导页-入参")
public static class QueryGuide {
@ApiModelProperty("模板code")
private String templateCode;
}
}

39
src/main/java/com/ccsens/yanyuan/bean/dto/ZaritDto.java

@ -0,0 +1,39 @@
package com.ccsens.yanyuan.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author AUSU
*/
public class ZaritDto {
@Data
@ApiModel("查询负担量表-入参")
public static class QueryZarit {
@ApiModelProperty("项目id(使用者id)")
private Long projectId;
}
@Data
@ApiModel("添加负担量表-入参")
public static class AddZarit {
@ApiModelProperty("项目id(使用者id)")
private Long projectId;
@ApiModelProperty("照顾人姓名")
private String careName;
@ApiModelProperty(" 1:男 2:女")
private Byte careSex;
@ApiModelProperty("照顾人年龄")
private String careAge;
@ApiModelProperty("照顾人工作")
private String jobTitle;
@ApiModelProperty("教育程度")
private String educateLevel;
@ApiModelProperty("照顾时间")
private String carePeriod;
@ApiModelProperty("关系")
private String careRelation;
}
}

11
src/main/java/com/ccsens/yanyuan/bean/po/Care.java

@ -10,6 +10,8 @@ public class Care implements Serializable {
private Long keyUserId;
private Long recordUserId;
private String userId;
private String careName;
@ -64,6 +66,14 @@ public class Care implements Serializable {
this.keyUserId = keyUserId;
}
public Long getRecordUserId() {
return recordUserId;
}
public void setRecordUserId(Long recordUserId) {
this.recordUserId = recordUserId;
}
public String getUserId() {
return userId;
}
@ -185,6 +195,7 @@ public class Care implements Serializable {
sb.append(", id=").append(id);
sb.append(", keyId=").append(keyId);
sb.append(", keyUserId=").append(keyUserId);
sb.append(", recordUserId=").append(recordUserId);
sb.append(", userId=").append(userId);
sb.append(", careName=").append(careName);
sb.append(", careSex=").append(careSex);

60
src/main/java/com/ccsens/yanyuan/bean/po/CareExample.java

@ -295,6 +295,66 @@ public class CareExample {
return (Criteria) this;
}
public Criteria andRecordUserIdIsNull() {
addCriterion("record_user_id is null");
return (Criteria) this;
}
public Criteria andRecordUserIdIsNotNull() {
addCriterion("record_user_id is not null");
return (Criteria) this;
}
public Criteria andRecordUserIdEqualTo(Long value) {
addCriterion("record_user_id =", value, "recordUserId");
return (Criteria) this;
}
public Criteria andRecordUserIdNotEqualTo(Long value) {
addCriterion("record_user_id <>", value, "recordUserId");
return (Criteria) this;
}
public Criteria andRecordUserIdGreaterThan(Long value) {
addCriterion("record_user_id >", value, "recordUserId");
return (Criteria) this;
}
public Criteria andRecordUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("record_user_id >=", value, "recordUserId");
return (Criteria) this;
}
public Criteria andRecordUserIdLessThan(Long value) {
addCriterion("record_user_id <", value, "recordUserId");
return (Criteria) this;
}
public Criteria andRecordUserIdLessThanOrEqualTo(Long value) {
addCriterion("record_user_id <=", value, "recordUserId");
return (Criteria) this;
}
public Criteria andRecordUserIdIn(List<Long> values) {
addCriterion("record_user_id in", values, "recordUserId");
return (Criteria) this;
}
public Criteria andRecordUserIdNotIn(List<Long> values) {
addCriterion("record_user_id not in", values, "recordUserId");
return (Criteria) this;
}
public Criteria andRecordUserIdBetween(Long value1, Long value2) {
addCriterion("record_user_id between", value1, value2, "recordUserId");
return (Criteria) this;
}
public Criteria andRecordUserIdNotBetween(Long value1, Long value2) {
addCriterion("record_user_id not between", value1, value2, "recordUserId");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;

106
src/main/java/com/ccsens/yanyuan/bean/po/UserGuide.java

@ -0,0 +1,106 @@
package com.ccsens.yanyuan.bean.po;
import java.io.Serializable;
import java.util.Date;
public class UserGuide implements Serializable {
private Long id;
private Long userId;
private String templateCode;
private Integer guideTimes;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getTemplateCode() {
return templateCode;
}
public void setTemplateCode(String templateCode) {
this.templateCode = templateCode == null ? null : templateCode.trim();
}
public Integer getGuideTimes() {
return guideTimes;
}
public void setGuideTimes(Integer guideTimes) {
this.guideTimes = guideTimes;
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", userId=").append(userId);
sb.append(", templateCode=").append(templateCode);
sb.append(", guideTimes=").append(guideTimes);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

691
src/main/java/com/ccsens/yanyuan/bean/po/UserGuideExample.java

@ -0,0 +1,691 @@
package com.ccsens.yanyuan.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class UserGuideExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public UserGuideExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andTemplateCodeIsNull() {
addCriterion("template_code is null");
return (Criteria) this;
}
public Criteria andTemplateCodeIsNotNull() {
addCriterion("template_code is not null");
return (Criteria) this;
}
public Criteria andTemplateCodeEqualTo(String value) {
addCriterion("template_code =", value, "templateCode");
return (Criteria) this;
}
public Criteria andTemplateCodeNotEqualTo(String value) {
addCriterion("template_code <>", value, "templateCode");
return (Criteria) this;
}
public Criteria andTemplateCodeGreaterThan(String value) {
addCriterion("template_code >", value, "templateCode");
return (Criteria) this;
}
public Criteria andTemplateCodeGreaterThanOrEqualTo(String value) {
addCriterion("template_code >=", value, "templateCode");
return (Criteria) this;
}
public Criteria andTemplateCodeLessThan(String value) {
addCriterion("template_code <", value, "templateCode");
return (Criteria) this;
}
public Criteria andTemplateCodeLessThanOrEqualTo(String value) {
addCriterion("template_code <=", value, "templateCode");
return (Criteria) this;
}
public Criteria andTemplateCodeLike(String value) {
addCriterion("template_code like", value, "templateCode");
return (Criteria) this;
}
public Criteria andTemplateCodeNotLike(String value) {
addCriterion("template_code not like", value, "templateCode");
return (Criteria) this;
}
public Criteria andTemplateCodeIn(List<String> values) {
addCriterion("template_code in", values, "templateCode");
return (Criteria) this;
}
public Criteria andTemplateCodeNotIn(List<String> values) {
addCriterion("template_code not in", values, "templateCode");
return (Criteria) this;
}
public Criteria andTemplateCodeBetween(String value1, String value2) {
addCriterion("template_code between", value1, value2, "templateCode");
return (Criteria) this;
}
public Criteria andTemplateCodeNotBetween(String value1, String value2) {
addCriterion("template_code not between", value1, value2, "templateCode");
return (Criteria) this;
}
public Criteria andGuideTimesIsNull() {
addCriterion("guide_times is null");
return (Criteria) this;
}
public Criteria andGuideTimesIsNotNull() {
addCriterion("guide_times is not null");
return (Criteria) this;
}
public Criteria andGuideTimesEqualTo(Integer value) {
addCriterion("guide_times =", value, "guideTimes");
return (Criteria) this;
}
public Criteria andGuideTimesNotEqualTo(Integer value) {
addCriterion("guide_times <>", value, "guideTimes");
return (Criteria) this;
}
public Criteria andGuideTimesGreaterThan(Integer value) {
addCriterion("guide_times >", value, "guideTimes");
return (Criteria) this;
}
public Criteria andGuideTimesGreaterThanOrEqualTo(Integer value) {
addCriterion("guide_times >=", value, "guideTimes");
return (Criteria) this;
}
public Criteria andGuideTimesLessThan(Integer value) {
addCriterion("guide_times <", value, "guideTimes");
return (Criteria) this;
}
public Criteria andGuideTimesLessThanOrEqualTo(Integer value) {
addCriterion("guide_times <=", value, "guideTimes");
return (Criteria) this;
}
public Criteria andGuideTimesIn(List<Integer> values) {
addCriterion("guide_times in", values, "guideTimes");
return (Criteria) this;
}
public Criteria andGuideTimesNotIn(List<Integer> values) {
addCriterion("guide_times not in", values, "guideTimes");
return (Criteria) this;
}
public Criteria andGuideTimesBetween(Integer value1, Integer value2) {
addCriterion("guide_times between", value1, value2, "guideTimes");
return (Criteria) this;
}
public Criteria andGuideTimesNotBetween(Integer value1, Integer value2) {
addCriterion("guide_times not between", value1, value2, "guideTimes");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

19
src/main/java/com/ccsens/yanyuan/bean/vo/GuideVo.java

@ -0,0 +1,19 @@
package com.ccsens.yanyuan.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author AUSU
*/
public class GuideVo {
@Data
@ApiModel("引导页是否可用-返参")
public static class GuideStatus {
@ApiModelProperty("0-不显示,1-显示")
private Byte status;
}
}

38
src/main/java/com/ccsens/yanyuan/bean/vo/ZaritVo.java

@ -0,0 +1,38 @@
package com.ccsens.yanyuan.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author AUSU
*/
public class ZaritVo {
@Data
@ApiModel("zarit信息列表-返参")
public static class ZaritInfo{
@ApiModelProperty("照顾者负担量表id")
private Long id;
@ApiModelProperty("用户ID")
private Long keyUserId;
@ApiModelProperty("填写人userId")
private Long recordUserId;
@ApiModelProperty("照顾人姓名")
private String careName;
@ApiModelProperty(" 1:男 2:女")
private Byte careSex;
@ApiModelProperty("照顾人年龄")
private String careAge;
@ApiModelProperty("照顾人工作")
private String jobTitle;
@ApiModelProperty("教育程度")
private String educateLevel;
@ApiModelProperty("照顾时间")
private String carePeriod;
@ApiModelProperty("关系")
private String careRelation;
@ApiModelProperty("照顾得分")
private String zaritState;
}
}

30
src/main/java/com/ccsens/yanyuan/persist/dao/CareDao.java

@ -0,0 +1,30 @@
package com.ccsens.yanyuan.persist.dao;
import com.ccsens.yanyuan.bean.vo.ZaritVo;
import com.ccsens.yanyuan.persist.mapper.CareMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author AUSU
*/
@Repository
public interface CareDao extends CareMapper {
/**
* 查询使用者负担量表的列表
* @param projectId 使用者userId
* @return 负担量表的列表
*/
List<ZaritVo.ZaritInfo> queryList(@Param("projectId") Long projectId);
/**
* 查询当前用户负担量表历史记录
* @param projectId 使用者id
* @param userId 当前用户id
* @return 当前用户负担量表历史记录
*/
ZaritVo.ZaritInfo queryHistory(@Param("projectId")Long projectId,@Param("userId") Long userId);
}

8
src/main/java/com/ccsens/yanyuan/persist/dao/FamilyDao.java

@ -1,9 +1,17 @@
package com.ccsens.yanyuan.persist.dao;
import com.ccsens.yanyuan.bean.vo.ZaritVo;
import com.ccsens.yanyuan.persist.mapper.UserFamilyMapper;
import org.apache.ibatis.annotations.Param;
/**
* @author whj
*/
public interface FamilyDao extends UserFamilyMapper {
/**
* 查询家庭成员信息
* @param userId 当前用户id
* @return 家庭成员信息
*/
ZaritVo.ZaritInfo queryByUserId(@Param("userId") Long userId);
}

21
src/main/java/com/ccsens/yanyuan/persist/dao/UserGuideDao.java

@ -0,0 +1,21 @@
package com.ccsens.yanyuan.persist.dao;
import com.ccsens.yanyuan.bean.vo.GuideVo;
import com.ccsens.yanyuan.persist.mapper.UserGuideMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
* @author AUSU
*/
@Repository
public interface UserGuideDao extends UserGuideMapper {
/**
* 查询是否展示引导页
* @param templateCode 模板code
* @param userId 用户id
* @return 0否 1是
*/
GuideVo.GuideStatus queryIsShow(@Param("templateCode") String templateCode,@Param("userId") Long userId);
}

30
src/main/java/com/ccsens/yanyuan/persist/mapper/UserGuideMapper.java

@ -0,0 +1,30 @@
package com.ccsens.yanyuan.persist.mapper;
import com.ccsens.yanyuan.bean.po.UserGuide;
import com.ccsens.yanyuan.bean.po.UserGuideExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface UserGuideMapper {
long countByExample(UserGuideExample example);
int deleteByExample(UserGuideExample example);
int deleteByPrimaryKey(Long id);
int insert(UserGuide record);
int insertSelective(UserGuide record);
List<UserGuide> selectByExample(UserGuideExample example);
UserGuide selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") UserGuide record, @Param("example") UserGuideExample example);
int updateByExample(@Param("record") UserGuide record, @Param("example") UserGuideExample example);
int updateByPrimaryKeySelective(UserGuide record);
int updateByPrimaryKey(UserGuide record);
}

24
src/main/java/com/ccsens/yanyuan/service/IUserGuideService.java

@ -0,0 +1,24 @@
package com.ccsens.yanyuan.service;
import com.ccsens.yanyuan.bean.dto.GuideDto;
import com.ccsens.yanyuan.bean.vo.GuideVo;
/**
* @author AUSU
*/
public interface IUserGuideService {
/**
* 查询当前用户是否显示引导页
* @param param 引导页code
* @param userId 当前用户id
* @return 0否1是
*/
GuideVo.GuideStatus queryGuide(GuideDto.QueryGuide param, Long userId);
/**
* 修改引导页状态
* @param param
* @param userId
*/
void updateGuide(GuideDto.QueryGuide param, Long userId);
}

36
src/main/java/com/ccsens/yanyuan/service/IZaritService.java

@ -0,0 +1,36 @@
package com.ccsens.yanyuan.service;
import com.ccsens.yanyuan.bean.dto.MedicineDto;
import com.ccsens.yanyuan.bean.dto.ZaritDto;
import com.ccsens.yanyuan.bean.vo.ZaritVo;
import java.util.List;
/**
* @author AUSU
*/
public interface IZaritService {
/**
* 查询使用者负担量表的列表
* @param param 使用者userId
* @param userId 当前用户id
* @return 负担量表的列表
*/
List<ZaritVo.ZaritInfo> queryList(ZaritDto.QueryZarit param, Long userId);
/**
* 查询负担量表历史记录
* @param param 使用者userId
* @param userId 当前用户id
* @return 当前用户负担量表历史记录
*/
ZaritVo.ZaritInfo queryHistory(ZaritDto.QueryZarit param, Long userId);
/**
* 添加负担量表历史记录
* @param param 负担量表信息
* @param userId 当前用户id
* @return 负担量表Id
*/
Long addZarit(ZaritDto.AddZarit param, Long userId);
}

45
src/main/java/com/ccsens/yanyuan/service/UserGuideService.java

@ -0,0 +1,45 @@
package com.ccsens.yanyuan.service;
import cn.hutool.core.lang.Snowflake;
import com.ccsens.yanyuan.bean.dto.GuideDto;
import com.ccsens.yanyuan.bean.po.UserGuide;
import com.ccsens.yanyuan.bean.vo.GuideVo;
import com.ccsens.yanyuan.persist.dao.UserGuideDao;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
* @author AUSU
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class UserGuideService implements IUserGuideService {
@Resource
private UserGuideDao userGuideDao;
@Resource
private Snowflake snowflake;
@Override
public GuideVo.GuideStatus queryGuide(GuideDto.QueryGuide param, Long userId) {
return userGuideDao.queryIsShow(param.getTemplateCode(),userId);
}
@Override
public void updateGuide(GuideDto.QueryGuide param, Long userId) {
UserGuide userGuide = new UserGuide();
userGuide.setId(snowflake.nextId());
userGuide.setTemplateCode(param.getTemplateCode());
userGuide.setUserId(userId);
userGuide.setGuideTimes(1);
userGuide.setOperator(userId);
userGuideDao.insertSelective(userGuide);
}
}

67
src/main/java/com/ccsens/yanyuan/service/ZaritService.java

@ -0,0 +1,67 @@
package com.ccsens.yanyuan.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ObjectUtil;
import com.ccsens.yanyuan.bean.dto.MedicineDto;
import com.ccsens.yanyuan.bean.dto.ZaritDto;
import com.ccsens.yanyuan.bean.po.Care;
import com.ccsens.yanyuan.bean.po.UserFamily;
import com.ccsens.yanyuan.bean.vo.ZaritVo;
import com.ccsens.yanyuan.persist.dao.CareDao;
import com.ccsens.yanyuan.persist.dao.FamilyDao;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.UUID;
/**
* @author AUSU
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class ZaritService implements IZaritService{
@Resource
private CareDao careDao;
@Resource
private FamilyDao familyDao;
@Resource
private Snowflake snowflake;
@Override
public List<ZaritVo.ZaritInfo> queryList(ZaritDto.QueryZarit param, Long userId) {
return careDao.queryList(param.getProjectId());
}
@Override
public ZaritVo.ZaritInfo queryHistory(ZaritDto.QueryZarit param, Long userId) {
ZaritVo.ZaritInfo zaritInfo = careDao.queryHistory(param.getProjectId(),userId);
if (ObjectUtil.isNotNull(zaritInfo)) {
return zaritInfo;
}
return familyDao.queryByUserId(userId);
}
@Override
public Long addZarit(ZaritDto.AddZarit param, Long userId) {
Care care = new Care();
BeanUtil.copyProperties(param,care);
care.setId(UUID.randomUUID().toString());
care.setKeyId(snowflake.nextId());
care.setKeyUserId(param.getProjectId());
care.setRecordUserId(userId);
careDao.insertSelective(care);
return care.getKeyId();
}
}

51
src/main/resources/mapper_dao/CareDao.xml

@ -0,0 +1,51 @@
<?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.ccsens.yanyuan.persist.dao.CareDao">
<select id="queryList" resultType="com.ccsens.yanyuan.bean.vo.ZaritVo$ZaritInfo">
SELECT
id,
key_user_id,
record_user_id,
care_name,
care_sex,
care_age,
care_age,
job_title,
educate_level,
care_period,
care_relation,
zarit_state
FROM
u_care
WHERE
rec_status = 0
AND key_user_id = #{projectId}
</select>
<select id="queryHistory" resultType="com.ccsens.yanyuan.bean.vo.ZaritVo$ZaritInfo">
SELECT
id,
key_user_id,
record_user_id,
care_name,
care_sex,
care_age,
care_age,
job_title,
educate_level,
care_period,
care_relation,
zarit_state
FROM
u_care
WHERE
rec_status = 0
AND key_user_id = #{projectId}
AND record_user_id = #{userId}
ORDER BY create_at DESC
LIMIT 1
</select>
</mapper>

19
src/main/resources/mapper_dao/FamilyDao.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.ccsens.yanyuan.persist.dao.FamilyDao">
<select id="queryByUserId" resultType="com.ccsens.yanyuan.bean.vo.ZaritVo$ZaritInfo">
SELECT
`name` AS careName,
sex AS careSex,
age AS careAge,
job_title,
educate_level
FROM
u_user_family
WHERE
rec_status = 0
AND user_id = #{userId}
</select>
</mapper>

17
src/main/resources/mapper_dao/UserGuideDao.xml

@ -0,0 +1,17 @@
<?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.ccsens.yanyuan.persist.dao.UserGuideDao">
<select id="queryIsShow" resultType="com.ccsens.yanyuan.bean.vo.GuideVo$GuideStatus">
SELECT
IF(COUNT(id),1,0) AS `status`
FROM
t_user_guide
WHERE
rec_status = 0
AND template_code = #{templateCode}
AND user_id = #{userId}
</select>
</mapper>

43
src/main/resources/mapper_raw/CareMapper.xml

@ -5,6 +5,7 @@
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="key_id" jdbcType="BIGINT" property="keyId" />
<result column="key_user_id" jdbcType="BIGINT" property="keyUserId" />
<result column="record_user_id" jdbcType="BIGINT" property="recordUserId" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="care_name" jdbcType="VARCHAR" property="careName" />
<result column="care_sex" jdbcType="TINYINT" property="careSex" />
@ -79,9 +80,9 @@
</where>
</sql>
<sql id="Base_Column_List">
id, key_id, key_user_id, user_id, care_name, care_sex, care_age, job_title, educate_level,
care_period, care_relation, zarit_point, zarit_state, create_at, update_at, status,
rec_status
id, key_id, key_user_id, record_user_id, user_id, care_name, care_sex, care_age,
job_title, educate_level, care_period, care_relation, zarit_point, zarit_state, create_at,
update_at, status, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.yanyuan.bean.po.CareExample" resultMap="BaseResultMap">
select
@ -115,17 +116,19 @@
</delete>
<insert id="insert" parameterType="com.ccsens.yanyuan.bean.po.Care">
insert into u_care (id, key_id, key_user_id,
user_id, care_name, care_sex,
care_age, job_title, educate_level,
care_period, care_relation, zarit_point,
zarit_state, create_at, update_at,
status, rec_status)
record_user_id, user_id, care_name,
care_sex, care_age, job_title,
educate_level, care_period, care_relation,
zarit_point, zarit_state, create_at,
update_at, status, rec_status
)
values (#{id,jdbcType=VARCHAR}, #{keyId,jdbcType=BIGINT}, #{keyUserId,jdbcType=BIGINT},
#{userId,jdbcType=VARCHAR}, #{careName,jdbcType=VARCHAR}, #{careSex,jdbcType=TINYINT},
#{careAge,jdbcType=VARCHAR}, #{jobTitle,jdbcType=VARCHAR}, #{educateLevel,jdbcType=VARCHAR},
#{carePeriod,jdbcType=VARCHAR}, #{careRelation,jdbcType=VARCHAR}, #{zaritPoint,jdbcType=VARCHAR},
#{zaritState,jdbcType=VARCHAR}, #{createAt,jdbcType=TIMESTAMP}, #{updateAt,jdbcType=TIMESTAMP},
#{status,jdbcType=TINYINT}, #{recStatus,jdbcType=TINYINT})
#{recordUserId,jdbcType=BIGINT}, #{userId,jdbcType=VARCHAR}, #{careName,jdbcType=VARCHAR},
#{careSex,jdbcType=TINYINT}, #{careAge,jdbcType=VARCHAR}, #{jobTitle,jdbcType=VARCHAR},
#{educateLevel,jdbcType=VARCHAR}, #{carePeriod,jdbcType=VARCHAR}, #{careRelation,jdbcType=VARCHAR},
#{zaritPoint,jdbcType=VARCHAR}, #{zaritState,jdbcType=VARCHAR}, #{createAt,jdbcType=TIMESTAMP},
#{updateAt,jdbcType=TIMESTAMP}, #{status,jdbcType=TINYINT}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.yanyuan.bean.po.Care">
insert into u_care
@ -139,6 +142,9 @@
<if test="keyUserId != null">
key_user_id,
</if>
<if test="recordUserId != null">
record_user_id,
</if>
<if test="userId != null">
user_id,
</if>
@ -192,6 +198,9 @@
<if test="keyUserId != null">
#{keyUserId,jdbcType=BIGINT},
</if>
<if test="recordUserId != null">
#{recordUserId,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
@ -254,6 +263,9 @@
<if test="record.keyUserId != null">
key_user_id = #{record.keyUserId,jdbcType=BIGINT},
</if>
<if test="record.recordUserId != null">
record_user_id = #{record.recordUserId,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
@ -306,6 +318,7 @@
set id = #{record.id,jdbcType=VARCHAR},
key_id = #{record.keyId,jdbcType=BIGINT},
key_user_id = #{record.keyUserId,jdbcType=BIGINT},
record_user_id = #{record.recordUserId,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=VARCHAR},
care_name = #{record.careName,jdbcType=VARCHAR},
care_sex = #{record.careSex,jdbcType=TINYINT},
@ -333,6 +346,9 @@
<if test="keyUserId != null">
key_user_id = #{keyUserId,jdbcType=BIGINT},
</if>
<if test="recordUserId != null">
record_user_id = #{recordUserId,jdbcType=BIGINT},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
@ -382,6 +398,7 @@
update u_care
set key_id = #{keyId,jdbcType=BIGINT},
key_user_id = #{keyUserId,jdbcType=BIGINT},
record_user_id = #{recordUserId,jdbcType=BIGINT},
user_id = #{userId,jdbcType=VARCHAR},
care_name = #{careName,jdbcType=VARCHAR},
care_sex = #{careSex,jdbcType=TINYINT},

258
src/main/resources/mapper_raw/UserGuideMapper.xml

@ -0,0 +1,258 @@
<?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.ccsens.yanyuan.persist.mapper.UserGuideMapper">
<resultMap id="BaseResultMap" type="com.ccsens.yanyuan.bean.po.UserGuide">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="template_code" jdbcType="VARCHAR" property="templateCode" />
<result column="guide_times" jdbcType="INTEGER" property="guideTimes" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, user_id, template_code, guide_times, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.yanyuan.bean.po.UserGuideExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_user_guide
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_user_guide
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_user_guide
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.yanyuan.bean.po.UserGuideExample">
delete from t_user_guide
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.yanyuan.bean.po.UserGuide">
insert into t_user_guide (id, user_id, template_code,
guide_times, operator, created_at,
updated_at, rec_status)
values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{templateCode,jdbcType=VARCHAR},
#{guideTimes,jdbcType=INTEGER}, #{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.yanyuan.bean.po.UserGuide">
insert into t_user_guide
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="templateCode != null">
template_code,
</if>
<if test="guideTimes != null">
guide_times,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="templateCode != null">
#{templateCode,jdbcType=VARCHAR},
</if>
<if test="guideTimes != null">
#{guideTimes,jdbcType=INTEGER},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.yanyuan.bean.po.UserGuideExample" resultType="java.lang.Long">
select count(*) from t_user_guide
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_user_guide
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.templateCode != null">
template_code = #{record.templateCode,jdbcType=VARCHAR},
</if>
<if test="record.guideTimes != null">
guide_times = #{record.guideTimes,jdbcType=INTEGER},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_user_guide
set id = #{record.id,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
template_code = #{record.templateCode,jdbcType=VARCHAR},
guide_times = #{record.guideTimes,jdbcType=INTEGER},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.yanyuan.bean.po.UserGuide">
update t_user_guide
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="templateCode != null">
template_code = #{templateCode,jdbcType=VARCHAR},
</if>
<if test="guideTimes != null">
guide_times = #{guideTimes,jdbcType=INTEGER},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.yanyuan.bean.po.UserGuide">
update t_user_guide
set user_id = #{userId,jdbcType=BIGINT},
template_code = #{templateCode,jdbcType=VARCHAR},
guide_times = #{guideTimes,jdbcType=INTEGER},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

3
src/main/resources/mbg.xml

@ -87,7 +87,8 @@
<table tableName="u_user_family" domainObjectName="UserFamily"></table>
<table tableName="u_user_relation" domainObjectName="UserRelation"></table>
<table tableName="u_user_type" domainObjectName="UserType"></table>-->
<table tableName="u_care" domainObjectName="Care"></table>
<!-- <table tableName="u_care" domainObjectName="Care"></table>-->
<table tableName="t_user_guide" domainObjectName="UserGuide"></table>
<!-- 有些表的字段需要指定java类型
<table schema="" tableName="">

Loading…
Cancel
Save