Commit 9e21787f by 翁国栋

保单批量投保接口

运营后台
parent 2304e69a
package cn.timer.api.bean.adminaccount;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Table;
import java.util.Date;
/**
* 管理员列表
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-14 18:24:20
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "admin_account")
@ApiModel("APP更新记录")
public class AdminAccount extends Model<AdminAccount> {
private static final long serialVersionUID = 1L;
/**
*
*/
private Integer id;
/**
* 姓名
*/
private String realname;
/**
* 电话
*/
private String tel;
/**
* 级别 1超级管理员 2普通管理员
*/
private Integer types;
/**
* 创建者id,0表示系统创建
*/
private Integer createrid;
/**
* 创建日期
*/
private Date createtime;
/**
* 所属部门
*/
private String department;
/**
* 分组
*/
private Integer groupid;
/**
* 状态 1 正常 0 禁用
*/
private Integer statu;
/**
* 标注
*/
private String mark;
/**
* 帐号,首次注册手机号码
*/
private String account;
/**
* 登录密码
*/
private String pwd;
/**
* 头像名称,访问地址需要拼接
*/
private String avatar;
/**
* 1 内部(优领) 2外部(分销商)
*/
private Integer category;
/**
* 登录密码错误次数,大于5次将禁用
*/
private Integer lfc;
/**
* 禁用时间
*/
private Date prohibittime;
/**
* 登录ip
*/
private String ip;
/**
* 登录时间
*/
private Date logintime;
/**
* 更新时间
*/
private Date updatetime;
/**
* 设置:
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取:
*/
public Integer getId() {
return id;
}
/**
* 设置:姓名
*/
public void setRealname(String realname) {
this.realname = realname;
}
/**
* 获取:姓名
*/
public String getRealname() {
return realname;
}
/**
* 设置:电话
*/
public void setTel(String tel) {
this.tel = tel;
}
/**
* 获取:电话
*/
public String getTel() {
return tel;
}
/**
* 设置:级别 1超级管理员 2普通管理员
*/
public void setTypes(Integer types) {
this.types = types;
}
/**
* 获取:级别 1超级管理员 2普通管理员
*/
public Integer getTypes() {
return types;
}
/**
* 设置:创建者id,0表示系统创建
*/
public void setCreaterid(Integer createrid) {
this.createrid = createrid;
}
/**
* 获取:创建者id,0表示系统创建
*/
public Integer getCreaterid() {
return createrid;
}
/**
* 设置:创建日期
*/
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
/**
* 获取:创建日期
*/
public Date getCreatetime() {
return createtime;
}
/**
* 设置:所属部门
*/
public void setDepartment(String department) {
this.department = department;
}
/**
* 获取:所属部门
*/
public String getDepartment() {
return department;
}
/**
* 设置:分组
*/
public void setGroupid(Integer groupid) {
this.groupid = groupid;
}
/**
* 获取:分组
*/
public Integer getGroupid() {
return groupid;
}
/**
* 设置:状态 1 正常 0 禁用
*/
public void setStatu(Integer statu) {
this.statu = statu;
}
/**
* 获取:状态 1 正常 0 禁用
*/
public Integer getStatu() {
return statu;
}
/**
* 设置:标注
*/
public void setMark(String mark) {
this.mark = mark;
}
/**
* 获取:标注
*/
public String getMark() {
return mark;
}
/**
* 设置:帐号,首次注册手机号码
*/
public void setAccount(String account) {
this.account = account;
}
/**
* 获取:帐号,首次注册手机号码
*/
public String getAccount() {
return account;
}
/**
* 设置:登录密码
*/
public void setPwd(String pwd) {
this.pwd = pwd;
}
/**
* 获取:登录密码
*/
public String getPwd() {
return pwd;
}
/**
* 设置:头像名称,访问地址需要拼接
*/
public void setAvatar(String avatar) {
this.avatar = avatar;
}
/**
* 获取:头像名称,访问地址需要拼接
*/
public String getAvatar() {
return avatar;
}
/**
* 设置:1 内部(优领) 2外部(分销商)
*/
public void setCategory(Integer category) {
this.category = category;
}
/**
* 获取:1 内部(优领) 2外部(分销商)
*/
public Integer getCategory() {
return category;
}
/**
* 设置:登录密码错误次数,大于5次将禁用
*/
public void setLfc(Integer lfc) {
this.lfc = lfc;
}
/**
* 获取:登录密码错误次数,大于5次将禁用
*/
public Integer getLfc() {
return lfc;
}
/**
* 设置:禁用时间
*/
public void setProhibittime(Date prohibittime) {
this.prohibittime = prohibittime;
}
/**
* 获取:禁用时间
*/
public Date getProhibittime() {
return prohibittime;
}
/**
* 设置:登录ip
*/
public void setIp(String ip) {
this.ip = ip;
}
/**
* 获取:登录ip
*/
public String getIp() {
return ip;
}
/**
* 设置:登录时间
*/
public void setLogintime(Date logintime) {
this.logintime = logintime;
}
/**
* 获取:登录时间
*/
public Date getLogintime() {
return logintime;
}
/**
* 设置:更新时间
*/
public void setUpdatetime(Date updatetime) {
this.updatetime = updatetime;
}
/**
* 获取:更新时间
*/
public Date getUpdatetime() {
return updatetime;
}
}
package cn.timer.api.bean.insure;
import lombok.Data;
import java.io.Serializable;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/3 8:48
*/
@Data
public class CallBack implements Serializable {
private static final long serialVersionUID = 61499950876094044L;
private String status;
private String policy_status;
private String err_msg;
private String policy_no;
private String serial_number;
private String quote_trans_id;
private String serial_no;
private String policy_file;
private String total_expenditure;
}
package cn.timer.api.bean.insure;
import cn.timer.api.bean.htzz.HtzzAssoZztx;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
* 投保人
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-08 16:05:26
*/
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "insure_applicant")
@ApiModel("投保人")
public class InsureApplicant extends Model<InsureApplicant> {
private static final long serialVersionUID = 1L;
/**
* id
*/
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号")
private Integer id;
/**
* 企业/网点名称
*/
@ApiModelProperty(value = "目录名称")
private String applicantEName;
/**
* 企业/网点地址
*/
@ApiModelProperty(value = "企业/网点地址")
private String applicantEAddress;
/**
* 人员清单
*/
@ApiModelProperty(value = "人员清单")
private String applicantEmployeeList;
/**
* 企业授权操作人姓名
*/
@ApiModelProperty(value = "企业授权操作人姓名")
private String applicantEContacts;
/**
* 操作人的联系电话
*/
@ApiModelProperty(value = "操作人的联系电话")
private String applicantEPhone;
/**
* 企业证件类型:3646、统一社会信用代码 3924、组织机构代码
*/
@ApiModelProperty(value = "企业证件类型")
private String applicantENoType;
/**
* 企业证件号码
*/
@ApiModelProperty(value = "企业证件号码")
private String applicantENo;
/**
* 企业邮箱
*/
@ApiModelProperty(value = "企业邮箱")
private String applicantEMail;
/**
* 省市区
*/
@ApiModelProperty(value = "省市区")
private String applicantProvinceCity;
/**
* 发票收件地址
*/
@ApiModelProperty(value = "发票收件地址")
private String applicantInvoiceReceivingAddress;
/**
* 发票开票电话
*/
@ApiModelProperty(value = "发票开票电话")
private String applicantInvoiceBillingPhone;
/**
* 企业开户行名称
*/
@ApiModelProperty(value = "企业开户行名称")
private String applicantBusinessBankName;
/**
* 保单号
*/
@ApiModelProperty(value = "保单号")
private String policyNo;
/**
* 投保类型:1个人 2 企业
*/
@ApiModelProperty(value = "投保类型")
private String applicantType;
/**
* 报价请求流水号
*/
@ApiModelProperty(value = "报价请求流水号")
private String transId;
/**
* 报价号
*/
@ApiModelProperty(value = "报价号")
private String currency;
/**
* 发票开票金额
*/
@ApiModelProperty(value = "发票开票金额")
private String applicantInvoicedAmount;
@ApiModelProperty(value = "企业id", example = "")
private Integer orgCode;
/**
* 设置:id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 设置:企业/网点名称
*/
public void setApplicantEName(String applicantEName) {
this.applicantEName = applicantEName;
}
/**
* 获取:企业/网点名称
*/
public String getApplicantEName() {
return applicantEName;
}
/**
* 设置:企业/网点地址
*/
public void setApplicantEAddress(String applicantEAddress) {
this.applicantEAddress = applicantEAddress;
}
/**
* 获取:企业/网点地址
*/
public String getApplicantEAddress() {
return applicantEAddress;
}
/**
* 设置:人员清单
*/
public void setApplicantEmployeeList(String applicantEmployeeList) {
this.applicantEmployeeList = applicantEmployeeList;
}
/**
* 获取:人员清单
*/
public String getApplicantEmployeeList() {
return applicantEmployeeList;
}
/**
* 设置:企业授权操作人姓名
*/
public void setApplicantEContacts(String applicantEContacts) {
this.applicantEContacts = applicantEContacts;
}
/**
* 获取:企业授权操作人姓名
*/
public String getApplicantEContacts() {
return applicantEContacts;
}
/**
* 设置:操作人的联系电话
*/
public void setApplicantEPhone(String applicantEPhone) {
this.applicantEPhone = applicantEPhone;
}
/**
* 获取:操作人的联系电话
*/
public String getApplicantEPhone() {
return applicantEPhone;
}
/**
* 设置:企业证件类型:3646、统一社会信用代码 3924、组织机构代码
*/
public void setApplicantENoType(String applicantENoType) {
this.applicantENoType = applicantENoType;
}
/**
* 获取:企业证件类型:3646、统一社会信用代码 3924、组织机构代码
*/
public String getApplicantENoType() {
return applicantENoType;
}
/**
* 设置:企业证件号码
*/
public void setApplicantENo(String applicantENo) {
this.applicantENo = applicantENo;
}
/**
* 获取:企业证件号码
*/
public String getApplicantENo() {
return applicantENo;
}
/**
* 设置:企业邮箱
*/
public void setApplicantEMail(String applicantEMail) {
this.applicantEMail = applicantEMail;
}
/**
* 获取:企业邮箱
*/
public String getApplicantEMail() {
return applicantEMail;
}
/**
* 设置:省市区
*/
public void setApplicantProvinceCity(String applicantProvinceCity) {
this.applicantProvinceCity = applicantProvinceCity;
}
/**
* 获取:省市区
*/
public String getApplicantProvinceCity() {
return applicantProvinceCity;
}
/**
* 设置:发票收件地址
*/
public void setApplicantInvoiceReceivingAddress(String applicantInvoiceReceivingAddress) {
this.applicantInvoiceReceivingAddress = applicantInvoiceReceivingAddress;
}
/**
* 获取:发票收件地址
*/
public String getApplicantInvoiceReceivingAddress() {
return applicantInvoiceReceivingAddress;
}
/**
* 设置:发票开票电话
*/
public void setApplicantInvoiceBillingPhone(String applicantInvoiceBillingPhone) {
this.applicantInvoiceBillingPhone = applicantInvoiceBillingPhone;
}
/**
* 获取:发票开票电话
*/
public String getApplicantInvoiceBillingPhone() {
return applicantInvoiceBillingPhone;
}
/**
* 设置:企业开户行名称
*/
public void setApplicantBusinessBankName(String applicantBusinessBankName) {
this.applicantBusinessBankName = applicantBusinessBankName;
}
/**
* 获取:企业开户行名称
*/
public String getApplicantBusinessBankName() {
return applicantBusinessBankName;
}
/**
* 设置:保单号
*/
public void setPolicyNo(String policyNo) {
this.policyNo = policyNo;
}
/**
* 获取:保单号
*/
public String getPolicyNo() {
return policyNo;
}
/**
* 设置:投保类型:1个人 2 企业
*/
public void setApplicantType(String applicantType) {
this.applicantType = applicantType;
}
/**
* 获取:投保类型:1个人 2 企业
*/
public String getApplicantType() {
return applicantType;
}
/**
* 设置:报价请求流水号
*/
public void setTransId(String transId) {
this.transId = transId;
}
/**
* 获取:报价请求流水号
*/
public String getTransId() {
return transId;
}
/**
* 设置:报价号
*/
public void setCurrency(String currency) {
this.currency = currency;
}
/**
* 获取:报价号
*/
public String getCurrency() {
return currency;
}
/**
* 设置:发票开票金额
*/
public void setApplicantInvoicedAmount(String applicantInvoicedAmount) {
this.applicantInvoicedAmount = applicantInvoicedAmount;
}
/**
* 获取:发票开票金额
*/
public String getApplicantInvoicedAmount() {
return applicantInvoicedAmount;
}
public Integer getOrgCode() {
return orgCode;
}
public void setOrgCode(Integer orgCode) {
this.orgCode = orgCode;
}
}
package cn.timer.api.bean.insure;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
* 保单信息
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-14 08:53:04
*/
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "insure_policy")
@ApiModel("保单信息")
public class InsurePolicy extends Model<InsurePolicy> {
private static final long serialVersionUID = 1L;
/**
*
*/
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号")
private Integer id;
/**
* 方案名称(必选)
*/
private String schemeName;
/**
* 保单生效日
*/
private Date policyDateStart;
/**
* 保单终止日
*/
private Date policyDateEnd;
/**
* 产品代码
*/
private String productCodeId;
/**
* 计划代码
*/
private String planCodeId;
/**
* 分销商pid
*/
private String partnerPid;
/**
* 保单号
*/
private String policyNo;
/**
* 保单类型:1、年单 2、月单
*/
private Integer type;
/**
* 5-人民币,其他币种请参见全局数据字典
*/
private String currency;
/**
* 总保费
*/
private String totalPremium;
/**
* 1-正常
*/
private String status;
/**
* 电子保单
*/
private String policyFile;
/**
* 保单kit的地址
*/
private String kitUrl;
/**
* 投保人id
*/
private Integer insureApplicantId;
/**
* 企业id
*/
private Integer orgCode;
/**
* 投保时间
*/
private Date createTime;
/**
* 最近操作时间
*/
private Date updateTime;
/**
* 设置:
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取:
*/
public Integer getId() {
return id;
}
/**
* 设置:方案名称(必选)
*/
public void setSchemeName(String schemeName) {
this.schemeName = schemeName;
}
/**
* 获取:方案名称(必选)
*/
public String getSchemeName() {
return schemeName;
}
/**
* 设置:保单生效日
*/
public void setPolicyDateStart(Date policyDateStart) {
this.policyDateStart = policyDateStart;
}
/**
* 获取:保单生效日
*/
public Date getPolicyDateStart() {
return policyDateStart;
}
/**
* 设置:保单终止日
*/
public void setPolicyDateEnd(Date policyDateEnd) {
this.policyDateEnd = policyDateEnd;
}
/**
* 获取:保单终止日
*/
public Date getPolicyDateEnd() {
return policyDateEnd;
}
/**
* 设置:产品代码
*/
public void setProductCodeId(String productCodeId) {
this.productCodeId = productCodeId;
}
/**
* 获取:产品代码
*/
public String getProductCodeId() {
return productCodeId;
}
/**
* 设置:计划代码
*/
public void setPlanCodeId(String planCodeId) {
this.planCodeId = planCodeId;
}
/**
* 获取:计划代码
*/
public String getPlanCodeId() {
return planCodeId;
}
/**
* 设置:分销商pid
*/
public void setPartnerPid(String partnerPid) {
this.partnerPid = partnerPid;
}
/**
* 获取:分销商pid
*/
public String getPartnerPid() {
return partnerPid;
}
/**
* 设置:保单号
*/
public void setPolicyNo(String policyNo) {
this.policyNo = policyNo;
}
/**
* 获取:保单号
*/
public String getPolicyNo() {
return policyNo;
}
/**
* 设置:保单类型:1、年单 2、月单
*/
public void setType(Integer type) {
this.type = type;
}
/**
* 获取:保单类型:1、年单 2、月单
*/
public Integer getType() {
return type;
}
/**
* 设置:5-人民币,其他币种请参见全局数据字典
*/
public void setCurrency(String currency) {
this.currency = currency;
}
/**
* 获取:5-人民币,其他币种请参见全局数据字典
*/
public String getCurrency() {
return currency;
}
/**
* 设置:总保费
*/
public void setTotalPremium(String totalPremium) {
this.totalPremium = totalPremium;
}
/**
* 获取:总保费
*/
public String getTotalPremium() {
return totalPremium;
}
/**
* 设置:1-正常
*/
public void setStatus(String status) {
this.status = status;
}
/**
* 获取:1-正常
*/
public String getStatus() {
return status;
}
/**
* 设置:电子保单
*/
public void setPolicyFile(String policyFile) {
this.policyFile = policyFile;
}
/**
* 获取:电子保单
*/
public String getPolicyFile() {
return policyFile;
}
/**
* 设置:保单kit的地址
*/
public void setKitUrl(String kitUrl) {
this.kitUrl = kitUrl;
}
/**
* 获取:保单kit的地址
*/
public String getKitUrl() {
return kitUrl;
}
/**
* 设置:投保人id
*/
public void setInsureApplicantId(Integer insureApplicantId) {
this.insureApplicantId = insureApplicantId;
}
/**
* 获取:投保人id
*/
public Integer getInsureApplicantId() {
return insureApplicantId;
}
/**
* 设置:企业id
*/
public void setOrgCode(Integer orgCode) {
this.orgCode = orgCode;
}
/**
* 获取:企业id
*/
public Integer getOrgCode() {
return orgCode;
}
/**
* 设置:投保时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 获取:投保时间
*/
public Date getCreateTime() {
return createTime;
}
}
package cn.timer.api.bean.insure;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Transient;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
* 被保人
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-11 09:06:53
*/
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "insure_user")
@ApiModel("被保人")
public class InsureUser extends Model<InsureUser> {
private static final long serialVersionUID = 1L;
/**
* id
*/
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号")
private Integer id;
/**
* 被保险人请求流水号
*/
@ApiModelProperty(value = "被保险人请求流水号")
private String transId;
/**
* 批次核算保费
*/
@ApiModelProperty(value = "批次核算保费")
private String price;
/**
* 姓名
*/
@ApiModelProperty(value = "姓名")
private String insuredName;
/**
* 被保险人批次号
*/
@ApiModelProperty(value = "被保险人批次号")
private String batchNo;
/**
* 保单批次保费
*/
@ApiModelProperty(value = "保单批次保费")
private String premium;
/**
* 被保险人联系电话
*/
@ApiModelProperty(value = "被保险人联系电话")
private String insuredMobile;
/**
* 证件号码
*/
@ApiModelProperty(value = "证件号码")
private String insuredNo;
/**
* 联系人姓名
*/
@ApiModelProperty(value = "联系人姓名")
private String insuredEContact;
/**
* 基础计划 30万雇主/3万医疗 36968,50万雇主/5万医疗 36969,80万雇主/10万医疗 36970,80万雇主/20万医疗 36971,100万雇主/10万医疗 36972
*/
@ApiModelProperty(value = "基础计划")
private String benefitBasicPlan;
/**
* 职业类别 A类 63119 B类 63120 C类 63121
*/
@ApiModelProperty(value = "职业类别")
private String benefitOccupationCategory;
/**
* 参保人数
*/
@ApiModelProperty(value = "参保人数")
private String benefitElEmployeeNumberT;
/**
* 二、三轮车车架号(必选)
*/
@ApiModelProperty(value = "二、三轮车车架号")
private String tricycleFrameNumber;
/**
* 保单号
*/
@ApiModelProperty(value = "保单号")
private String policyNo;
/**
* 参保状态:1参保中 2已失效
*/
@ApiModelProperty(value = "参保状态")
private String status;
/**
* 被保人类型:1个人 2企业
*/
@ApiModelProperty(value = "被保人类型")
private Integer type;
/**
* 企业id
*/
@ApiModelProperty(value = "企业id")
private Integer orgCode;
/**
* 个人id
*/
@ApiModelProperty(value = "个人id")
private Integer userId;
/**
* 人员清单
*/
@ApiModelProperty(value = "人员清单")
private String applicantEmployeeList;
@ApiModelProperty(value = "生效日期")
private Date policyDateStart;
@ApiModelProperty(value = "失效日期")
private Date policyDateEnd;
@Transient
private String[] userIds;
}
package cn.timer.api.bean.insure;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/3 18:01
*/
import java.io.Serializable;
/**
* 投保订单详情
*/
public class InsuredOrderDetail implements Serializable {
private static final long serialVersionUID = -1695869258491138853L;
private String is_ss;
/**
*
*/
private String transId;
private String serialNumber;
}
......@@ -39,63 +39,63 @@ public class YgglMainEmp extends Model<YgglMainEmp> {
@TableId (type = IdType.AUTO)
@ApiModelProperty(value="员工编号 员工编号",example="101")
private Integer id;
@ApiModelProperty(value="员工工号 ",example="员工工号")
private Integer empNum;
@ApiModelProperty(value="手机号码 手机号码",example="101")
private String phone;
@ApiModelProperty(value="密码 ",example="密码")
private String password;
@ApiModelProperty(value="头像 ",example="base64来处理头像")
private String headUrl;
@ApiModelProperty(value="名称 ",example="名称")
private String name;
@ApiModelProperty(value="英文名称 ",example="英文名称")
private String englishName;
@ApiModelProperty(value="性别 0:男;1:女",example="0")
private Integer sex;
@ApiModelProperty(value="证件类型 0:身份证;1:港澳居民来往内地通行证;2:台湾居民来往大陆通行证;3:外国护照;4:其他",example="101")
private Integer zjType;
@ApiModelProperty(value="证件号码 ",example="证件号码")
private String zjNum;
@ApiModelProperty(value="身份证有效期 ",example="身份证有效到期日")
private Date sfzyxTime;
@ApiModelProperty(value="出生日期 ",example="出生日期")
private Date birthday;
@ApiModelProperty(value="年龄 年龄",example="101")
private Integer age;
@ApiModelProperty(value="是否已婚 0:否、1:是",example="101")
private Integer isMarried;
@ApiModelProperty(value="是否已育 0:否、1:是",example="101")
private Integer isPregnant;
@ApiModelProperty(value="国家地区 0:中国;1:中国香港;2:中国澳门;3:中国台湾",example="101")
private Integer area;
@ApiModelProperty(value="民族 56个名族",example="101")
private Integer mz;
@ApiModelProperty(value="政治面貌 1:中共党员;2:中共预备党员;3共青团员;4:民革党员;5:民盟盟员;6:民建会员;7:民进会员;8:农工党党员;9:致公党党员;10:九三学社社员;11:台盟盟员;12:无党派人士;13:群众",example="101")
private Integer zzmm;
@ApiModelProperty(value="籍贯 省",example="101")
private String jg;
@ApiModelProperty(value="籍贯 省id",example="101")
private String jgId;
@ApiModelProperty(value = "省")
private String province;
@ApiModelProperty(value = "省id")
......@@ -108,113 +108,113 @@ public class YgglMainEmp extends Model<YgglMainEmp> {
private String district;
@ApiModelProperty(value = "区编号")
private String districtId;
@ApiModelProperty(value="户口性质 1:城镇户口;2:农村户口;3:居民户口",example="101")
private Integer hkType;
@ApiModelProperty(value="户籍地址 ",example="详细地址")
private String hkAddress;
@ApiModelProperty(value="QQ QQ",example="101")
private Integer qq;
@ApiModelProperty(value="微信 ",example="微信")
private String wechat;
// @ApiModelProperty(value="个人邮箱 ",example="个人邮箱")
// private String email;
@ApiModelProperty(value="血型 ",example="血型")
private String bloodType;
@ApiModelProperty(value="语言 ",example="语言")
private String language;
@ApiModelProperty(value="最高学历 1:小学;2:初中;3:高中;4:中专;5:大专;6:本科;7:研究生;8:硕士;9:博士;",example="101")
private Integer edu;
@ApiModelProperty(value="专业 ",example="专业")
private String zy;
@ApiModelProperty(value="转正备注 ",example="转正备注")
private String zzRemark;
@ApiModelProperty(value="工作性质 0全职、1实习、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘",example="101")
private Integer jobType;
@ApiModelProperty(value="员工状态 0试用、1正式、2离职中、3已离职",example="101")
private Integer jobStatus;
@ApiModelProperty(value="入职日期 ",example="客户注册后的时间为入职时间")
private Date rzTime;
@ApiModelProperty(value="试用期 0:无试用期;1:1个月;2:2个月;3:3个月;4:4个月;5:5个月;6:6个月(有试用期显示选项)",example="101")
private Integer syq;
@ApiModelProperty(value="应转正日期 ",example="人事记录要自动转正的日期")
private Date zzTime;
@ApiModelProperty(value="实际转正日期 ",example="人事手动记录要转正的日期")
private Date sjzzTime;
@ApiModelProperty(value="是否计入考勤 0:否;1:是",example="101")
private Integer isJrkq;
@ApiModelProperty(value="公司内部工号 就是公司内部自己设置的工号",example="101")
private String jobNum;
@ApiModelProperty(value="工作地点 ",example="工作地点")
private String workAddress;
@ApiModelProperty(value="工作电话 工作电话",example="101")
private Integer workPhone;
@ApiModelProperty(value="工作邮箱 ",example="工作邮箱")
private String workEmail;
@ApiModelProperty(value="招聘渠道 招聘渠道应该是活性的",example="101")
private Integer zpqd;
@ApiModelProperty(value="部门岗位id 部门岗位id",example="101")
private Integer bmgwId;
@ApiModelProperty(value="部门名称",example="")
private String bmgwName;
@ApiModelProperty(value="修改时间",example="修改时间")
private Date updateTime;
@ApiModelProperty(value="修改人",example="修改人")
private Integer updateMan;
@ApiModelProperty(value="组织机构代码 组织机构代码",example="101")
private Integer orgCode;
@ApiModelProperty(value="微信id",example="UnionID微信系统唯一id")
private String unionid;
@ApiModelProperty(value="公众号id",example="openid公众号唯一id")
private String openid;
@ApiModelProperty(value="小程序id",example="mpopenid小程序")
private String mpopenid;
@ApiModelProperty(value="手机APPid",example="appopenid手机app")
private String appopenid;
// @ApiModelProperty(value="是否企业中心管理员 ",example="0-否 1-主账号 2-子账号")
// private Integer isManager;
@ApiModelProperty(value="离职前状态 1试用、2正式 ",example="1试用、2正式")
private Integer beforeLeavingSts;
@ApiModelProperty(value="自定义工号",example="")
private String customNum;
@Transient
@TableField(exist = false)
private String workTime;//工龄
@Transient
@TableField(exist = false)
private String error;//错误信息提示
......@@ -223,7 +223,8 @@ public class YgglMainEmp extends Model<YgglMainEmp> {
@TableField(exist = false)
@ApiModelProperty(value="员工登陆账号(手机号)",example="员工登陆账号(手机号)")
private String empLoginPhone;
}
\ No newline at end of file
@ApiModelProperty(value="是否已投保:0否 1是",example="")
private int isInsure;
}
......@@ -27,22 +27,22 @@ public class RedisSessionInterceptor implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception {
// response.setHeader("Access-Control-Allow-Origin","http://120.24.24.239:8088");
//// response.setHeader("Access-Control-Allow-Origin",request.getHeader("Origin"));
// response.setHeader("Access-Control-Allow-Methods", "*");
// response.setHeader("Access-Control-Allow-Credentials", "true");
// response.setHeader("Access-Control-Allow-Headers", "*");
//
//
// System.out.print("request.Origin>"+request.getHeader("Origin"));
// //option预检查,直接通过请求
// if ("OPTIONS".equals(request.getMethod())){
// return true;
// }
/*
* Enumeration<String> names = request.getHeaderNames();
* while(names.hasMoreElements()) { String name = (String)names.nextElement();
......@@ -50,8 +50,10 @@ public class RedisSessionInterceptor implements HandlerInterceptor {
* value); }
*/
// 无论访问的地址是不是正确的,都进行登录验证,登录成功后的访问再进行分发,404的访问自然会进入到错误控制器中
HttpSession session = request.getSession();
if(session.getAttribute("ui")==null) {
HttpSession session = request.getSession();
Object ai = session.getAttribute("ai");
Object ui = session.getAttribute("ui");
if(session.getAttribute("ui")==null&&session.getAttribute("ai")==null) {
response401(response);
return false;
}
......@@ -71,7 +73,7 @@ public class RedisSessionInterceptor implements HandlerInterceptor {
// response401(response);
return true;
}
private void response401(HttpServletResponse response) {
......
......@@ -19,10 +19,10 @@ import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
@Configuration
public class WebSecurityConfig implements WebMvcConfigurer {
@Resource
private UserMethodArgumentResolver userMethodArgumentResolver;
@Bean
public RedisSessionInterceptor getSessionInterceptor() {
return new RedisSessionInterceptor();
......@@ -30,12 +30,14 @@ public class WebSecurityConfig implements WebMvcConfigurer {
@Override
public void addInterceptors(InterceptorRegistry registry) {
// 所有已api开头的访问都要进入RedisSessionInterceptor拦截器进行登录验证,并排除login接口(全路径)。必须写成链式,分别设置的话会创建多个拦截器。
// 所有已api开头的访问都要进入RedilsSessionInterceptor拦截器进行登录验证,并排除login接口(全路径)。必须写成链式,分别设置的话会创建多个拦截器。
// 必须写成getSessionInterceptor(),否则SessionInterceptor中的@Autowired会无效
//.excludePathPatterns("/")
registry.addInterceptor(getSessionInterceptor())
.addPathPatterns("/**")
.excludePathPatterns("/callback/**")
.excludePathPatterns("/callBack/policy/**")
.excludePathPatterns("/superLogin/**")
.excludePathPatterns("/actuator/*")
.excludePathPatterns("/doc*")
.excludePathPatterns("/v2/**")
......@@ -53,14 +55,14 @@ public class WebSecurityConfig implements WebMvcConfigurer {
.excludePathPatterns("/check/**");
// registry.addInterceptor(getSessionInterceptor()).addPathPatterns("/**").excludePathPatterns("/swagger-ui*");
}
/**
* 配置消息转换器--这里我用的是alibaba 开源的 fastjson
* @param converters
*/
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
// Iterator<HttpMessageConverter<?>> iterator = converters.iterator();
// while(iterator.hasNext()){
// HttpMessageConverter<?> converter = iterator.next();
......@@ -107,12 +109,12 @@ public class WebSecurityConfig implements WebMvcConfigurer {
converters.add(0,fastConverter);
}
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
argumentResolvers.add(userMethodArgumentResolver);
}
// @Override
// public void addCorsMappings(CorsRegistry registry) {
//// System.out.println("我是MyWebConfig跨域");
......
package cn.timer.api.controller.insure;
import cn.timer.api.bean.insure.CallBack;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.security.auth.callback.Callback;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/3 8:45
*/
@Api(tags = "8.0回调接口")
@RestController
@Transactional
@RequestMapping(value = "/callBack/policy", produces = {"application/json"})
public class CallBackContorll {
private static final Logger log = LoggerFactory.getLogger(CallBackContorll.class);
@PostMapping(value = "/insuredCallBack")
@ApiOperation(value = "6.投保申请回调", httpMethod = "Post", notes = "投保申请回调")
@ApiOperationSupport(order = 2)
private Integer callBack(@RequestParam String pid, @RequestParam String sign, @RequestParam String timestamp, @RequestBody CallBack callBack){
log.info(String.valueOf(callBack));
return 1;
}
}
package cn.timer.api.controller.insure;
import java.io.IOException;
import java.util.Map;
import java.util.Optional;
import java.util.Random;
import cn.timer.api.bean.insure.InsureApplicant;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.dao.insure.InsureApplicantMapper;
import cn.timer.api.dto.insure.InsureDto;
import cn.timer.api.utils.HttpUtils;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import com.alibaba.druid.util.Base64;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Maps;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.apache.commons.codec.digest.DigestUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
/**
* 投保人
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-07 17:02:46
*/
@Api(tags = "23.0保险列表")
@RestController
@Transactional
@RequestMapping(value = "/insureApplicant", produces = {"application/json"})
public class InsureApplicantController {
private static final Logger log = LoggerFactory.getLogger(InsureApplicantController.class);
@Autowired
private InsureApplicantMapper insureApplicantMapper;
@Value("insure.type.test.appid")
private String appid;
@Value("insure.type.test.secret")
private String secret;
@Value("insure.type.test.appidq")
private String appidq;
@Value("insure.type.test.secretq")
private String secretq;
@Value("insure.type.test.uploadUrl")
private String uploadUrl;
@Value("insure.type.test.insuredUrl")
private String insuredUrl;
@Value("insure.type.test.uploadUrlq")
private String uploadUrl2;
@PostMapping("/insureApplicationSetting")
@ApiOperation(value = "设置投保人", httpMethod = "POST", notes = "投保申请")
private Result<Object> insureApplicationSetting(@CurrentUser UserBean userBean, @RequestBody InsureApplicant params) {
InsureApplicant insureApplicant = InsureApplicant.builder().build().selectOne(new QueryWrapper<InsureApplicant>().lambda().eq(InsureApplicant::getOrgCode,userBean.getOrgCode()));
if(insureApplicant==null){
params.insert();
return ResultUtil.data(params);
}
BeanUtils.copyProperties(params,insureApplicant);
insureApplicant.updateById();
return ResultUtil.data(insureApplicant);
}
@PostMapping("/getApplicant")
@ApiOperation(value = "获取投保人", httpMethod = "POST", notes = "获取投保人")
private Result<Object> getApplicant(@CurrentUser UserBean userBean) {
InsureApplicant insureApplicant = InsureApplicant.builder().build().selectOne(new QueryWrapper<InsureApplicant>().lambda().eq(InsureApplicant::getOrgCode,userBean.getOrgCode()));
if(insureApplicant==null){
return ResultUtil.data(null);
}
return ResultUtil.data(insureApplicant);
}
/**
* 设置链接参数
*
* @param sign
* @return
*/
private Map setParams(String sign) {
/*当前时间戳*/
long timestamp = System.currentTimeMillis()/1000;
log.info("时间戳" + timestamp);
Map paramsMap = Maps.newHashMap();
paramsMap.put("pid", appidq);
paramsMap.put("timestamp", String.valueOf(timestamp));
paramsMap.put("trace_id", appidq + timestamp + new Random().nextInt((9999 - 100) + 1) + 10);
// paramsMap.put("sign",Md5.md5(appid+secret+timestamp+sign.trim()));
String value = appidq + secretq + timestamp + sign;
log.info("body参数======" + sign);
paramsMap.put("sign", DigestUtils.md5Hex(value));
log.info("params参数======" + JSONObject.toJSONString(paramsMap));
return paramsMap;
}
/**
* 设置返回信息
*
* @param data
* @return
*/
private Object message(String data) {
Map<String, Object> dataMap = JSONObject.parseObject(data);
if (dataMap.get("errcode").toString().equals("suc")) {
return dataMap.get("data");
}
return dataMap.get("errmsg");
}
}
package cn.timer.api.controller.insure;
//import cn.timer.api.bean.insure.InsuredUser;
import cn.timer.api.bean.crm.CrmBusinessGroupMember;
import cn.timer.api.bean.insure.InsurePolicy;
import cn.timer.api.bean.insure.InsureUser;
import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.CurrentUser;
import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.controller.insure.bean.ExcelBean;
import cn.timer.api.dao.insure.InsurePolicyMapper;
import cn.timer.api.dao.insure.InsureUserMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dto.insure.InsureDto;
import cn.timer.api.dto.insure.PolicyDto;
import cn.timer.api.utils.*;
import com.alibaba.druid.util.Base64;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.beust.jcommander.internal.Lists;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
......@@ -19,12 +29,16 @@ import org.apache.commons.codec.digest.DigestUtils;
import org.apache.ibatis.annotations.Param;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
import java.net.URLEncoder;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
......@@ -65,6 +79,15 @@ public class InsureContorll {
/*测试用保全上传文件地址*/
private static String uploadUrl2 = "http://sandbox.portal.unistar-ins.com/fuli/Home/Index/file_upload";
@Autowired
private YgglMainEmpMapper ygglMainEmpMapper;
@Autowired
private InsureUserMapper insureUserMapper;
@Autowired
private InsurePolicyMapper insurePolicyMapper;
/**
* 设置请求参数
......@@ -108,9 +131,10 @@ public class InsureContorll {
@PostMapping(value = "/insured_add")
@ApiOperation(value = "1.投保申请", httpMethod = "Post", notes = "投保申请")
@ApiOperationSupport(order = 2)
public Result<Object> insured_add(@CurrentUser UserBean userBean, @RequestParam(required = true) String url) {
public Result<Object> insured_add(@CurrentUser UserBean userBean, @RequestParam(required = true) String url, @RequestBody InsureDto insureDto) {
QyzxEntInfoM qyzxEntInfoM = QyzxEntInfoM.builder().id(userBean.getOrgCode()).build().selectById(); // 企业信息
DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
DateFormat dtf3 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
LocalDateTime now = LocalDateTime.now();
Map bodyMap = Maps.newHashMap();
ArrayList<Map> quotationsArry = new ArrayList<Map>();
......@@ -131,8 +155,8 @@ public class InsureContorll {
basicMap.put("partner_pid","1231");/*分销商pid*/
basicMap.put("plan_code_id","61b85207b73d2ab09fb2959");/*计划代码,选项值:61b85207b73d2ab09fb2959 (生产环境) 61b85207b73d2ab09fb2959 (沙箱环境)*/
basicMap.put("product_code_id","61b85207a9f87da19fb5986");/*产品代码,选项值:61b85207a9f87da19fb5986 (生产环境) 61b85207a9f87da19fb5986 (沙箱环境)*/
basicMap.put("policy_date_start","2022-04-01 00:00:00");
basicMap.put("policy_date_end","2022-4-30 23:59:59");
basicMap.put("policy_date_start",insureDto.getPolicyDateStart());
basicMap.put("policy_date_end",insureDto.getPolicyDateEnd());
basicMap.put("channel","");
basicMap.put("fee","");
basicMap.put("partner_user_rate","");
......@@ -163,7 +187,7 @@ public class InsureContorll {
ArrayList<Map> insuredArray = new ArrayList<>();
Map insured = Maps.newHashMap();
insured.put("trans_id","P_"+qyzxEntInfoM.getId()+"_"+dtf2.format(now));
insured.put("price","75");
insured.put("price","75");/*根据基础计划生成*/
insured.put("insured_applicant_relations", "36960");
insured.put("insured_mobile", qyzxEntInfoM.getLinkManPhone());
insured.put("insured_e_contact", qyzxEntInfoM.getLinkMan());
......@@ -171,15 +195,11 @@ public class InsureContorll {
insured.put("insured_no_type", "3306");
insured.put("insured_no", qyzxEntInfoM.getCreditCode());
insured.put("insured_zm_openid", "");
insured.put("benefit_basic_plan", "36969");
insured.put("benefit_occupation_category", "63119");
insured.put("benefit_EL_employee_number_t", "5");
insured.put("benefit_basic_plan", insureDto.getBenefitBasicPlan());/*基础计划写死*/
insured.put("benefit_occupation_category", insureDto.getBenefitOccupationCategory());
insured.put("benefit_EL_employee_number_t",insureDto.getUserIds().length);
insuredArray.add(insured);
quotations.put("insured",insuredArray);
/*quotations.put("bd_id","");不需要*/
quotations.put("file",Lists.newArrayList());
quotations.put("specifically_agreed_file", Lists.newArrayList());
quotations.put("policy_no", "");
......@@ -188,27 +208,78 @@ public class InsureContorll {
quotationsArry.add(quotations);
bodyMap.put("quotations",quotationsArry);
log.info(JSONObject.toJSONString(bodyMap));
Object o=requestAgent(bodyMap);
return ResultUtil.data(o);
Map dataMap = requestAgent(bodyMap);
if(dataMap!=null) {
Object o = dataMap.get("data");
Map <String,Object> map= JSONObject.parseObject(JSONObject.toJSONString(o));;
List<YgglMainEmp> ygglMainEmpList=ygglMainEmpMapper.selectListByIds(insureDto.getUserIds());
Map policyMap = JSONObject.parseObject(JSONObject.toJSONString(map.get("policy")), Map.class);
InsureUser insureUser;
for (YgglMainEmp y:ygglMainEmpList) {
insureUser = InsureUser.builder().build();
insureUser.setUserId(y.getId());
insureUser.setInsuredName(qyzxEntInfoM.getName());
insureUser.setPrice("15");/*前端获取的保费*/
insureUser.setTransId("MB_"+dtf2.format(now));
insureUser.setBatchNo("P_"+qyzxEntInfoM.getId()+"_"+dtf2.format(now));
insureUser.setBenefitBasicPlan(insureDto.getBenefitBasicPlan());
insureUser.setPolicyNo(policyMap.get("policy_no").toString());
insureUser.setUserId(y.getId());
insureUser.setOrgCode(y.getOrgCode());
insureUser.setBenefitOccupationCategory(insureDto.getBenefitOccupationCategory());
insureUser.setInsuredMobile(y.getPhone());
insureUser.setInsuredNo(y.getZjNum());
insureUser.setInsuredEContact(y.getName());
insureUser.setApplicantEmployeeList(url);
insureUser.setStatus("1");
y.setIsInsure(1);
y.insertOrUpdate();
insureUser.insert();
}
InsurePolicy insurePolicy = InsurePolicy.builder().build();
try {
insurePolicy.setPolicyDateStart(dtf3.parse(insureDto.getPolicyDateStart()));
insurePolicy.setPolicyDateEnd(dtf3.parse(insureDto.getPolicyDateEnd()));
insurePolicy.setPolicyNo(policyMap.get("policy_no").toString());
insurePolicy.setType(2);/*年单或者月单*/
insurePolicy.setCurrency("5");
insurePolicy.setStatus("1");
insurePolicy.setPolicyFile(policyMap.get("policy_file").toString());
insurePolicy.setKitUrl(policyMap.get("kit_url").toString());
insurePolicy.setOrgCode(userBean.getOrgCode());
insurePolicy.setCreateTime(new Date());
insurePolicy.setSchemeName("【新】-安诚-雇主责任险(劳务公司)预付款");/*先写死*/
insurePolicy.insert();
} catch (ParseException e) {
insurePolicy.setPolicyDateStart(null);
insurePolicy.setPolicyDateEnd(null);
e.printStackTrace();
}
}
return ResultUtil.data("");
}
/*测试用生产环境不需要*/
synchronized private Object requestAgent(Map bodyMap ){
synchronized private Map requestAgent(Map bodyMap ){
String data=HttpUtils.sendPost(insuredUrl,setParams(JSONObject.toJSONString(bodyMap)),bodyMap);
Map<String,Object> dataMap = JSONObject.parseObject(data);
Map dataMap = JSONObject.parseObject(data,Map.class);
if (dataMap.get("errcode").toString().equals("suc")) {
return dataMap.get("data");
return dataMap;
}else{
if(dataMap.get("errcode").toString().equals("e1")&&dataMap.get("errmsg").toString().equals("出单中")){
try {
Thread.sleep(30000);
requestAgent(bodyMap);
Thread.sleep(60000);
return requestAgent(bodyMap);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
return dataMap.get("data");
return null;
}
}
......@@ -288,16 +359,20 @@ public class InsureContorll {
}
@GetMapping(value = "/downExcel")
@ApiOperation(value = "2.下载投保文件", httpMethod = "Get", notes = "下载投保文件")
@ApiOperation(value = "2.核保", httpMethod = "Get", notes = "下载投保文件")
@ApiOperationSupport(order = 2)
public void downExcel(@CurrentUser UserBean userBean, HttpServletRequest request, HttpServletResponse resp){
public void downExcel(@CurrentUser UserBean userBean, HttpServletRequest request, HttpServletResponse resp,@RequestParam("ids") String[] ids){
if(ids.length<=0){
return;
}
LocalDate localDate = LocalDate.now();
/*获取该企业下所有未投保员工*/
List<YgglMainEmp> ygglMainEmpList =YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode,userBean.getOrgCode())
.eq(YgglMainEmp::getIsInsure,0));
/*获取该企业下所有未投保员工 测试用*/
// List<YgglMainEmp> ygglMainEmpList =YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode,userBean.getOrgCode())
// .eq(YgglMainEmp::getIsInsure,0));
List<YgglMainEmp> ygglMainEmpList=ygglMainEmpMapper.selectListByIds(ids);
ExcelBean excelBean;
List list=Lists.newArrayList();
for (YgglMainEmp y:ygglMainEmpList.subList(0,5)) {
for (YgglMainEmp y:ygglMainEmpList) {
String[] arr =new String[]{String.valueOf(y.getId()),y.getName(),"身份证",y.getZjNum(),"50万意外/5万医疗/扩展24小时(A类)","","深圳名邦人力资源管理有限公司","无","A类"};
list.add(arr);
}
......@@ -321,7 +396,19 @@ public class InsureContorll {
e.printStackTrace();
}
}
}
@PostMapping(value = "/policyList")
@ApiOperation(value = "3.保单列表", httpMethod = "Post", notes = "保单列表")
@ApiOperationSupport(order = 2)
public Result<Object> policyList(@RequestBody PolicyDto policyDto) {
List<PolicyDto> list = insureUserMapper.selectPolicyList(String.valueOf(policyDto.getId()));
return ResultUtil.data(list);
}
@PostMapping(value = "/policyListAdmin")
@ApiOperation(value = "4.保单列表--运营后台端", httpMethod = "Post", notes = "保单列表")
@ApiOperationSupport(order = 2)
public Result<Object> policyListAdmin(@RequestBody InsurePolicy insurePolicy) {
List<PolicyDto> list = insurePolicyMapper.policyList();
return ResultUtil.data(list);
}
}
package cn.timer.api.controller.insure;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
/**
* 被保人
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-11 09:06:53
*/
@RestController
@RequestMapping("insureuser")
public class InsureUserController{
}
package cn.timer.api.controller.insure.bean;
import lombok.Data;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/10 14:28
*/
@Data
public class ExcelBean {
private String id;
private String name;
private String idType;
private String idNumber;
private String schemeName;
private String dateStart;
private String branch;
private String tricycleFrameNumber;
private String benefitOccupationCategory;
}
package cn.timer.api.controller.superadmin;
import cn.timer.api.bean.adminaccount.AdminAccount;
import cn.timer.api.bean.qyzx.QyzxEmpLogin;
import cn.timer.api.dto.qyzx.EntRegisterDto;
import cn.timer.api.utils.Md5;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import cn.timer.api.utils.UserIp;
import cn.timer.api.utils.redis.RedisConfig;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/14 18:14
*/
@RestController
@Api(tags = "33.0运营后台登录")
@Transactional
@RequestMapping(value = "/superLogin", produces = { "application/json" })
public class SuperLoginController {
@Autowired
private HttpSession session;
@PostMapping(value = "/adminLogin")
@ApiOperation(value = "运营后台登录", httpMethod = "POST", notes = "接口发布说明")
public Result<AdminAccount> adminLogin(@RequestBody EntRegisterDto entRegisterDto, HttpServletRequest request){
String ip = UserIp.getIpAddr(request);
AdminAccount adminAccount = AdminAccount.builder().build().selectOne(new QueryWrapper<AdminAccount>().lambda()
.eq(AdminAccount::getAccount,entRegisterDto.getPhone())
.eq(AdminAccount::getPwd,Md5.md5(entRegisterDto.getPw())));
if(adminAccount==null){
return ResultUtil.error("用户不存在或密码错误");
}
session=request.getSession();
session.setAttribute("ai", adminAccount);
System.err.println(session.getId());
return ResultUtil.data(adminAccount);
};
@PostMapping(value = "/adminOutLogin")
@ApiOperation(value = "运营后台退出", httpMethod = "POST", notes = "接口发布说明")
public Result<String> adminOutLogin(HttpServletRequest request){
session= request.getSession();
session.removeAttribute("ai");
return ResultUtil.data("退出成功");
}
}
package cn.timer.api.dao.adminaccount;
import cn.timer.api.bean.adminaccount.AdminAccount;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* 管理员列表
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-14 18:24:20
*/
@Repository
public interface AdminAccountMapper extends BaseMapper<AdminAccount> {
}
package cn.timer.api.dao.insure;
import cn.timer.api.bean.insure.InsureApplicant;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* 投保人
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-07 17:02:46
*/
@Repository
public interface InsureApplicantMapper extends BaseMapper<InsureApplicant> {
}
package cn.timer.api.dao.insure;
import cn.timer.api.bean.insure.InsurePolicy;
import cn.timer.api.dto.insure.PolicyDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 保单信息
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-14 08:53:04
*/
@Repository
public interface InsurePolicyMapper extends BaseMapper<InsurePolicy> {
public List<PolicyDto> policyList();
}
package cn.timer.api.dao.insure;
import cn.timer.api.bean.insure.InsureUser;
import cn.timer.api.dto.insure.PolicyDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 被保人
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-03-11 09:06:53
*/
@Repository
public interface InsureUserMapper extends BaseMapper<InsureUser> {
public List<PolicyDto> selectPolicyList(String id);
}
......@@ -19,7 +19,7 @@ import cn.timer.api.dto.zzgl.DepartmentStaffDto;
/**
* 员工档案+统计图查询
*
*
* @author dsc 2019-11-23
*/
@Repository
......@@ -30,17 +30,17 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> {
* @return
*/
List<YgbintuDto> rsybp(Integer orgCode);
/**
* 查询当月离职人数
* @param userBean
* @param userBean
* @return
*/
Integer benyueLz(Integer orgCode);
/**
* 查询当月转正人数
* @param userBean
* @param userBean
* @return
*/
Integer benyueZz(Integer orgCode);
......@@ -50,74 +50,74 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> {
* @return
*/
List<YgQueryDto> queryEmpMessage(@Param("orgCode") Integer orgCode);
/**
* 查询在职员工(试用员工人数+正式员工人数)
* @param userBean
* @param userBean
* @return
*/
YgglCartogramDto queryInservice(UserBean userBean);
/**
* 查询当月入职人数
* @param userBean
* @param userBean
* @return
*/
YgglCartogramDto queryInduction(UserBean userBean);
/**
* 查询本月转正人数
* @param userBean
* @param userBean
* @return
*/
YgglCartogramDto queryPositive(UserBean userBean);
/**
* 查询员工平均年龄
* @param userBean
* @param userBean
* @return
*/
YgglCartogramDto queryAvgAge(UserBean userBean);
/**
* 查询部门名称及人数
* @param userBean
* @param userBean
* @return
*/
List<YgglCartogramDto> queryDepartmentNum(UserBean userBean);
/**
* 查询岗位名称及人数
* @param userBean
* @param userBean
* @return
*/
List<YgglCartogramDto> queryJobsNum(UserBean userBean);
/**
* 学历及人数查询
* @param userBean
* @param userBean
* @return
*/
List<YgglCartogramDto> queryEducation(UserBean userBean);
/**
* 员工年龄分布查询
* @param userBean
* @param userBean
* @return
*/
List<YgglCartogramDto> queryEmpAge(UserBean userBean);
/**
* 籍贯统计(省份)人数分布查询
* @param userBean
* @param userBean
* @return
*/
List<YgglCartogramDto> queryNativeplace(UserBean userBean);
/**
* 员工工龄分布查询
* @param userBean
* @param userBean
* @return
*/
List<YgglCartogramDto> queryWorkingAge(UserBean userBean);
......@@ -129,6 +129,8 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> {
* @return
*/
IPage<YgglMainEmp> selectME(Page<YgglMainEmp> page,@Param("param") EmpQuery empQuery);
List<DepartmentStaffDto> DepartmentStaff(Integer orgcode,Integer upid);
List<YgglMainEmp> selectListByIds(@Param("array")String[] ids);
}
package cn.timer.api.dto.insure;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import sun.dc.pr.PRError;
import java.util.Date;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/7 18:15
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class InsureDto {
private String orgCode;/*劳动合同*/
private String companyName;/*用工单位实际工作单位*/
private String[] userIds;
private String policyDateStart;
private String policyDateEnd;
private String benefitBasicPlan;/*方案名称*/
private String benefitOccupationCategory;
private String tricycleFrameNumber;
// private String
}
package cn.timer.api.dto.insure;
import lombok.Data;
import java.util.Date;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/14 11:01
*/
@Data
public class PolicyDto {
private long id;
private String name;
private Integer zjType;
private String zjNum;
private String policyNo;
private String status;
private String schemeName;
private String policyDateStart;
private String policyDateEnd;
private String createTime;
private Integer type;
private Integer totaPolicy;
private Integer totalCompany;
private Integer totalUser;
private Double totalPremium;
private Date updateTime;
private String insuredName;
private String benefitBasicPlan;
private String price;
}
package cn.timer.api.utils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.*;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
import java.security.cert.X509Certificate;
import java.util.Map;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 通用http发送方法
*
*
* @author Tang
*/
public class HttpUtils
......@@ -44,10 +45,10 @@ public class HttpUtils
String urlNameString = url + "?" + param;
log.info("sendGet - {}", urlNameString);
URL realUrl = new URL(urlNameString);
URLConnection connection = realUrl.openConnection();
HttpsURLConnection connection = (HttpsURLConnection)realUrl.openConnection();
connection.setRequestProperty("accept", "*/*");
connection.setRequestProperty("connection", "Keep-Alive");
connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36)");
connection.connect();
in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line;
......@@ -97,11 +98,12 @@ public class HttpUtils
* @param param 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
* @return 所代表远程资源的响应结果
*/
public static String sendPost(String url, String param)
public static String sendPost(String url, Map paramMap, Map bodyMap)
{
PrintWriter out = null;
DataOutputStream out=null;
BufferedReader in = null;
StringBuilder result = new StringBuilder();
String param = getParamString(paramMap);
try
{
String urlNameString = url + "?" + param;
......@@ -110,15 +112,16 @@ public class HttpUtils
URLConnection conn = realUrl.openConnection();
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36)");
conn.setRequestProperty("Accept-Charset", "utf-8");
conn.setRequestProperty("contentType", "utf-8");
conn.setRequestProperty("contentType", "text/json;charset=UTF-8");
conn.setDoOutput(true);
conn.setDoInput(true);
out = new PrintWriter(conn.getOutputStream());
out.print(param);
out = new DataOutputStream(conn.getOutputStream());
String json = JSONObject.toJSONString(bodyMap);
out.write(json.getBytes(StandardCharsets.UTF_8));
out.flush();
in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
while ((line = in.readLine()) != null)
{
......@@ -176,9 +179,9 @@ public class HttpUtils
HttpsURLConnection conn = (HttpsURLConnection) console.openConnection();
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
conn.setRequestProperty("Accept-Charset", "utf-8");
conn.setRequestProperty("contentType", "utf-8");
conn.setRequestProperty("contentType", "text/json;charset=UTF-8");
conn.setDoOutput(true);
conn.setDoInput(true);
......@@ -245,4 +248,16 @@ public class HttpUtils
return true;
}
}
}
\ No newline at end of file
/*参数转为字符串*/
private static String getParamString(Map<String, String> paramMap){
if(null==paramMap || paramMap.isEmpty()){
return "";
}
StringBuilder builder = new StringBuilder();
for(String key : paramMap.keySet() ){
builder.append("&")
.append(key).append("=").append(paramMap.get(key));
}
return builder.deleteCharAt(0).toString();
}
}
package cn.timer.api.utils;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;
//import org.apache.shiro.crypto.hash.SimpleHash;
/**
*
* @ClassName: Md5
* @Description: TODO(Md5加密)
* @author TZQ chess222_com
* @date 2019年3月2日 下午12:34:50
*
* @ClassName: Md5
* @Description: TODO(Md5加密)
* @author TZQ chess222_com
* @date 2019年3月2日 下午12:34:50
*
*/
public class Md5 {
......@@ -29,7 +33,8 @@ public class Md5 {
// 生成一个MD5加密计算摘要
MessageDigest md = MessageDigest.getInstance("MD5");
// 对字符串进行加密
md.update(plainText.getBytes());
secretBytes=plainText.getBytes(StandardCharsets.ISO_8859_1);
md.update(secretBytes);
// 获得加密后的数据
secretBytes = md.digest();
} catch (NoSuchAlgorithmException e) {
......@@ -40,10 +45,9 @@ public class Md5 {
// 如果生成数字未满32位,需要前面补0
for (int i = 0; i < 32 - md5code.length(); i++) {
md5code = "0" + md5code;
}
}
return md5code;
}
public static void main(String[] args) {
}
......
/*
Navicat MySQL Data Transfer
Source Server : 120.78.162.177
Source Server Type : MySQL
Source Server Version : 50734
Source Host : 120.78.162.177:3306
Source Schema : timer_test
Target Server Type : MySQL
Target Server Version : 50734
File Encoding : 65001
Date: 05/03/2022 11:40:47
*/
SET NAMES utf8mb4;
SET
FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for insure_applicant
-- ----------------------------
DROP TABLE IF EXISTS `insure_applicant`;
CREATE TABLE `insure_applicant`
(
`id` int(11) NOT NULL COMMENT 'id',
`applicant_e_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '企业/网点名称',
`applicant_e_address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '企业/网点地址',
`applicant_employee_list` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '人员清单',
`applicant_e_contacts` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '企业授权操作人姓名',
`applicant_e_phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作人的联系电话',
`applicant_e_no_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '企业证件类型:3646、统一社会信用代码 3924、组织机构代码',
`applicant_e_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '企业证件号码',
`applicant_e_mail` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '企业邮箱',
`applicant_province_city` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '省市区',
`applicant_invoice_receiving_address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发票收件地址',
`applicant_corporate_bank_account` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发票开票电话',
`applicant_business_bank_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '企业开户行名称',
`policy_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保单号',
`applicant_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '投保类型:1个人 2 企业',
`trans_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '报价请求流水号',
`currency` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '报价号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '投保人' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for insure_policy
-- ----------------------------
DROP TABLE IF EXISTS `insure_policy`;
CREATE TABLE `insure_policy`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`Scheme_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '方案名称(必选)',
`policy_date_start` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保单生效日',
`policy_date_end` datetime NULL DEFAULT NULL COMMENT '保单终止日',
`product_code_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品代码',
`plan_code_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '计划代码',
`partner_pid` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分销商pid',
`policy_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保单号',
`type` int(11) NULL DEFAULT NULL COMMENT '保单类型:1、年单 2、月单',
`currency` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '5-人民币,其他币种请参见全局数据字典',
`total_premium` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '总保费\r\n\r\n',
`status` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '1-正常',
`policy_file` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保单',
`kit_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保单kit的地址',
`insure_applicant_id` int(11) NULL DEFAULT NULL COMMENT '投保人id',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_polivy_no`(`policy_no`) USING BTREE COMMENT '保单唯一索引'
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '保单信息' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for insure_province
-- ----------------------------
DROP TABLE IF EXISTS `insure_province`;
CREATE TABLE `insure_province`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`value` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '值',
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名字',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '省市区' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for insure_user
-- ----------------------------
DROP TABLE IF EXISTS `insure_user`;
CREATE TABLE `insure_user`
(
`id` int(11) NOT NULL COMMENT 'id',
`trans_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '被保险人请求流水号',
`price` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '批次核算保费',
`insured_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '姓名',
`insured_applicant_relations` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '其他526、同投保人36960、本人 59、其他详见数据字典',
`insured_no_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '15-身份证,其他详见数据字典',
`batch_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '被保险人批次号',
`premium` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保单批次保费',
`insured_mobile` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '被保险人联系电话',
`insured_no` varchar(11) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '证件号码',
`insured_e_contact` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '联系人姓名',
`benefit_basic_plan` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '基础计划\r\n30万雇主/3万医疗 36968,50万雇主/5万医疗 36969,80万雇主/10万医疗 36970,80万雇主/20万医疗 36971,100万雇主/10万医疗 36972\r\n',
`benefit_occupation_category` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '职业类别\r\nA类 63119\r\nB类 63120\r\nC类 63121\r\n',
`benefit_EL_employee_number_t` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参保人数',
`Tricycle_frame_number` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '二、三轮车车架号(必选)',
`status` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '人员状态',
`policy_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '保单号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
SET
FOREIGN_KEY_CHECKS = 1;
ALTER TABLE `timer_test`.`yggl_main_emp`
ADD COLUMN `is_insure` int(11) NULL DEFAULT 0 COMMENT '是否已投保:0否 1是' AFTER `custom_num`;
<?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="cn.timer.api.dao.adminaccount.AdminAccountMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.adminaccount.AdminAccount" id="adminAccountMap">
<result property="id" column="id"/>
<result property="realname" column="realname"/>
<result property="tel" column="tel"/>
<result property="types" column="types"/>
<result property="createrid" column="createrid"/>
<result property="createtime" column="createtime"/>
<result property="department" column="department"/>
<result property="groupid" column="groupid"/>
<result property="statu" column="statu"/>
<result property="mark" column="mark"/>
<result property="account" column="account"/>
<result property="pwd" column="pwd"/>
<result property="avatar" column="avatar"/>
<result property="category" column="category"/>
<result property="lfc" column="lfc"/>
<result property="prohibittime" column="prohibittime"/>
<result property="ip" column="ip"/>
<result property="logintime" column="logintime"/>
<result property="updatetime" column="updatetime"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.adminaccount.AdminAccount">
select *
from admin_account
where id = #{value}
</select>
<select id="queryList" resultType="cn.timer.api.bean.adminaccount.AdminAccount">
select * from admin_account
<where>
<if test="realname != null and realname != ''">AND `realname` = #{realname}</if>
<if test="tel != null and tel != ''">AND `tel` = #{tel}</if>
<if test="types != null and types != ''">AND `types` = #{types}</if>
<if test="createrid != null and createrid != ''">AND `createrid` = #{createrid}</if>
<if test="createtime != null and createtime != ''">AND `createtime` = #{createtime}</if>
<if test="department != null and department != ''">AND `department` = #{department}</if>
<if test="groupid != null and groupid != ''">AND `groupid` = #{groupid}</if>
<if test="statu != null and statu != ''">AND `statu` = #{statu}</if>
<if test="mark != null and mark != ''">AND `mark` = #{mark}</if>
<if test="account != null and account != ''">AND `account` = #{account}</if>
<if test="pwd != null and pwd != ''">AND `pwd` = #{pwd}</if>
<if test="avatar != null and avatar != ''">AND `avatar` = #{avatar}</if>
<if test="category != null and category != ''">AND `category` = #{category}</if>
<if test="lfc != null and lfc != ''">AND `lfc` = #{lfc}</if>
<if test="prohibittime != null and prohibittime != ''">AND `prohibittime` = #{prohibittime}</if>
<if test="ip != null and ip != ''">AND `ip` = #{ip}</if>
<if test="logintime != null and logintime != ''">AND `logintime` = #{logintime}</if>
<if test="updatetime != null and updatetime != ''">AND `updatetime` = #{updatetime}</if>
</where>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from admin_account
<where>
<if test="realname != null and realname != ''">AND `realname` = #{realname}</if>
<if test="tel != null and tel != ''">AND `tel` = #{tel}</if>
<if test="types != null and types != ''">AND `types` = #{types}</if>
<if test="createrid != null and createrid != ''">AND `createrid` = #{createrid}</if>
<if test="createtime != null and createtime != ''">AND `createtime` = #{createtime}</if>
<if test="department != null and department != ''">AND `department` = #{department}</if>
<if test="groupid != null and groupid != ''">AND `groupid` = #{groupid}</if>
<if test="statu != null and statu != ''">AND `statu` = #{statu}</if>
<if test="mark != null and mark != ''">AND `mark` = #{mark}</if>
<if test="account != null and account != ''">AND `account` = #{account}</if>
<if test="pwd != null and pwd != ''">AND `pwd` = #{pwd}</if>
<if test="avatar != null and avatar != ''">AND `avatar` = #{avatar}</if>
<if test="category != null and category != ''">AND `category` = #{category}</if>
<if test="lfc != null and lfc != ''">AND `lfc` = #{lfc}</if>
<if test="prohibittime != null and prohibittime != ''">AND `prohibittime` = #{prohibittime}</if>
<if test="ip != null and ip != ''">AND `ip` = #{ip}</if>
<if test="logintime != null and logintime != ''">AND `logintime` = #{logintime}</if>
<if test="updatetime != null and updatetime != ''">AND `updatetime` = #{updatetime}</if>
</where>
</select>
<insert id="save" parameterType="cn.timer.api.bean.adminaccount.AdminAccount" useGeneratedKeys="true" keyProperty="id">
insert into admin_account
(`realname`,
`tel`,
`types`,
`createrid`,
`createtime`,
`department`,
`groupid`,
`statu`,
`mark`,
`account`,
`pwd`,
`avatar`,
`category`,
`lfc`,
`prohibittime`,
`ip`,
`logintime`,
`updatetime`)
values (#{realname},
#{tel},
#{types},
#{createrid},
#{createtime},
#{department},
#{groupid},
#{statu},
#{mark},
#{account},
#{pwd},
#{avatar},
#{category},
#{lfc},
#{prohibittime},
#{ip},
#{logintime},
#{updatetime})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.adminaccount.AdminAccount" useGeneratedKeys="true"
keyProperty="id">
insert into admin_account
(
<if test="realname != null">,`realname`</if>
<if test="tel != null">,`tel`</if>
<if test="types != null">,`types`</if>
<if test="createrid != null">,`createrid`</if>
<if test="createtime != null">,`createtime`</if>
<if test="department != null">,`department`</if>
<if test="groupid != null">,`groupid`</if>
<if test="statu != null">,`statu`</if>
<if test="mark != null">,`mark`</if>
<if test="account != null">,`account`</if>
<if test="pwd != null">,`pwd`</if>
<if test="avatar != null">,`avatar`</if>
<if test="category != null">,`category`</if>
<if test="lfc != null">,`lfc`</if>
<if test="prohibittime != null">,`prohibittime`</if>
<if test="ip != null">,`ip`</if>
<if test="logintime != null">,`logintime`</if>
<if test="updatetime != null">,`updatetime`</if>
)
values
(
<if test="realname != null">,#{realname}</if>
<if test="tel != null">,#{tel}</if>
<if test="types != null">,#{types}</if>
<if test="createrid != null">,#{createrid}</if>
<if test="createtime != null">,#{createtime}</if>
<if test="department != null">,#{department}</if>
<if test="groupid != null">,#{groupid}</if>
<if test="statu != null">,#{statu}</if>
<if test="mark != null">,#{mark}</if>
<if test="account != null">,#{account}</if>
<if test="pwd != null">,#{pwd}</if>
<if test="avatar != null">,#{avatar}</if>
<if test="category != null">,#{category}</if>
<if test="lfc != null">,#{lfc}</if>
<if test="prohibittime != null">,#{prohibittime}</if>
<if test="ip != null">,#{ip}</if>
<if test="logintime != null">,#{logintime}</if>
<if test="updatetime != null">,#{updatetime}</if>
)
</insert>
<insert id="saveList" parameterType="cn.timer.api.bean.adminaccount.AdminAccount" useGeneratedKeys="true"
keyProperty="id">
insert into admin_account
(
`realname`,
`tel`,
`types`,
`createrid`,
`createtime`,
`department`,
`groupid`,
`statu`,
`mark`,
`account`,
`pwd`,
`avatar`,
`category`,
`lfc`,
`prohibittime`,
`ip`,
`logintime`,
`updatetime`
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.realname},
#{item.tel},
#{item.types},
#{item.createrid},
#{item.createtime},
#{item.department},
#{item.groupid},
#{item.statu},
#{item.mark},
#{item.account},
#{item.pwd},
#{item.avatar},
#{item.category},
#{item.lfc},
#{item.prohibittime},
#{item.ip},
#{item.logintime},
#{item.updatetime}
)
</foreach>
</insert>
<update id="update" parameterType="cn.timer.api.bean.adminaccount.AdminAccount">
update admin_account
<set>
<if test="realname != null">`realname` = #{realname},</if>
<if test="tel != null">`tel` = #{tel},</if>
<if test="types != null">`types` = #{types},</if>
<if test="createrid != null">`createrid` = #{createrid},</if>
<if test="createtime != null">`createtime` = #{createtime},</if>
<if test="department != null">`department` = #{department},</if>
<if test="groupid != null">`groupid` = #{groupid},</if>
<if test="statu != null">`statu` = #{statu},</if>
<if test="mark != null">`mark` = #{mark},</if>
<if test="account != null">`account` = #{account},</if>
<if test="pwd != null">`pwd` = #{pwd},</if>
<if test="avatar != null">`avatar` = #{avatar},</if>
<if test="category != null">`category` = #{category},</if>
<if test="lfc != null">`lfc` = #{lfc},</if>
<if test="prohibittime != null">`prohibittime` = #{prohibittime},</if>
<if test="ip != null">`ip` = #{ip},</if>
<if test="logintime != null">`logintime` = #{logintime},</if>
<if test="updatetime != null">`updatetime` = #{updatetime}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete
from admin_account
where id = #{value}
</delete>
<delete id="deleteBatch">
delete from admin_account where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
<?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="cn.timer.api.dao.insure.InsureApplicantMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.insure.InsureApplicant" id="insureApplicantMap">
<result property="id" column="id"/>
<result property="applicantEName" column="applicant_e_name"/>
<result property="applicantEAddress" column="applicant_e_address"/>
<result property="applicantEmployeeList" column="applicant_employee_list"/>
<result property="applicantEContacts" column="applicant_e_contacts"/>
<result property="applicantEPhone" column="applicant_e_phone"/>
<result property="applicantENoType" column="applicant_e_no_type"/>
<result property="applicantENo" column="applicant_e_no"/>
<result property="applicantEMail" column="applicant_e_mail"/>
<result property="applicantProvinceCity" column="applicant_province_city"/>
<result property="applicantInvoiceReceivingAddress" column="applicant_invoice_receiving_address"/>
<result property="applicantInvoiceBillingPhone" column="applicant_invoice_billing_phone"/>
<result property="applicantBusinessBankName" column="applicant_business_bank_name"/>
<result property="policyNo" column="policy_no"/>
<result property="applicantType" column="applicant_type"/>
<result property="transId" column="trans_id"/>
<result property="currency" column="currency"/>
<result property="applicantInvoicedAmount" column="applicant_invoiced_amount"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.insure.InsureApplicant">
select *
from insure_applicant
where id = #{value}
</select>
<select id="queryList" resultType="cn.timer.api.bean.insure.InsureApplicant">
select * from insure_applicant
<where>
<if test="applicantEName != null and applicantEName != ''">AND `applicant_e_name` = #{applicantEName}</if>
<if test="applicantEAddress != null and applicantEAddress != ''">AND `applicant_e_address` =
#{applicantEAddress}
</if>
<if test="applicantEmployeeList != null and applicantEmployeeList != ''">AND `applicant_employee_list` =
#{applicantEmployeeList}
</if>
<if test="applicantEContacts != null and applicantEContacts != ''">AND `applicant_e_contacts` =
#{applicantEContacts}
</if>
<if test="applicantEPhone != null and applicantEPhone != ''">AND `applicant_e_phone` = #{applicantEPhone}
</if>
<if test="applicantENoType != null and applicantENoType != ''">AND `applicant_e_no_type` =
#{applicantENoType}
</if>
<if test="applicantENo != null and applicantENo != ''">AND `applicant_e_no` = #{applicantENo}</if>
<if test="applicantEMail != null and applicantEMail != ''">AND `applicant_e_mail` = #{applicantEMail}</if>
<if test="applicantProvinceCity != null and applicantProvinceCity != ''">AND `applicant_province_city` =
#{applicantProvinceCity}
</if>
<if test="applicantInvoiceReceivingAddress != null and applicantInvoiceReceivingAddress != ''">AND
`applicant_invoice_receiving_address` = #{applicantInvoiceReceivingAddress}
</if>
<if test="applicantInvoiceBillingPhone != null and applicantInvoiceBillingPhone != ''">AND
`applicant_invoice_billing_phone` = #{applicantInvoiceBillingPhone}
</if>
<if test="applicantBusinessBankName != null and applicantBusinessBankName != ''">AND
`applicant_business_bank_name` = #{applicantBusinessBankName}
</if>
<if test="policyNo != null and policyNo != ''">AND `policy_no` = #{policyNo}</if>
<if test="applicantType != null and applicantType != ''">AND `applicant_type` = #{applicantType}</if>
<if test="transId != null and transId != ''">AND `trans_id` = #{transId}</if>
<if test="currency != null and currency != ''">AND `currency` = #{currency}</if>
<if test="applicantInvoicedAmount != null and applicantInvoicedAmount != ''">AND `applicant_invoiced_amount`
= #{applicantInvoicedAmount}
</if>
</where>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from insure_applicant
<where>
<if test="applicantEName != null and applicantEName != ''">AND `applicant_e_name` = #{applicantEName}</if>
<if test="applicantEAddress != null and applicantEAddress != ''">AND `applicant_e_address` =
#{applicantEAddress}
</if>
<if test="applicantEmployeeList != null and applicantEmployeeList != ''">AND `applicant_employee_list` =
#{applicantEmployeeList}
</if>
<if test="applicantEContacts != null and applicantEContacts != ''">AND `applicant_e_contacts` =
#{applicantEContacts}
</if>
<if test="applicantEPhone != null and applicantEPhone != ''">AND `applicant_e_phone` = #{applicantEPhone}
</if>
<if test="applicantENoType != null and applicantENoType != ''">AND `applicant_e_no_type` =
#{applicantENoType}
</if>
<if test="applicantENo != null and applicantENo != ''">AND `applicant_e_no` = #{applicantENo}</if>
<if test="applicantEMail != null and applicantEMail != ''">AND `applicant_e_mail` = #{applicantEMail}</if>
<if test="applicantProvinceCity != null and applicantProvinceCity != ''">AND `applicant_province_city` =
#{applicantProvinceCity}
</if>
<if test="applicantInvoiceReceivingAddress != null and applicantInvoiceReceivingAddress != ''">AND
`applicant_invoice_receiving_address` = #{applicantInvoiceReceivingAddress}
</if>
<if test="applicantInvoiceBillingPhone != null and applicantInvoiceBillingPhone != ''">AND
`applicant_invoice_billing_phone` = #{applicantInvoiceBillingPhone}
</if>
<if test="applicantBusinessBankName != null and applicantBusinessBankName != ''">AND
`applicant_business_bank_name` = #{applicantBusinessBankName}
</if>
<if test="policyNo != null and policyNo != ''">AND `policy_no` = #{policyNo}</if>
<if test="applicantType != null and applicantType != ''">AND `applicant_type` = #{applicantType}</if>
<if test="transId != null and transId != ''">AND `trans_id` = #{transId}</if>
<if test="currency != null and currency != ''">AND `currency` = #{currency}</if>
<if test="applicantInvoicedAmount != null and applicantInvoicedAmount != ''">AND `applicant_invoiced_amount`
= #{applicantInvoicedAmount}
</if>
</where>
</select>
<insert id="save" parameterType="cn.timer.api.bean.insure.InsureApplicant" useGeneratedKeys="true"
keyProperty="id">
insert into insure_applicant
(`applicant_e_name`,
`applicant_e_address`,
`applicant_employee_list`,
`applicant_e_contacts`,
`applicant_e_phone`,
`applicant_e_no_type`,
`applicant_e_no`,
`applicant_e_mail`,
`applicant_province_city`,
`applicant_invoice_receiving_address`,
`applicant_invoice_billing_phone`,
`applicant_business_bank_name`,
`policy_no`,
`applicant_type`,
`trans_id`,
`currency`,
`applicant_invoiced_amount`)
values (#{applicantEName},
#{applicantEAddress},
#{applicantEmployeeList},
#{applicantEContacts},
#{applicantEPhone},
#{applicantENoType},
#{applicantENo},
#{applicantEMail},
#{applicantProvinceCity},
#{applicantInvoiceReceivingAddress},
#{applicantInvoiceBillingPhone},
#{applicantBusinessBankName},
#{policyNo},
#{applicantType},
#{transId},
#{currency},
#{applicantInvoicedAmount})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.insure.InsureApplicant" useGeneratedKeys="true"
keyProperty="id">
insert into insure_applicant
(
<if test="applicantEName != null">,`applicant_e_name`</if>
<if test="applicantEAddress != null">,`applicant_e_address`</if>
<if test="applicantEmployeeList != null">,`applicant_employee_list`</if>
<if test="applicantEContacts != null">,`applicant_e_contacts`</if>
<if test="applicantEPhone != null">,`applicant_e_phone`</if>
<if test="applicantENoType != null">,`applicant_e_no_type`</if>
<if test="applicantENo != null">,`applicant_e_no`</if>
<if test="applicantEMail != null">,`applicant_e_mail`</if>
<if test="applicantProvinceCity != null">,`applicant_province_city`</if>
<if test="applicantInvoiceReceivingAddress != null">,`applicant_invoice_receiving_address`</if>
<if test="applicantInvoiceBillingPhone != null">,`applicant_invoice_billing_phone`</if>
<if test="applicantBusinessBankName != null">,`applicant_business_bank_name`</if>
<if test="policyNo != null">,`policy_no`</if>
<if test="applicantType != null">,`applicant_type`</if>
<if test="transId != null">,`trans_id`</if>
<if test="currency != null">,`currency`</if>
<if test="applicantInvoicedAmount != null">,`applicant_invoiced_amount`</if>
)
values
(
<if test="applicantEName != null">,#{applicantEName}</if>
<if test="applicantEAddress != null">,#{applicantEAddress}</if>
<if test="applicantEmployeeList != null">,#{applicantEmployeeList}</if>
<if test="applicantEContacts != null">,#{applicantEContacts}</if>
<if test="applicantEPhone != null">,#{applicantEPhone}</if>
<if test="applicantENoType != null">,#{applicantENoType}</if>
<if test="applicantENo != null">,#{applicantENo}</if>
<if test="applicantEMail != null">,#{applicantEMail}</if>
<if test="applicantProvinceCity != null">,#{applicantProvinceCity}</if>
<if test="applicantInvoiceReceivingAddress != null">,#{applicantInvoiceReceivingAddress}</if>
<if test="applicantInvoiceBillingPhone != null">,#{applicantInvoiceBillingPhone}</if>
<if test="applicantBusinessBankName != null">,#{applicantBusinessBankName}</if>
<if test="policyNo != null">,#{policyNo}</if>
<if test="applicantType != null">,#{applicantType}</if>
<if test="transId != null">,#{transId}</if>
<if test="currency != null">,#{currency}</if>
<if test="applicantInvoicedAmount != null">,#{applicantInvoicedAmount}</if>
)
</insert>
<insert id="saveList" parameterType="cn.timer.api.bean.insure.InsureApplicant" useGeneratedKeys="true"
keyProperty="id">
insert into insure_applicant
(
`applicant_e_name`,
`applicant_e_address`,
`applicant_employee_list`,
`applicant_e_contacts`,
`applicant_e_phone`,
`applicant_e_no_type`,
`applicant_e_no`,
`applicant_e_mail`,
`applicant_province_city`,
`applicant_invoice_receiving_address`,
`applicant_invoice_billing_phone`,
`applicant_business_bank_name`,
`policy_no`,
`applicant_type`,
`trans_id`,
`currency`,
`applicant_invoiced_amount`
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.applicantEName},
#{item.applicantEAddress},
#{item.applicantEmployeeList},
#{item.applicantEContacts},
#{item.applicantEPhone},
#{item.applicantENoType},
#{item.applicantENo},
#{item.applicantEMail},
#{item.applicantProvinceCity},
#{item.applicantInvoiceReceivingAddress},
#{item.applicantInvoiceBillingPhone},
#{item.applicantBusinessBankName},
#{item.policyNo},
#{item.applicantType},
#{item.transId},
#{item.currency},
#{item.applicantInvoicedAmount}
)
</foreach>
</insert>
<update id="update" parameterType="cn.timer.api.bean.insure.InsureApplicant">
update insure_applicant
<set>
<if test="applicantEName != null">`applicant_e_name` = #{applicantEName},</if>
<if test="applicantEAddress != null">`applicant_e_address` = #{applicantEAddress},</if>
<if test="applicantEmployeeList != null">`applicant_employee_list` = #{applicantEmployeeList},</if>
<if test="applicantEContacts != null">`applicant_e_contacts` = #{applicantEContacts},</if>
<if test="applicantEPhone != null">`applicant_e_phone` = #{applicantEPhone},</if>
<if test="applicantENoType != null">`applicant_e_no_type` = #{applicantENoType},</if>
<if test="applicantENo != null">`applicant_e_no` = #{applicantENo},</if>
<if test="applicantEMail != null">`applicant_e_mail` = #{applicantEMail},</if>
<if test="applicantProvinceCity != null">`applicant_province_city` = #{applicantProvinceCity},</if>
<if test="applicantInvoiceReceivingAddress != null">`applicant_invoice_receiving_address` =
#{applicantInvoiceReceivingAddress},
</if>
<if test="applicantInvoiceBillingPhone != null">`applicant_invoice_billing_phone` =
#{applicantInvoiceBillingPhone},
</if>
<if test="applicantBusinessBankName != null">`applicant_business_bank_name` =
#{applicantBusinessBankName},
</if>
<if test="policyNo != null">`policy_no` = #{policyNo},</if>
<if test="applicantType != null">`applicant_type` = #{applicantType},</if>
<if test="transId != null">`trans_id` = #{transId},</if>
<if test="currency != null">`currency` = #{currency},</if>
<if test="applicantInvoicedAmount != null">`applicant_invoiced_amount` = #{applicantInvoicedAmount}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete
from insure_applicant
where id = #{value}
</delete>
<delete id="deleteBatch">
delete from insure_applicant where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
<?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="cn.timer.api.dao.insure.InsurePolicyMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.insure.InsurePolicy" id="insurePolicyMap">
<result property="id" column="id"/>
<result property="schemeName" column="scheme_name"/>
<result property="policyDateStart" column="policy_date_start"/>
<result property="policyDateEnd" column="policy_date_end"/>
<result property="productCodeId" column="product_code_id"/>
<result property="planCodeId" column="plan_code_id"/>
<result property="partnerPid" column="partner_pid"/>
<result property="policyNo" column="policy_no"/>
<result property="type" column="type"/>
<result property="currency" column="currency"/>
<result property="totalPremium" column="total_premium"/>
<result property="status" column="status"/>
<result property="policyFile" column="policy_file"/>
<result property="kitUrl" column="kit_url"/>
<result property="insureApplicantId" column="insure_applicant_id"/>
<result property="orgCode" column="org_code"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.insure.InsurePolicy">
select *
from insure_policy
where id = #{value}
</select>
<select id="queryList" resultType="cn.timer.api.bean.insure.InsurePolicy">
select * from insure_policy
<where>
<if test="schemeName != null and schemeName != ''">AND `scheme_name` = #{schemeName}</if>
<if test="policyDateStart != null and policyDateStart != ''">AND `policy_date_start` = #{policyDateStart}
</if>
<if test="policyDateEnd != null and policyDateEnd != ''">AND `policy_date_end` = #{policyDateEnd}</if>
<if test="productCodeId != null and productCodeId != ''">AND `product_code_id` = #{productCodeId}</if>
<if test="planCodeId != null and planCodeId != ''">AND `plan_code_id` = #{planCodeId}</if>
<if test="partnerPid != null and partnerPid != ''">AND `partner_pid` = #{partnerPid}</if>
<if test="policyNo != null and policyNo != ''">AND `policy_no` = #{policyNo}</if>
<if test="type != null and type != ''">AND `type` = #{type}</if>
<if test="currency != null and currency != ''">AND `currency` = #{currency}</if>
<if test="totalPremium != null and totalPremium != ''">AND `total_premium` = #{totalPremium}</if>
<if test="status != null and status != ''">AND `status` = #{status}</if>
<if test="policyFile != null and policyFile != ''">AND `policy_file` = #{policyFile}</if>
<if test="kitUrl != null and kitUrl != ''">AND `kit_url` = #{kitUrl}</if>
<if test="insureApplicantId != null and insureApplicantId != ''">AND `insure_applicant_id` =
#{insureApplicantId}
</if>
<if test="orgCode != null and orgCode != ''">AND `org_code` = #{orgCode}</if>
<if test="createTime != null and createTime != ''">AND `create_time` = #{createTime}</if>
<if test="updateTime != null and updateTime != ''">AND `update_time` = #{updateTime}</if>
</where>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from insure_policy
<where>
<if test="schemeName != null and schemeName != ''">AND `scheme_name` = #{schemeName}</if>
<if test="policyDateStart != null and policyDateStart != ''">AND `policy_date_start` = #{policyDateStart}
</if>
<if test="policyDateEnd != null and policyDateEnd != ''">AND `policy_date_end` = #{policyDateEnd}</if>
<if test="productCodeId != null and productCodeId != ''">AND `product_code_id` = #{productCodeId}</if>
<if test="planCodeId != null and planCodeId != ''">AND `plan_code_id` = #{planCodeId}</if>
<if test="partnerPid != null and partnerPid != ''">AND `partner_pid` = #{partnerPid}</if>
<if test="policyNo != null and policyNo != ''">AND `policy_no` = #{policyNo}</if>
<if test="type != null and type != ''">AND `type` = #{type}</if>
<if test="currency != null and currency != ''">AND `currency` = #{currency}</if>
<if test="totalPremium != null and totalPremium != ''">AND `total_premium` = #{totalPremium}</if>
<if test="status != null and status != ''">AND `status` = #{status}</if>
<if test="policyFile != null and policyFile != ''">AND `policy_file` = #{policyFile}</if>
<if test="kitUrl != null and kitUrl != ''">AND `kit_url` = #{kitUrl}</if>
<if test="insureApplicantId != null and insureApplicantId != ''">AND `insure_applicant_id` =
#{insureApplicantId}
</if>
<if test="orgCode != null and orgCode != ''">AND `org_code` = #{orgCode}</if>
<if test="createTime != null and createTime != ''">AND `create_time` = #{createTime}</if>
<if test="updateTime != null and updateTime != ''">AND `update_time` = #{updateTime}</if>
</where>
</select>
<insert id="save" parameterType="cn.timer.api.bean.insure.InsurePolicy" useGeneratedKeys="true" keyProperty="id">
insert into insure_policy
(`scheme_name`,
`policy_date_start`,
`policy_date_end`,
`product_code_id`,
`plan_code_id`,
`partner_pid`,
`policy_no`,
`type`,
`currency`,
`total_premium`,
`status`,
`policy_file`,
`kit_url`,
`insure_applicant_id`,
`org_code`,
`create_time`,
`update_time`)
values (#{schemeName},
#{policyDateStart},
#{policyDateEnd},
#{productCodeId},
#{planCodeId},
#{partnerPid},
#{policyNo},
#{type},
#{currency},
#{totalPremium},
#{status},
#{policyFile},
#{kitUrl},
#{insureApplicantId},
#{orgCode},
#{createTime},
#{updateTime})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.insure.InsurePolicy" useGeneratedKeys="true"
keyProperty="id">
insert into insure_policy
(
<if test="schemeName != null">,`scheme_name`</if>
<if test="policyDateStart != null">,`policy_date_start`</if>
<if test="policyDateEnd != null">,`policy_date_end`</if>
<if test="productCodeId != null">,`product_code_id`</if>
<if test="planCodeId != null">,`plan_code_id`</if>
<if test="partnerPid != null">,`partner_pid`</if>
<if test="policyNo != null">,`policy_no`</if>
<if test="type != null">,`type`</if>
<if test="currency != null">,`currency`</if>
<if test="totalPremium != null">,`total_premium`</if>
<if test="status != null">,`status`</if>
<if test="policyFile != null">,`policy_file`</if>
<if test="kitUrl != null">,`kit_url`</if>
<if test="insureApplicantId != null">,`insure_applicant_id`</if>
<if test="orgCode != null">,`org_code`</if>
<if test="createTime != null">,`create_time`</if>
<if test="updateTime != null">,`update_time`</if>
)
values
(
<if test="schemeName != null">,#{schemeName}</if>
<if test="policyDateStart != null">,#{policyDateStart}</if>
<if test="policyDateEnd != null">,#{policyDateEnd}</if>
<if test="productCodeId != null">,#{productCodeId}</if>
<if test="planCodeId != null">,#{planCodeId}</if>
<if test="partnerPid != null">,#{partnerPid}</if>
<if test="policyNo != null">,#{policyNo}</if>
<if test="type != null">,#{type}</if>
<if test="currency != null">,#{currency}</if>
<if test="totalPremium != null">,#{totalPremium}</if>
<if test="status != null">,#{status}</if>
<if test="policyFile != null">,#{policyFile}</if>
<if test="kitUrl != null">,#{kitUrl}</if>
<if test="insureApplicantId != null">,#{insureApplicantId}</if>
<if test="orgCode != null">,#{orgCode}</if>
<if test="createTime != null">,#{createTime}</if>
<if test="updateTime != null">,#{update_time}</if>
)
</insert>
<insert id="saveList" parameterType="cn.timer.api.bean.insure.InsurePolicy" useGeneratedKeys="true"
keyProperty="id">
insert into insure_policy
(
`scheme_name`,
`policy_date_start`,
`policy_date_end`,
`product_code_id`,
`plan_code_id`,
`partner_pid`,
`policy_no`,
`type`,
`currency`,
`total_premium`,
`status`,
`policy_file`,
`kit_url`,
`insure_applicant_id`,
`org_code`,
`create_time`,
`update_time`
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.schemeName},
#{item.policyDateStart},
#{item.policyDateEnd},
#{item.productCodeId},
#{item.planCodeId},
#{item.partnerPid},
#{item.policyNo},
#{item.type},
#{item.currency},
#{item.totalPremium},
#{item.status},
#{item.policyFile},
#{item.kitUrl},
#{item.insureApplicantId},
#{item.orgCode},
#{item.createTime},
#{item.updateTime}
)
</foreach>
</insert>
<update id="update" parameterType="cn.timer.api.bean.insure.InsurePolicy">
update insure_policy
<set>
<if test="schemeName != null">`scheme_name` = #{schemeName},</if>
<if test="policyDateStart != null">`policy_date_start` = #{policyDateStart},</if>
<if test="policyDateEnd != null">`policy_date_end` = #{policyDateEnd},</if>
<if test="productCodeId != null">`product_code_id` = #{productCodeId},</if>
<if test="planCodeId != null">`plan_code_id` = #{planCodeId},</if>
<if test="partnerPid != null">`partner_pid` = #{partnerPid},</if>
<if test="policyNo != null">`policy_no` = #{policyNo},</if>
<if test="type != null">`type` = #{type},</if>
<if test="currency != null">`currency` = #{currency},</if>
<if test="totalPremium != null">`total_premium` = #{totalPremium},</if>
<if test="status != null">`status` = #{status},</if>
<if test="policyFile != null">`policy_file` = #{policyFile},</if>
<if test="kitUrl != null">`kit_url` = #{kitUrl},</if>
<if test="insureApplicantId != null">`insure_applicant_id` = #{insureApplicantId},</if>
<if test="orgCode != null">`org_code` = #{orgCode},</if>
<if test="createTime != null">`create_time` = #{createTime}</if>
<if test="updateTime != null">`update_time` = #{updateTime}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete
from insure_policy
where id = #{value}
</delete>
<delete id="deleteBatch">
delete from insure_policy where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="policyList" resultType="cn.timer.api.dto.insure.PolicyDto">
select ip.id AS id, ip.scheme_name AS schemeName, ip.type AS type, count(iu.id) AS totaPolicy,
count(iu.org_code) AS totalCompany, count(iu.id) AS totalUser, ip.total_premium AS totalPremium,
ip.update_time AS updateTime
from insure_policy ip
LEFT JOIN insure_user iu on iu.policy_no = ip.policy_no
GROUP BY ip.policy_no
</select>
</mapper>
<?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="cn.timer.api.dao.insure.InsureUserMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.insure.InsureUser" id="insureUserMap">
<result property="id" column="id"/>
<result property="transId" column="trans_id"/>
<result property="price" column="price"/>
<result property="insuredName" column="insured_name"/>
<result property="batchNo" column="batch_no"/>
<result property="premium" column="premium"/>
<result property="insuredMobile" column="insured_mobile"/>
<result property="insuredNo" column="insured_no"/>
<result property="insuredEContact" column="insured_e_contact"/>
<result property="benefitBasicPlan" column="benefit_basic_plan"/>
<result property="benefitOccupationCategory" column="benefit_occupation_category"/>
<result property="benefitElEmployeeNumberT" column="benefit_EL_employee_number_t"/>
<result property="tricycleFrameNumber" column="Tricycle_frame_number"/>
<result property="policyNo" column="policy_no"/>
<result property="status" column="status"/>
<result property="type" column="type"/>
<result property="orgCode" column="org_code"/>
<result property="userId" column="user_id"/>
<result property="applicantEmployeeList" column="applicant_employee_list"/>
<result property="policyDateStart" column="policy_date_start"/>
<result property="policyDateEnd" column="policy_date_end"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.insure.InsureUser">
select *
from insure_user
where id = #{value}
</select>
<select id="queryList" resultType="cn.timer.api.bean.insure.InsureUser">
select * from insure_user
<where>
<if test="transId != null and transId != ''">AND `trans_id` = #{transId}</if>
<if test="price != null and price != ''">AND `price` = #{price}</if>
<if test="insuredName != null and insuredName != ''">AND `insured_name` = #{insuredName}</if>
<if test="batchNo != null and batchNo != ''">AND `batch_no` = #{batchNo}</if>
<if test="premium != null and premium != ''">AND `premium` = #{premium}</if>
<if test="insuredMobile != null and insuredMobile != ''">AND `insured_mobile` = #{insuredMobile}</if>
<if test="insuredNo != null and insuredNo != ''">AND `insured_no` = #{insuredNo}</if>
<if test="insuredEContact != null and insuredEContact != ''">AND `insured_e_contact` = #{insuredEContact}
</if>
<if test="benefitBasicPlan != null and benefitBasicPlan != ''">AND `benefit_basic_plan` =
#{benefitBasicPlan}
</if>
<if test="benefitOccupationCategory != null and benefitOccupationCategory != ''">AND
`benefit_occupation_category` = #{benefitOccupationCategory}
</if>
<if test="benefitElEmployeeNumberT != null and benefitElEmployeeNumberT != ''">AND
`benefit_EL_employee_number_t` = #{benefitElEmployeeNumberT}
</if>
<if test="tricycleFrameNumber != null and tricycleFrameNumber != ''">AND `Tricycle_frame_number` =
#{tricycleFrameNumber}
</if>
<if test="policyNo != null and policyNo != ''">AND `policy_no` = #{policyNo}</if>
<if test="status != null and status != ''">AND `status` = #{status}</if>
<if test="type != null and type != ''">AND `type` = #{type}</if>
<if test="orgCode != null and orgCode != ''">AND `org_code` = #{orgCode}</if>
<if test="userId != null and userId != ''">AND `user_id` = #{userId}</if>
<if test="applicantEmployeeList != null and applicantEmployeeList != ''">AND `applicant_employee_list` =
#{applicantEmployeeList}
</if>
</where>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from insure_user
<where>
<if test="transId != null and transId != ''">AND `trans_id` = #{transId}</if>
<if test="price != null and price != ''">AND `price` = #{price}</if>
<if test="insuredName != null and insuredName != ''">AND `insured_name` = #{insuredName}</if>
<if test="batchNo != null and batchNo != ''">AND `batch_no` = #{batchNo}</if>
<if test="premium != null and premium != ''">AND `premium` = #{premium}</if>
<if test="insuredMobile != null and insuredMobile != ''">AND `insured_mobile` = #{insuredMobile}</if>
<if test="insuredNo != null and insuredNo != ''">AND `insured_no` = #{insuredNo}</if>
<if test="insuredEContact != null and insuredEContact != ''">AND `insured_e_contact` = #{insuredEContact}
</if>
<if test="benefitBasicPlan != null and benefitBasicPlan != ''">AND `benefit_basic_plan` =
#{benefitBasicPlan}
</if>
<if test="benefitOccupationCategory != null and benefitOccupationCategory != ''">AND
`benefit_occupation_category` = #{benefitOccupationCategory}
</if>
<if test="benefitElEmployeeNumberT != null and benefitElEmployeeNumberT != ''">AND
`benefit_EL_employee_number_t` = #{benefitElEmployeeNumberT}
</if>
<if test="tricycleFrameNumber != null and tricycleFrameNumber != ''">AND `Tricycle_frame_number` =
#{tricycleFrameNumber}
</if>
<if test="policyNo != null and policyNo != ''">AND `policy_no` = #{policyNo}</if>
<if test="status != null and status != ''">AND `status` = #{status}</if>
<if test="type != null and type != ''">AND `type` = #{type}</if>
<if test="orgCode != null and orgCode != ''">AND `org_code` = #{orgCode}</if>
<if test="userId != null and userId != ''">AND `user_id` = #{userId}</if>
<if test="applicantEmployeeList != null and applicantEmployeeList != ''">AND `applicant_employee_list` =
#{applicantEmployeeList}
</if>
</where>
</select>
<insert id="save" parameterType="cn.timer.api.bean.insure.InsureUser" useGeneratedKeys="true" keyProperty="id">
insert into insure_user
(`trans_id`,
`price`,
`insured_name`,
`batch_no`,
`premium`,
`insured_mobile`,
`insured_no`,
`insured_e_contact`,
`benefit_basic_plan`,
`benefit_occupation_category`,
`benefit_EL_employee_number_t`,
`Tricycle_frame_number`,
`policy_no`,
`status`,
`type`,
`org_code`,
`user_id`,
`applicant_employee_list`)
values (#{transId},
#{price},
#{insuredName},
#{batchNo},
#{premium},
#{insuredMobile},
#{insuredNo},
#{insuredEContact},
#{benefitBasicPlan},
#{benefitOccupationCategory},
#{benefitElEmployeeNumberT},
#{tricycleFrameNumber},
#{policyNo},
#{status},
#{type},
#{orgCode},
#{userId},
#{applicantEmployeeList})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.insure.InsureUser" useGeneratedKeys="true"
keyProperty="id">
insert into insure_user
(
<if test="transId != null">,`trans_id`</if>
<if test="price != null">,`price`</if>
<if test="insuredName != null">,`insured_name`</if>
<if test="batchNo != null">,`batch_no`</if>
<if test="premium != null">,`premium`</if>
<if test="insuredMobile != null">,`insured_mobile`</if>
<if test="insuredNo != null">,`insured_no`</if>
<if test="insuredEContact != null">,`insured_e_contact`</if>
<if test="benefitBasicPlan != null">,`benefit_basic_plan`</if>
<if test="benefitOccupationCategory != null">,`benefit_occupation_category`</if>
<if test="benefitElEmployeeNumberT != null">,`benefit_EL_employee_number_t`</if>
<if test="tricycleFrameNumber != null">,`Tricycle_frame_number`</if>
<if test="policyNo != null">,`policy_no`</if>
<if test="status != null">,`status`</if>
<if test="type != null">,`type`</if>
<if test="orgCode != null">,`org_code`</if>
<if test="userId != null">,`user_id`</if>
<if test="applicantEmployeeList != null">,`applicant_employee_list`</if>
)
values
(
<if test="transId != null">,#{transId}</if>
<if test="price != null">,#{price}</if>
<if test="insuredName != null">,#{insuredName}</if>
<if test="batchNo != null">,#{batchNo}</if>
<if test="premium != null">,#{premium}</if>
<if test="insuredMobile != null">,#{insuredMobile}</if>
<if test="insuredNo != null">,#{insuredNo}</if>
<if test="insuredEContact != null">,#{insuredEContact}</if>
<if test="benefitBasicPlan != null">,#{benefitBasicPlan}</if>
<if test="benefitOccupationCategory != null">,#{benefitOccupationCategory}</if>
<if test="benefitElEmployeeNumberT != null">,#{benefitElEmployeeNumberT}</if>
<if test="tricycleFrameNumber != null">,#{tricycleFrameNumber}</if>
<if test="policyNo != null">,#{policyNo}</if>
<if test="status != null">,#{status}</if>
<if test="type != null">,#{type}</if>
<if test="orgCode != null">,#{orgCode}</if>
<if test="userId != null">,#{userId}</if>
<if test="applicantEmployeeList != null">,#{applicantEmployeeList}</if>
)
</insert>
<insert id="saveList" parameterType="cn.timer.api.bean.insure.InsureUser" useGeneratedKeys="true" keyProperty="id">
insert into insure_user
(
`trans_id`,
`price`,
`insured_name`,
`batch_no`,
`premium`,
`insured_mobile`,
`insured_no`,
`insured_e_contact`,
`benefit_basic_plan`,
`benefit_occupation_category`,
`benefit_EL_employee_number_t`,
`Tricycle_frame_number`,
`policy_no`,
`status`,
`type`,
`org_code`,
`user_id`,
`applicant_employee_list`
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.transId},
#{item.price},
#{item.insuredName},
#{item.batchNo},
#{item.premium},
#{item.insuredMobile},
#{item.insuredNo},
#{item.insuredEContact},
#{item.benefitBasicPlan},
#{item.benefitOccupationCategory},
#{item.benefitElEmployeeNumberT},
#{item.tricycleFrameNumber},
#{item.policyNo},
#{item.status},
#{item.type},
#{item.orgCode},
#{item.userId},
#{item.applicantEmployeeList}
)
</foreach>
</insert>
<update id="update" parameterType="cn.timer.api.bean.insure.InsureUser">
update insure_user
<set>
<if test="transId != null">`trans_id` = #{transId},</if>
<if test="price != null">`price` = #{price},</if>
<if test="insuredName != null">`insured_name` = #{insuredName},</if>
<if test="batchNo != null">`batch_no` = #{batchNo},</if>
<if test="premium != null">`premium` = #{premium},</if>
<if test="insuredMobile != null">`insured_mobile` = #{insuredMobile},</if>
<if test="insuredNo != null">`insured_no` = #{insuredNo},</if>
<if test="insuredEContact != null">`insured_e_contact` = #{insuredEContact},</if>
<if test="benefitBasicPlan != null">`benefit_basic_plan` = #{benefitBasicPlan},</if>
<if test="benefitOccupationCategory != null">`benefit_occupation_category` = #{benefitOccupationCategory},
</if>
<if test="benefitElEmployeeNumberT != null">`benefit_EL_employee_number_t` = #{benefitElEmployeeNumberT},
</if>
<if test="tricycleFrameNumber != null">`Tricycle_frame_number` = #{tricycleFrameNumber},</if>
<if test="policyNo != null">`policy_no` = #{policyNo},</if>
<if test="status != null">`status` = #{status},</if>
<if test="type != null">`type` = #{type},</if>
<if test="orgCode != null">`org_code` = #{orgCode},</if>
<if test="userId != null">`user_id` = #{userId},</if>
<if test="applicantEmployeeList != null">`applicant_employee_list` = #{applicantEmployeeList}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete
from insure_user
where id = #{value}
</delete>
<delete id="deleteBatch">
delete from insure_user where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectPolicyList" resultType="cn.timer.api.dto.insure.PolicyDto">
select iu.id,yme.`name`,yme.zj_type,yme.zj_num,iu.policy_no,iu.`status`,ip.scheme_name,iu.policy_date_start,
iu.policy_date_end,ip.create_time,iu.insured_name,iu.benefit_basic_plan AS benefitBasicPlan,iu.price AS price from insure_user iu
LEFT JOIN yggl_main_emp yme on yme.id=iu.user_id
LEFT JOIN insure_policy ip on ip.policy_no=iu.policy_no
where yme.org_code = 3
<if test="id !=null and id !=''">
and ip.id=#{id}
</if>
</select>
</mapper>
......@@ -49,14 +49,15 @@
<result column="bmgw_id" property="bmgwId" />
<result column="bmgw_name" property="bmgwName" />
<result column="custom_num" property="customNum" />
<result column="org_code" property="orgCode" />
<result column="unionid" property="unionid" />
<result column="openid" property="openid" />
<result column="mpopenid" property="mpopenid" />
<result column="appopenid" property="appopenid" />
<result column="is_insure" property="isInsure"/>
</resultMap>
<resultMap id="Bintu" type="cn.timer.api.dto.yggl.YgbintuDto" >
<id column="id" property="id" />
<result column="age" property="age" />
......@@ -68,7 +69,7 @@
<result column="jobStatus" property="jobStatus" />
<result column="workage" property="workage" />
</resultMap>
<resultMap id="DepartmentStaffMap" type="cn.timer.api.dto.zzgl.DepartmentStaffDto" >
<id column="id" property="id" />
<result column="empNum" property="empNum" />
......@@ -126,9 +127,10 @@
openid,
mpopenid,
appopenid,
custom_num
custom_num,
is_insure
</sql>
<sql id="Base_Column_List_a">
a.id,
a.emp_num,
......@@ -148,37 +150,38 @@
a.zj_num,
a.syq,
a.zz_time,
a.custom_num
a.custom_num,
a.is_insure
</sql>
<!-- rsybp人事仪表盘 -->
<select id="rsybp" resultMap="Bintu">
SELECT e.id AS id,IFNULL(e.age,0) AS age,IFNULL(e.bmgw_id,0) AS bmgwId,IFNULL(b.`name`,'null') AS gw,
IFNULL(bb.`name`,'null') AS bm,IFNULL( p.`name`,'null') AS proname,IFNULL(d.`name` ,'null')AS eduname,
IFNULL(e.job_status,0) AS jobStatus,IFNULL(datediff(CURDATE(),e.rz_time),0)AS workage
FROM yggl_main_emp e
LEFT JOIN zzgl_bmgw_m b ON b.id = e.bmgw_id
FROM yggl_main_emp e
LEFT JOIN zzgl_bmgw_m b ON b.id = e.bmgw_id
LEFT JOIN zzgl_bmgw_m bb ON bb.id = b.up_id
LEFT JOIN province_class p ON left (e.`jg`,2) = p.province
LEFT JOIN education_class d ON d.number = e.edu
WHERE e.org_code = #{orgCode}
</select>
<select id="DepartmentStaff" resultMap="DepartmentStaffMap">
select em.emp_num as empNum,
em.`name` as empname,
bm.`name` as bmgwname,
em.phone
from yggl_main_emp em
em.phone
from yggl_main_emp em
LEFT JOIN zzgl_bmgw_m as bm on bm.id = em.bmgw_id
where em.org_code = #{orgcode}
and em.bmgw_id in (select bm.id from zzgl_bmgw_m bm
WHERE bm.up_id = #{upid})
</select>
<select id="selectME" resultMap="BaseResultMap">
SELECT
SELECT
<include refid="Base_Column_List_a" />,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = a.bmgw_id limit 1) limit 1) as bmgw_name
FROM yggl_main_emp a
......@@ -205,7 +208,7 @@
<foreach item="it" index="index" collection="param.empNums" separator="," close="" >
#{it}
</foreach>
)
)
</when>
<otherwise>
AND a.emp_num = #{param.empNums[0]}
......@@ -214,17 +217,17 @@
</if>
</where>
</select>
<!-- benyueLz本月离职人数 -->
<select id="benyueLz" resultType="Integer">
SELECT COUNT(datediff(CURDATE(),l.sjlz_time)) FROM yggl_main_lzb l WHERE datediff(CURDATE(),l.sjlz_time) <![CDATA[ <= ]]> 30 AND org_code = #{orgCode};
</select>
<!-- benyueZz本月转正人数 -->
<select id="benyueZz" resultType="Integer">
SELECT COUNT(datediff(CURDATE(),e.sjzz_time)) FROM yggl_main_emp e WHERE datediff(CURDATE(),e.sjzz_time) <![CDATA[ <= ]]> 30 AND org_code = #{orgCode};
</select>
<!-- 查询员工信息 搜索 分页 -->
<select id="queryEmpMessage" resultType="cn.timer.api.dto.yggl.YgQueryDto">
SELECT
......@@ -247,41 +250,41 @@
ORDER BY
emp_num DESC
</select>
<!-- 查询在职员工(试用员工人数+正式员工人数) -->
<select id="queryInservice" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
SUM(job_status=1) AS probation,
SUM(job_status=2) AS regular
FROM
FROM
yggl_main_emp
WHERE
org_code=#{orgCode}
</select>
<!-- 查询当月入职人数 -->
<select id="queryInduction" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
EXTRACT(MONTH FROM rz_time) AS month,
COUNT(emp_num) induction
FROM
FROM
yggl_main_emp
WHERE
org_code=#{orgCode}
</select>
<!-- 查询本月转正人数 -->
<select id="queryPositive" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
EXTRACT(MONTH FROM sjzz_time) AS month,
COUNT(emp_num) positive
FROM
COUNT(emp_num) positive
FROM
yggl_main_emp
WHERE
org_code=#{orgCode}
</select>
<!-- 查询员工平均年龄 -->
<select id="queryAvgAge" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
......@@ -291,7 +294,7 @@
WHERE
org_code=#{orgCode}
</select>
<!-- 查询岗位上级部门id及名称及人数 -->
<select id="queryDepartmentNum" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
......@@ -308,7 +311,7 @@
c.name,
b.up_id
</select>
<!-- 查询岗位名称及人数 -->
<select id="queryJobsNum" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
......@@ -324,7 +327,7 @@
y.bmgw_id,
b.name;
</select>
<!-- 学历及人数查询 -->
<select id="queryEducation" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
......@@ -342,24 +345,24 @@
ORDER BY
e.id ASC
</select>
<!-- 员工年龄分布查询 -->
<select id="queryEmpAge" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
<![CDATA[
SELECT
SELECT
SUM((CASE WHEN age < 0.5 THEN 1 ELSE 0 END)) AS lowerEighteen,
SUM((CASE WHEN age >= 18 AND age < 25 THEN 1 ELSE 0 END)) AS eighteenToTwentyfive,
SUM((CASE WHEN age >= 25 AND age < 32 THEN 1 ELSE 0 END)) AS twentyfiveToThirtytwo,
SUM((CASE WHEN age >= 32 AND age < 38 THEN 1 ELSE 0 END)) AS thirtytwoToThirtyeight,
SUM((CASE WHEN age >= 38 AND age < 45 THEN 1 ELSE 0 END)) AS thirtyeightToFortyfive,
SUM((CASE WHEN age >=45 THEN 1 ELSE 0 END)) AS higherFortyfive
FROM
FROM
yggl_main_emp
WHERE
org_code = #{orgCode}
]]>
</select>
<!-- 籍贯统计(省份)查询 -->
<select id="queryNativeplace" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
SELECT
......@@ -375,22 +378,33 @@
GROUP BY
c.city_name
</select>
<!-- 员工工龄分布查询 -->
<select id="queryWorkingAge" resultType="cn.timer.api.dto.yggl.YgglCartogramDto">
<![CDATA[
SELECT
SELECT
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 < 0.5 THEN 1 ELSE 0 END)) AS lowerHalfyear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 0.5 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 1 THEN 1 ELSE 0 END)) AS halfYear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 1 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 1.5 THEN 1 ELSE 0 END)) AS oneYear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 1.5 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 2 THEN 1 ELSE 0 END)) AS onehalfYear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >= 2 AND TIMESTAMPDIFF(day, rz_time,now())/365 < 2.5 THEN 1 ELSE 0 END)) AS twoYear,
SUM((CASE WHEN TIMESTAMPDIFF(day, rz_time,now())/365 >=2.5 THEN 1 ELSE 0 END)) AS higherTwohalfYear
FROM
FROM
yggl_main_emp
WHERE
org_code = #{orgCode}
]]>
</select>
</mapper>
\ No newline at end of file
<!--根据id数组查询员工-->
<select id="selectListByIds" resultType="cn.timer.api.bean.yggl.YgglMainEmp">
SELECT
<include refid="Base_Column_List"/>
FROM yggl_main_emp
WHERE id IN
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment