提交 8eff1c79 编写于 作者: yujiao's avatar yujiao

Merge remote-tracking branch 'origin/dev-laowang-20200522' into dev-laowang-20200522

流水线 #25942 已失败 于阶段
in 0 second
......@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-client</artifactId>
<version>1.0.3.1</version>
<version>1.0.3.3</version>
<name>pica-cloud-account-client</name>
<packaging>jar</packaging>
......@@ -28,7 +28,7 @@
<dependency>
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId>
<version>1.0.1</version>
<version>1.0.1.2</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
......
package com.pica.cloud.account.account.client;
import com.pica.cloud.account.account.common.req.AcctPatFamilyReq;
import com.pica.cloud.account.account.common.req.AcctPatInfoReq;
import com.pica.cloud.account.account.common.req.InitAcctReq;
import com.pica.cloud.account.account.common.resp.PatBindResp;
import com.pica.cloud.account.account.common.resp.PatFamilyResp;
import com.pica.cloud.foundation.entity.PicaResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@FeignClient(name = "13201-pica-cloud-account")
public interface PatHealthPackClient {
@GetMapping(value = "/account/pat-health/acctId/unionId/{unionId}")
PicaResponse<Integer> getAcctIdByUnionId(@PathVariable("unionId") String unionId);
@GetMapping(value = "/account/pat-health/acctId/patId/{patientId}")
PicaResponse<Integer> getAcctIdByPatId(@PathVariable("patientId") Integer patientId);
@GetMapping(value = "/account/pat-health/directPatIds/{patientId}")
PicaResponse<List<Integer>> getDirectPatIdsByPatId(@PathVariable("patientId") Integer patientId);
@GetMapping(value = "/account/pat-health/familyPats/{acctId}/containAcct/{containAcct}")
PicaResponse<PatFamilyResp> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId, @PathVariable("containAcct") Integer containAcct);
@PostMapping(value = "/account/pat-health/acct")
PicaResponse<Integer> saveAcct(@RequestBody AcctPatInfoReq patInfoReq);
@PostMapping(value = "/account/pat-health/acct/bindUnion")
PicaResponse<PatBindResp> bindUnion(@RequestBody AcctPatInfoReq patInfoReq);
@PostMapping(value = "/account/pat-health/family/member")
PicaResponse<PatFamilyResp> saveMember(@RequestBody AcctPatFamilyReq familyReqReq);
@GetMapping(value = "/account/pat-health/familyAcct/patId/{patId}")
PicaResponse<Integer> getFamilyAcctPatId(@PathVariable("patId") Integer patId);
@PostMapping(value = "/account/pat-health/init/accts")
PicaResponse initAccts(@RequestBody List<InitAcctReq> initAcctReqList);
}
......@@ -11,7 +11,7 @@
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId>
<version>1.0.1</version>
<version>1.0.1.2</version>
<name>pica-cloud-account-common</name>
<packaging>jar</packaging>
......
// Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.common.req;
/**
* @ClassName AcctPatFamilyDto
* @Description TODO
* @Author peijun.zhao
* @Date 2020/5/14 13:21
* @ModifyDate 2020/5/14 13:21
* @Version 1.0
*/
public class AcctPatFamilyDto {
private Integer patientId;
private Integer relation;
public Integer getPatientId() {
return patientId;
}
public void setPatientId(Integer patientId) {
this.patientId = patientId;
}
public Integer getRelation() {
return relation;
}
public void setRelation(Integer relation) {
this.relation = relation;
}
}
// Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.common.req;
import io.swagger.annotations.ApiModel;
import java.util.List;
/**
* @ClassName AcctPatFamilyReq
* @Description TODO
* @Author peijun.zhao
* @Date 2020/5/14 13:21
* @ModifyDate 2020/5/14 13:21
* @Version 1.0
*/
@ApiModel
public class AcctPatFamilyReq {
private Integer acctId;
private List<AcctPatFamilyDto> memberList;
public Integer getAcctId() {
return acctId;
}
public void setAcctId(Integer acctId) {
this.acctId = acctId;
}
public List<AcctPatFamilyDto> getMemberList() {
return memberList;
}
public void setMemberList(List<AcctPatFamilyDto> memberList) {
this.memberList = memberList;
}
}
// Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.common.req;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @ClassName AcctPatInfoReq
* @Description TODO
* @Author peijun.zhao
* @Date 2020/5/12 16:16
* @ModifyDate 2020/5/12 16:16
* @Version 1.0
*/
@ApiModel
public class AcctPatInfoReq {
// @NotNull
private String name;
// @NotNull
private String mobile;
private String unionId;
private Integer acctId;
@ApiModelProperty("1.云鹊健康小程序")
private Integer type;
private Integer patientId;
@ApiModelProperty("1:本人 2:父母 3:子女 4:配偶 5:其他")
private Integer memberType;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getUnionId() {
return unionId;
}
public void setUnionId(String unionId) {
this.unionId = unionId;
}
public Integer getAcctId() {
return acctId;
}
public void setAcctId(Integer acctId) {
this.acctId = acctId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getPatientId() {
return patientId;
}
public void setPatientId(Integer patientId) {
this.patientId = patientId;
}
public Integer getMemberType() {
return memberType;
}
public void setMemberType(Integer memberType) {
this.memberType = memberType;
}
}
// Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.common.req;
import io.swagger.annotations.ApiModel;
/**
* @ClassName InitAcctReq
* @Description TODO
* @Author peijun.zhao
* @Date 2020/5/20 10:46
* @ModifyDate 2020/5/20 10:46
* @Version 1.0
*/
@ApiModel
public class InitAcctReq {
private Integer patId;
private String mobile;
private String encryMobile;
private String name;
private String unionId;
public String getUnionId() {
return unionId;
}
public void setUnionId(String unionId) {
this.unionId = unionId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getEncryMobile() {
return encryMobile;
}
public void setEncryMobile(String encryMobile) {
this.encryMobile = encryMobile;
}
public Integer getPatId() {
return patId;
}
public void setPatId(Integer patId) {
this.patId = patId;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
}
// Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.common.resp;
import io.swagger.annotations.ApiModel;
/**
* @ClassName PatBindResp
* @Description TODO
* @Author peijun.zhao
* @Date 2020/5/13 13:24
* @ModifyDate 2020/5/13 13:24
* @Version 1.0
*/
@ApiModel(description = "建立微信与账号关联关系-resp")
public class PatBindResp {
private boolean bindStatus;
private String msg;
public boolean isBindStatus() {
return bindStatus;
}
public void setBindStatus(boolean bindStatus) {
this.bindStatus = bindStatus;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
// Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.common.resp;
import com.pica.cloud.account.account.common.req.AcctPatFamilyDto;
import io.swagger.annotations.ApiModel;
import java.util.List;
@ApiModel(description = "建立家庭服务关系-resp")
public class PatFamilyResp {
private boolean successFlag;
private List<AcctPatFamilyDto> failMemberList;
private List<AcctPatFamilyDto> memberList;
private List<Integer> memberPatIds;
private String failMsg;
public List<AcctPatFamilyDto> getMemberList() {
return memberList;
}
public void setMemberList(List<AcctPatFamilyDto> memberList) {
this.memberList = memberList;
}
public String getFailMsg() {
return failMsg;
}
public void setFailMsg(String failMsg) {
this.failMsg = failMsg;
}
public boolean isSuccessFlag() {
return successFlag;
}
public void setSuccessFlag(boolean successFlag) {
this.successFlag = successFlag;
}
public List<AcctPatFamilyDto> getFailMemberList() {
return failMemberList;
}
public void setFailMemberList(List<AcctPatFamilyDto> failMemberList) {
this.failMemberList = failMemberList;
}
public List<Integer> getMemberPatIds() {
return memberPatIds;
}
public void setMemberPatIds(List<Integer> memberPatIds) {
this.memberPatIds = memberPatIds;
}
}
......@@ -138,7 +138,7 @@
<dependency>
<groupId>com.pica.cloud.account</groupId>
<artifactId>pica-cloud-account-common</artifactId>
<version>1.0.1</version>
<version>1.0.1.2</version>
</dependency>
<dependency>
......
......@@ -212,7 +212,8 @@ public class AccountController extends AccountBaseController {
@ApiOperation("H5端一键登录功能,无需完善信息")
@PostMapping("/login-register/v1")
// @RepeatForbidden(uniqueKey = "content") 当前版本存在性能问题 luo优化后上
// @RepeatForbidden(uniqueKey = "content")
//当前版本存在性能问题 luo优化后上
public PicaResponse loginRegister(@RequestBody EncryptEntity entity) throws Exception {
BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class);
this.checkMobilePhone(request.getMobile());
......
// Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.server.controller;
import com.pica.cloud.account.account.common.req.AcctPatFamilyReq;
import com.pica.cloud.account.account.common.req.AcctPatInfoReq;
import com.pica.cloud.account.account.common.req.InitAcctReq;
import com.pica.cloud.account.account.common.resp.PatBindResp;
import com.pica.cloud.account.account.common.resp.PatFamilyResp;
import com.pica.cloud.account.account.server.service.PatHealthPackService;
import com.pica.cloud.foundation.entity.PicaResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @Description TODO
* @Author peijun.zhao
* @Date 2020/5/12 15:55
* @ModifyDate 2020/5/12 15:55
* @Params
* @Return
*/
@Api(description = "健康包")
@RestController
@RequestMapping("/pat-health")
public class PatHealthPackController {
@Autowired
private PatHealthPackService packService;
@ApiOperation("获取主账户ID-根据unionId")
@GetMapping(value = "/acctId/unionId/{unionId}")
public PicaResponse<Integer> getAcctIdByUnionId(@PathVariable("unionId") String unionId) throws Exception {
return PicaResponse.toResponse(packService.getAcctIdByUnionId(unionId));
}
@ApiOperation("获取主账户ID-作为监护人自身patientId")
@GetMapping(value = "/acctId/patId/{patientId}")
public PicaResponse<Integer> getAcctIdByPatId(@PathVariable("patientId") Integer patientId) throws Exception {
return PicaResponse.toResponse(packService.getAcctIdByPatId(patientId));
}
@ApiOperation("所在家庭组的监护人 + 同级家庭成员 + 下级所有成员 patientId list,去除自身、去重;")
@GetMapping(value = "/directPatIds/{patientId}")
public PicaResponse<List<Integer>> getDirectPatIdsByPatId(@PathVariable("patientId") Integer patientId) throws Exception {
return PicaResponse.toResponse(packService.getDirectPatIdsByPatId(patientId));
}
@ApiOperation("根据accid获取自身家庭成员List;containAcct:0 包含自身 1 不包含自身")
@GetMapping(value = "/familyPats/{acctId}/containAcct/{containAcct}")
public PicaResponse<PatFamilyResp> getFamilyPatsByAcctId(@PathVariable("acctId") Integer acctId,@PathVariable("containAcct") Integer containAcct) throws Exception {
return PicaResponse.toResponse(packService.getFamilyPatsByAcctId(acctId,containAcct));
}
@ApiOperation("保存主账户")
@PostMapping(value = "/acct")
public PicaResponse<Integer> saveAcct(@RequestBody AcctPatInfoReq patInfoReq) throws Exception {
return PicaResponse.toResponse(packService.saveAcct(patInfoReq));
}
@ApiOperation("建立微信与账号关联关系")
@PostMapping(value = "/acct/bindUnion")
public PicaResponse<PatBindResp> bindUnion(@RequestBody AcctPatInfoReq patInfoReq) throws Exception {
return PicaResponse.toResponse(packService.bindUnion(patInfoReq));
}
@ApiOperation("建立家庭服务关系")
@PostMapping(value = "/family/member")
public PicaResponse<PatFamilyResp> saveMember(@RequestBody AcctPatFamilyReq familyReqReq) throws Exception {
return PicaResponse.toResponse(packService.saveMember(familyReqReq));
}
@ApiOperation("根据patientId获取监护人-本人监护人(自身patId),本人成员(监护人patId)")
@GetMapping(value = "/familyAcct/patId/{patId}")
public PicaResponse<Integer> getFamilyAcctPatId(@PathVariable("patId") Integer patId) throws Exception {
return PicaResponse.toResponse(packService.getFamilyAcctPatId(patId));
}
@ApiOperation("初始主账户数据")
@PostMapping(value = "/init/accts")
public PicaResponse initAccts(@RequestBody List<InitAcctReq> initAcctReqList) throws Exception {
return PicaResponse.toResponse(packService.initAccts(initAcctReqList));
}
}
package com.pica.cloud.account.account.server.entity;
import java.util.Date;
public class AcctPatFamily {
private Integer id;
private Integer acctId;
private Integer patientId;
private Integer relation;
private Integer deleteFlag;
private Integer createdId;
private Date createdTime;
private Integer modifiedId;
private Date modifiedTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getAcctId() {
return acctId;
}
public void setAcctId(Integer acctId) {
this.acctId = acctId;
}
public Integer getPatientId() {
return patientId;
}
public void setPatientId(Integer patientId) {
this.patientId = patientId;
}
public Integer getRelation() {
return relation;
}
public void setRelation(Integer relation) {
this.relation = relation;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
public Integer getCreatedId() {
return createdId;
}
public void setCreatedId(Integer createdId) {
this.createdId = createdId;
}
public Date getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Integer getModifiedId() {
return modifiedId;
}
public void setModifiedId(Integer modifiedId) {
this.modifiedId = modifiedId;
}
public Date getModifiedTime() {
return modifiedTime;
}
public void setModifiedTime(Date modifiedTime) {
this.modifiedTime = modifiedTime;
}
}
\ No newline at end of file
package com.pica.cloud.account.account.server.entity;
import java.util.Date;
public class AcctPatInfo {
private Integer id;
private String name;
private String mobilePhone;
private String password;
private Integer registerProduct;
private Integer registerSource;
private Date birthday;
private Integer age;
private Byte sex;
private String idCard;
private Date regTime;
private Integer deleteFlag;
private Integer createdId;
private Date createdTime;
private Integer modifiedId;
private Date modifiedTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getMobilePhone() {
return mobilePhone;
}
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone == null ? null : mobilePhone.trim();
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
public Integer getRegisterProduct() {
return registerProduct;
}
public void setRegisterProduct(Integer registerProduct) {
this.registerProduct = registerProduct;
}
public Integer getRegisterSource() {
return registerSource;
}
public void setRegisterSource(Integer registerSource) {
this.registerSource = registerSource;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public Byte getSex() {
return sex;
}
public void setSex(Byte sex) {
this.sex = sex;
}
public String getIdCard() {
return idCard;
}
public void setIdCard(String idCard) {
this.idCard = idCard == null ? null : idCard.trim();
}
public Date getRegTime() {
return regTime;
}
public void setRegTime(Date regTime) {
this.regTime = regTime;
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
public Integer getCreatedId() {
return createdId;
}
public void setCreatedId(Integer createdId) {
this.createdId = createdId;
}
public Date getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Integer getModifiedId() {
return modifiedId;
}
public void setModifiedId(Integer modifiedId) {
this.modifiedId = modifiedId;
}
public Date getModifiedTime() {
return modifiedTime;
}
public void setModifiedTime(Date modifiedTime) {
this.modifiedTime = modifiedTime;
}
}
\ No newline at end of file
package com.pica.cloud.account.account.server.entity;
import java.util.Date;
public class AcctPatUnion {
private Integer id;
private Integer acctId;
private Integer unionType;
private String unionId;
private Integer deleteFlag;
private Integer createdId;
private Date createdTime;
private Integer modifiedId;
private Date modifiedTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getAcctId() {
return acctId;
}
public void setAcctId(Integer acctId) {
this.acctId = acctId;
}
public Integer getUnionType() {
return unionType;
}
public void setUnionType(Integer unionType) {
this.unionType = unionType;
}
public String getUnionId() {
return unionId;
}
public void setUnionId(String unionId) {
this.unionId = unionId == null ? null : unionId.trim();
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
public Integer getCreatedId() {
return createdId;
}
public void setCreatedId(Integer createdId) {
this.createdId = createdId;
}
public Date getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Integer getModifiedId() {
return modifiedId;
}
public void setModifiedId(Integer modifiedId) {
this.modifiedId = modifiedId;
}
public Date getModifiedTime() {
return modifiedTime;
}
public void setModifiedTime(Date modifiedTime) {
this.modifiedTime = modifiedTime;
}
}
\ No newline at end of file
......@@ -56,6 +56,14 @@ public enum AccountExceptionEnum {
PICA_MOBILE_NOT_SETED_PASSWORD_H5("216548", "该手机号尚未设置密码,设置密码请前往云鹊医APP,或使用其他方式登录。"),
PICA_PWD_MISMATCH_5_H5("216549", "该账号密码错误次数已达上限请24小时后再试,或请使用其他登录方式"),
PAT_ACCT_HAS_EXIST("216550","账号已存在"),
PAT_ACCT_HAS_MORE("216551","主账号存在多条"),
PAT_MEMBER_HAS_MORE("216552","该成员已被其他人添加为家庭成员"),
PAT_SAVE_PARAM_ERROR("216553","保存主账户参数错误"),
PAT_UNIONID_BINDED_ERROR("216554","该unionid已被其他手机号绑定"),
PAT_MOBILE_BINDED_WECHAT_ERROR("216555","该手机已绑定其他微信"),
PAT_MEMBER_HAS_BINDED_SELF("216556","该成员已被账户绑定为家庭成员,不需要再次绑定"),
PAT_HAS_CREATE_ACCT("216557","初始居民已存在主账户"),
xxx_xxx("","");
......
......@@ -14,6 +14,7 @@ public enum SourceTypeEnum {
SAAS(3, "saas"),
H5(4, "h5"),
ADMIN(5, "admin"),
INIT(6, "初始生成-居民账户"),
XXX(10, "xxxxxx");
......
package com.pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.server.entity.AcctPatFamily;
import java.util.List;
public interface AcctPatFamilyMapper {
int deleteByPrimaryKey(Integer id);
int insert(AcctPatFamily record);
int insertSelective(AcctPatFamily record);
AcctPatFamily selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(AcctPatFamily record);
int updateByPrimaryKey(AcctPatFamily record);
/** 获取居民id是本人的家庭组记录- 作为家庭主账户、本人居民id,单条ok 多条异常数据 */
AcctPatFamily getByPatIdSelf(Integer patId);
/** 查询居民id所在家庭组监护人- 作为家庭成员、非主账户本人居民id,单条ok 多条异常数据 */
AcctPatFamily getByPatIdNotSelf(Integer patId);
/** 获取主账户下所有家庭成员 */
List<AcctPatFamily> getListByAcctId(Integer acctId);
/** 根据账户id 获取主账户居民 */
AcctPatFamily getSelfByAcctId(Integer acctId);
List<AcctPatFamily> getListByPatIds(List<Integer> patIds);
List<AcctPatFamily> getByPatIdSelfList(List<Integer> patIds);
int initBatch(List<AcctPatFamily> list);
List<AcctPatFamily> getMemberListByPatIds(List<Integer> patIds);
}
\ No newline at end of file
package com.pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.common.req.InitAcctReq;
import com.pica.cloud.account.account.server.entity.AcctPatInfo;
import java.util.List;
import java.util.Map;
public interface AcctPatInfoMapper {
int deleteByPrimaryKey(Integer id);
int insert(AcctPatInfo record);
int insertSelective(AcctPatInfo record);
AcctPatInfo selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(AcctPatInfo record);
int updateByPrimaryKey(AcctPatInfo record);
List<AcctPatInfo> selectByCondition(AcctPatInfo record);
int initBatch(List<AcctPatInfo> list);
List<AcctPatInfo> getListByMobiles(List<String> mobile);
}
\ No newline at end of file
package com.pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.server.entity.AcctPatUnion;
import java.util.List;
public interface AcctPatUnionMapper {
int deleteByPrimaryKey(Integer id);
int insert(AcctPatUnion record);
int insertSelective(AcctPatUnion record);
AcctPatUnion selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(AcctPatUnion record);
int updateByPrimaryKey(AcctPatUnion record);
AcctPatUnion selectByUnionId(String unionId);
AcctPatUnion selectByAcctId(Integer acctId);
int initBatch(List<AcctPatUnion> list);
}
\ No newline at end of file
// Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.server.service;
import com.pica.cloud.account.account.common.req.AcctPatFamilyReq;
import com.pica.cloud.account.account.common.req.AcctPatInfoReq;
import com.pica.cloud.account.account.common.req.InitAcctReq;
import com.pica.cloud.account.account.common.resp.PatBindResp;
import com.pica.cloud.account.account.common.resp.PatFamilyResp;
import java.util.List;
/**
* @ClassName PatHealthPackService
* @Description TODO
* @Author peijun.zhao
* @Date 2020/5/14 18:30
* @ModifyDate 2020/5/14 18:30
* @Version 1.0
*/
public interface PatHealthPackService {
Integer getAcctIdByUnionId(String unionId);
Integer getAcctIdByPatId(Integer patientId);
List<Integer> getDirectPatIdsByPatId(Integer patientId);
PatFamilyResp getFamilyPatsByAcctId(Integer acctId,Integer containAcct);
Integer saveAcct(AcctPatInfoReq patInfoReq);
PatBindResp bindUnion(AcctPatInfoReq patInfoReq);
PatFamilyResp saveMember(AcctPatFamilyReq familyReqReq);
Integer getFamilyAcctPatId(Integer patId);
Integer initAccts(List<InitAcctReq> list);
}
<?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.pica.cloud.account.account.server.mapper.AcctPatFamilyMapper" >
<resultMap id="BaseResultMap" type="com.pica.cloud.account.account.server.entity.AcctPatFamily" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="acct_id" property="acctId" jdbcType="INTEGER" />
<result column="patient_id" property="patientId" jdbcType="INTEGER" />
<result column="relation" property="relation" jdbcType="INTEGER" />
<result column="delete_flag" property="deleteFlag" jdbcType="INTEGER" />
<result column="created_id" property="createdId" jdbcType="INTEGER" />
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP" />
<result column="modified_id" property="modifiedId" jdbcType="INTEGER" />
<result column="modified_time" property="modifiedTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
id, acct_id, patient_id, relation, delete_flag, created_id, created_time, modified_id,
modified_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from account_pat_family
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from account_pat_family
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.AcctPatFamily" >
insert into account_pat_family (id, acct_id, patient_id,
relation, delete_flag, created_id,
created_time, modified_id, modified_time
)
values (#{id,jdbcType=INTEGER}, #{acctId,jdbcType=INTEGER}, #{patientId,jdbcType=INTEGER},
#{relation,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER}, #{createdId,jdbcType=INTEGER},
#{createdTime,jdbcType=TIMESTAMP}, #{modifiedId,jdbcType=INTEGER}, #{modifiedTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.pica.cloud.account.account.server.entity.AcctPatFamily" >
insert into account_pat_family
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="acctId != null" >
acct_id,
</if>
<if test="patientId != null" >
patient_id,
</if>
<if test="relation != null" >
relation,
</if>
<if test="deleteFlag != null" >
delete_flag,
</if>
<if test="createdId != null" >
created_id,
</if>
<if test="createdTime != null" >
created_time,
</if>
<if test="modifiedId != null" >
modified_id,
</if>
<if test="modifiedTime != null" >
modified_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="acctId != null" >
#{acctId,jdbcType=INTEGER},
</if>
<if test="patientId != null" >
#{patientId,jdbcType=INTEGER},
</if>
<if test="relation != null" >
#{relation,jdbcType=INTEGER},
</if>
<if test="deleteFlag != null" >
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createdId != null" >
#{createdId,jdbcType=INTEGER},
</if>
<if test="createdTime != null" >
#{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedId != null" >
#{modifiedId,jdbcType=INTEGER},
</if>
<if test="modifiedTime != null" >
#{modifiedTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.pica.cloud.account.account.server.entity.AcctPatFamily" >
update account_pat_family
<set >
<if test="acctId != null" >
acct_id = #{acctId,jdbcType=INTEGER},
</if>
<if test="patientId != null" >
patient_id = #{patientId,jdbcType=INTEGER},
</if>
<if test="relation != null" >
relation = #{relation,jdbcType=INTEGER},
</if>
<if test="deleteFlag != null" >
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createdId != null" >
created_id = #{createdId,jdbcType=INTEGER},
</if>
<if test="createdTime != null" >
created_time = #{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedId != null" >
modified_id = #{modifiedId,jdbcType=INTEGER},
</if>
<if test="modifiedTime != null" >
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.pica.cloud.account.account.server.entity.AcctPatFamily" >
update account_pat_family
set acct_id = #{acctId,jdbcType=INTEGER},
patient_id = #{patientId,jdbcType=INTEGER},
relation = #{relation,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
created_id = #{createdId,jdbcType=INTEGER},
created_time = #{createdTime,jdbcType=TIMESTAMP},
modified_id = #{modifiedId,jdbcType=INTEGER},
modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getListByAcctId" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from account_pat_family
where acct_id = #{acctId,jdbcType=INTEGER}
and delete_flag = 1;
</select>
<select id="getSelfByAcctId" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from account_pat_family
where acct_id = #{acctId,jdbcType=INTEGER} and relation = 1
and delete_flag = 1;
</select>
<select id="getByPatIdSelf" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from account_pat_family
where patient_id = #{patientId,jdbcType=INTEGER}
and relation = 1
and delete_flag = 1;
</select>
<select id="getByPatIdNotSelf" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from account_pat_family
where patient_id = #{patientId,jdbcType=INTEGER}
AND relation != 1
and delete_flag = 1;
</select>
<select id="getListByPatIds" parameterType="java.util.List" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from account_pat_family
where patient_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
and delete_flag = 1;
</select>
<select id="getMemberListByPatIds" parameterType="java.util.List" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from account_pat_family
where patient_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
AND relation != 1
and delete_flag = 1;
</select>
<select id="getByPatIdSelfList" parameterType="java.util.List" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from account_pat_family
where patient_id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
and relation = 1
and delete_flag = 1;
</select>
<insert id="initBatch" parameterType="java.util.List">
insert into account_pat_family(
acct_id, patient_id,relation,
delete_flag, created_id, created_time,
modified_id, modified_time
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.acctId},#{item.patientId},#{item.relation},
1,99999999,now(),
99999999,now()
)
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?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.pica.cloud.account.account.server.mapper.AcctPatInfoMapper" >
<resultMap id="BaseResultMap" type="com.pica.cloud.account.account.server.entity.AcctPatInfo" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="mobile_phone" property="mobilePhone" jdbcType="VARCHAR" />
<result column="password" property="password" jdbcType="VARCHAR" />
<result column="register_product" property="registerProduct" jdbcType="INTEGER" />
<result column="register_source" property="registerSource" jdbcType="INTEGER" />
<result column="birthday" property="birthday" jdbcType="DATE" />
<result column="age" property="age" jdbcType="INTEGER" />
<result column="sex" property="sex" jdbcType="TINYINT" />
<result column="id_card" property="idCard" jdbcType="VARCHAR" />
<result column="reg_time" property="regTime" jdbcType="TIMESTAMP" />
<result column="delete_flag" property="deleteFlag" jdbcType="INTEGER" />
<result column="created_id" property="createdId" jdbcType="INTEGER" />
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP" />
<result column="modified_id" property="modifiedId" jdbcType="INTEGER" />
<result column="modified_time" property="modifiedTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
id, name, mobile_phone, password, register_product, register_source, birthday, age,
sex, id_card, reg_time, delete_flag, created_id, created_time, modified_id, modified_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from account_pat_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from account_pat_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.AcctPatInfo" useGeneratedKeys="true" keyProperty="id" >
insert into account_pat_info (id, name, mobile_phone,
password, register_product, register_source,
birthday, age, sex, id_card,
reg_time, delete_flag, created_id,
created_time, modified_id, modified_time
)
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{mobilePhone,jdbcType=VARCHAR},
#{password,jdbcType=VARCHAR}, #{registerProduct,jdbcType=INTEGER}, #{registerSource,jdbcType=INTEGER},
#{birthday,jdbcType=DATE}, #{age,jdbcType=INTEGER}, #{sex,jdbcType=TINYINT}, #{idCard,jdbcType=VARCHAR},
#{regTime,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=INTEGER}, #{createdId,jdbcType=INTEGER},
#{createdTime,jdbcType=TIMESTAMP}, #{modifiedId,jdbcType=INTEGER}, #{modifiedTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.pica.cloud.account.account.server.entity.AcctPatInfo" >
insert into account_pat_info
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="name != null" >
name,
</if>
<if test="mobilePhone != null" >
mobile_phone,
</if>
<if test="password != null" >
password,
</if>
<if test="registerProduct != null" >
register_product,
</if>
<if test="registerSource != null" >
register_source,
</if>
<if test="birthday != null" >
birthday,
</if>
<if test="age != null" >
age,
</if>
<if test="sex != null" >
sex,
</if>
<if test="idCard != null" >
id_card,
</if>
<if test="regTime != null" >
reg_time,
</if>
<if test="deleteFlag != null" >
delete_flag,
</if>
<if test="createdId != null" >
created_id,
</if>
<if test="createdTime != null" >
created_time,
</if>
<if test="modifiedId != null" >
modified_id,
</if>
<if test="modifiedTime != null" >
modified_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="name != null" >
#{name,jdbcType=VARCHAR},
</if>
<if test="mobilePhone != null" >
#{mobilePhone,jdbcType=VARCHAR},
</if>
<if test="password != null" >
#{password,jdbcType=VARCHAR},
</if>
<if test="registerProduct != null" >
#{registerProduct,jdbcType=INTEGER},
</if>
<if test="registerSource != null" >
#{registerSource,jdbcType=INTEGER},
</if>
<if test="birthday != null" >
#{birthday,jdbcType=DATE},
</if>
<if test="age != null" >
#{age,jdbcType=INTEGER},
</if>
<if test="sex != null" >
#{sex,jdbcType=TINYINT},
</if>
<if test="idCard != null" >
#{idCard,jdbcType=VARCHAR},
</if>
<if test="regTime != null" >
#{regTime,jdbcType=TIMESTAMP},
</if>
<if test="deleteFlag != null" >
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createdId != null" >
#{createdId,jdbcType=INTEGER},
</if>
<if test="createdTime != null" >
#{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedId != null" >
#{modifiedId,jdbcType=INTEGER},
</if>
<if test="modifiedTime != null" >
#{modifiedTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.pica.cloud.account.account.server.entity.AcctPatInfo" >
update account_pat_info
<set >
<if test="name != null" >
name = #{name,jdbcType=VARCHAR},
</if>
<if test="mobilePhone != null" >
mobile_phone = #{mobilePhone,jdbcType=VARCHAR},
</if>
<if test="password != null" >
password = #{password,jdbcType=VARCHAR},
</if>
<if test="registerProduct != null" >
register_product = #{registerProduct,jdbcType=INTEGER},
</if>
<if test="registerSource != null" >
register_source = #{registerSource,jdbcType=INTEGER},
</if>
<if test="birthday != null" >
birthday = #{birthday,jdbcType=DATE},
</if>
<if test="age != null" >
age = #{age,jdbcType=INTEGER},
</if>
<if test="sex != null" >
sex = #{sex,jdbcType=TINYINT},
</if>
<if test="idCard != null" >
id_card = #{idCard,jdbcType=VARCHAR},
</if>
<if test="regTime != null" >
reg_time = #{regTime,jdbcType=TIMESTAMP},
</if>
<if test="deleteFlag != null" >
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createdId != null" >
created_id = #{createdId,jdbcType=INTEGER},
</if>
<if test="createdTime != null" >
created_time = #{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedId != null" >
modified_id = #{modifiedId,jdbcType=INTEGER},
</if>
<if test="modifiedTime != null" >
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.pica.cloud.account.account.server.entity.AcctPatInfo" >
update account_pat_info
set name = #{name,jdbcType=VARCHAR},
mobile_phone = #{mobilePhone,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
register_product = #{registerProduct,jdbcType=INTEGER},
register_source = #{registerSource,jdbcType=INTEGER},
birthday = #{birthday,jdbcType=DATE},
age = #{age,jdbcType=INTEGER},
sex = #{sex,jdbcType=TINYINT},
id_card = #{idCard,jdbcType=VARCHAR},
reg_time = #{regTime,jdbcType=TIMESTAMP},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
created_id = #{createdId,jdbcType=INTEGER},
created_time = #{createdTime,jdbcType=TIMESTAMP},
modified_id = #{modifiedId,jdbcType=INTEGER},
modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByCondition" resultMap="BaseResultMap" parameterType="com.pica.cloud.account.account.server.entity.AcctPatInfo" >
select
<include refid="Base_Column_List" />
from account_pat_info
where delete_flag = 1
<if test="mobilePhone != null" >
AND mobile_phone = #{mobilePhone,jdbcType=VARCHAR}
</if>
</select>
<select id="getListByMobiles" resultMap="BaseResultMap" parameterType="java.util.List" >
select
<include refid="Base_Column_List" />
from account_pat_info
where delete_flag = 1
and mobile_phone IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
<insert id="initBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
insert into account_pat_info(
name, mobile_phone,
password, register_product,register_source,
birthday, age, sex,id_card,reg_time,
delete_flag, created_id, created_time,
modified_id, modified_time
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.name},#{item.mobilePhone},
null,2,6,
null,null,null,null,now(),
1,99999999,now(),
99999999,now()
)
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?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.pica.cloud.account.account.server.mapper.AcctPatUnionMapper" >
<resultMap id="BaseResultMap" type="com.pica.cloud.account.account.server.entity.AcctPatUnion" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="acct_id" property="acctId" jdbcType="INTEGER" />
<result column="union_type" property="unionType" jdbcType="INTEGER" />
<result column="union_id" property="unionId" jdbcType="VARCHAR" />
<result column="delete_flag" property="deleteFlag" jdbcType="INTEGER" />
<result column="created_id" property="createdId" jdbcType="INTEGER" />
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP" />
<result column="modified_id" property="modifiedId" jdbcType="INTEGER" />
<result column="modified_time" property="modifiedTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
id, acct_id, union_type, union_id, delete_flag, created_id, created_time, modified_id,
modified_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from account_pat_union
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from account_pat_union
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.AcctPatUnion" >
insert into account_pat_union (id, acct_id, union_type,
union_id, delete_flag, created_id,
created_time, modified_id, modified_time
)
values (#{id,jdbcType=INTEGER}, #{acctId,jdbcType=INTEGER}, #{unionType,jdbcType=INTEGER},
#{unionId,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER}, #{createdId,jdbcType=INTEGER},
#{createdTime,jdbcType=TIMESTAMP}, #{modifiedId,jdbcType=INTEGER}, #{modifiedTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.pica.cloud.account.account.server.entity.AcctPatUnion" >
insert into account_pat_union
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="acctId != null" >
acct_id,
</if>
<if test="unionType != null" >
union_type,
</if>
<if test="unionId != null" >
union_id,
</if>
<if test="deleteFlag != null" >
delete_flag,
</if>
<if test="createdId != null" >
created_id,
</if>
<if test="createdTime != null" >
created_time,
</if>
<if test="modifiedId != null" >
modified_id,
</if>
<if test="modifiedTime != null" >
modified_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="acctId != null" >
#{acctId,jdbcType=INTEGER},
</if>
<if test="unionType != null" >
#{unionType,jdbcType=INTEGER},
</if>
<if test="unionId != null" >
#{unionId,jdbcType=VARCHAR},
</if>
<if test="deleteFlag != null" >
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createdId != null" >
#{createdId,jdbcType=INTEGER},
</if>
<if test="createdTime != null" >
#{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedId != null" >
#{modifiedId,jdbcType=INTEGER},
</if>
<if test="modifiedTime != null" >
#{modifiedTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.pica.cloud.account.account.server.entity.AcctPatUnion" >
update account_pat_union
<set >
<if test="acctId != null" >
acct_id = #{acctId,jdbcType=INTEGER},
</if>
<if test="unionType != null" >
union_type = #{unionType,jdbcType=INTEGER},
</if>
<if test="unionId != null" >
union_id = #{unionId,jdbcType=VARCHAR},
</if>
<if test="deleteFlag != null" >
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createdId != null" >
created_id = #{createdId,jdbcType=INTEGER},
</if>
<if test="createdTime != null" >
created_time = #{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedId != null" >
modified_id = #{modifiedId,jdbcType=INTEGER},
</if>
<if test="modifiedTime != null" >
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.pica.cloud.account.account.server.entity.AcctPatUnion" >
update account_pat_union
set acct_id = #{acctId,jdbcType=INTEGER},
union_type = #{unionType,jdbcType=INTEGER},
union_id = #{unionId,jdbcType=VARCHAR},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
created_id = #{createdId,jdbcType=INTEGER},
created_time = #{createdTime,jdbcType=TIMESTAMP},
modified_id = #{modifiedId,jdbcType=INTEGER},
modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByUnionId" parameterType="java.lang.String" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from account_pat_union
where union_id = #{unionId,jdbcType=VARCHAR}
and delete_flag = 1;
</select>
<select id="selectByAcctId" parameterType="java.lang.Integer" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from account_pat_union
where acct_id = #{acctId,jdbcType=INTEGER}
and delete_flag = 1;
</select>
<insert id="initBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
insert into account_pat_union(
acct_id, union_type, union_id,
delete_flag, created_id, created_time,
modified_id, modified_time
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.acctId},#{item.unionType},#{item.unionId},
1,99999999,now(),
99999999,now()
)
</foreach>
</insert>
</mapper>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册