Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
4f3e8e64
Commit
4f3e8e64
authored
Sep 28, 2022
by
翁国栋
Committed by
284718418@qq.com
Mar 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新保险方案为
parent
8b676502
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
405 additions
and
20 deletions
+405
-20
src/main/java/cn/timer/api/bean/insure/InsurePlan.java
+72
-0
src/main/java/cn/timer/api/bean/insure/InsureProductPlan.java
+73
-0
src/main/java/cn/timer/api/bean/insure/InsureUser.java
+15
-2
src/main/java/cn/timer/api/controller/insure/InsurePlanController.java
+70
-0
src/main/java/cn/timer/api/controller/insure/InsureProductController.java
+15
-4
src/main/java/cn/timer/api/controller/insure/InsureUserController.java
+4
-0
src/main/java/cn/timer/api/controller/insure/enums/PlanEnum.java
+2
-1
src/main/java/cn/timer/api/dao/insure/InsurePlanMapper.java
+22
-0
src/main/java/cn/timer/api/dao/insure/InsureProductPlanMapper.java
+24
-0
src/main/java/cn/timer/api/dto/insure/InsureDto.java
+3
-1
src/main/java/cn/timer/api/dto/insure/PlansDto.java
+5
-2
src/main/java/cn/timer/api/dto/insure/PolicyDto.java
+1
-0
src/main/java/cn/timer/api/dto/insure/ProductDto.java
+25
-0
src/main/resources/mapping/insure/InsurePlanMapper.xml
+26
-0
src/main/resources/mapping/insure/InsurePolicyMapper.xml
+8
-3
src/main/resources/mapping/insure/InsureProductPlanMapper.xml
+28
-0
src/main/resources/mapping/insure/InsureUserMapper.xml
+12
-7
No files found.
src/main/java/cn/timer/api/bean/insure/InsurePlan.java
0 → 100644
View file @
4f3e8e64
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-09-23 11:53:23
*/
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table
(
name
=
"insure_plan"
)
@ApiModel
(
"投保方案"
)
public
class
InsurePlan
extends
Model
<
InsurePlan
>
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* id
*/
@Id
@GeneratedValue
@TableId
(
type
=
IdType
.
AUTO
)
@ApiModelProperty
(
value
=
"编号"
)
private
Integer
id
;
/**
* 名称
*/
private
String
name
;
/**
* id,由保司提供
*/
private
String
planId
;
/**
* 类型
*/
private
String
type
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 逻辑删除标记0.未删除 1.删除
*/
private
Integer
deleteFlag
;
/**
* 类型名称
*/
private
String
typeName
;
}
src/main/java/cn/timer/api/bean/insure/InsureProductPlan.java
0 → 100644
View file @
4f3e8e64
package
cn
.
timer
.
api
.
bean
.
insure
;
import
cn.timer.api.bean.insure.InsureProduct
;
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-09-26 10:06:39
*/
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table
(
name
=
"insure_product_plan"
)
@ApiModel
(
"保险方案"
)
public
class
InsureProductPlan
extends
Model
<
InsureProductPlan
>
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* id
*/
@Id
@GeneratedValue
@TableId
(
type
=
IdType
.
AUTO
)
@ApiModelProperty
(
value
=
"编号"
)
private
Integer
id
;
/**
* 方案json
*/
private
String
planJson
;
/**
* 单价
*/
private
Double
price
;
/**
* insure_product的id
*/
private
Integer
productId
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 是否删除 1已删除 0未删除
*/
private
Integer
deleteFlag
;
/**
* 方案组合后的名字
*/
private
String
name
;
}
src/main/java/cn/timer/api/bean/insure/InsureUser.java
View file @
4f3e8e64
...
@@ -56,7 +56,7 @@ public class InsureUser extends Model<InsureUser> {
...
@@ -56,7 +56,7 @@ public class InsureUser extends Model<InsureUser> {
* 批次核算保费
* 批次核算保费
*/
*/
@ApiModelProperty
(
value
=
"批次核算保费"
)
@ApiModelProperty
(
value
=
"批次核算保费"
)
private
String
price
;
private
Double
price
;
/**
/**
* 姓名
* 姓名
*/
*/
...
@@ -71,7 +71,7 @@ public class InsureUser extends Model<InsureUser> {
...
@@ -71,7 +71,7 @@ public class InsureUser extends Model<InsureUser> {
* 保单批次保费
* 保单批次保费
*/
*/
@ApiModelProperty
(
value
=
"保单批次保费"
)
@ApiModelProperty
(
value
=
"保单批次保费"
)
private
String
premium
;
private
Double
premium
;
/**
/**
* 被保险人联系电话
* 被保险人联系电话
*/
*/
...
@@ -172,4 +172,17 @@ public class InsureUser extends Model<InsureUser> {
...
@@ -172,4 +172,17 @@ public class InsureUser extends Model<InsureUser> {
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"原被保人"
,
example
=
"原被保人"
)
@ApiModelProperty
(
value
=
"原被保人"
,
example
=
"原被保人"
)
private
InsureUser
originaUser
;
private
InsureUser
originaUser
;
@ApiModelProperty
(
value
=
"insure_product_plan表的Id"
)
private
Integer
productPlanId
;
@Transient
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"方案集合"
,
example
=
"方案集合"
)
private
List
planIds
;
@Transient
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"产品名称"
,
example
=
"产品名称"
)
private
String
productName
;
}
}
src/main/java/cn/timer/api/controller/insure/InsurePlanController.java
0 → 100644
View file @
4f3e8e64
package
cn
.
timer
.
api
.
controller
.
insure
;
import
cn.timer.api.bean.insure.InsurePlan
;
import
cn.timer.api.bean.insure.InsureProduct
;
import
cn.timer.api.bean.insure.InsureProductPlan
;
import
cn.timer.api.dao.insure.InsurePlanMapper
;
import
cn.timer.api.dao.insure.InsureProductPlanMapper
;
import
cn.timer.api.dto.insure.ProductDto
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.ResultUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
net.sf.json.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 投保方案
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-09-23 11:53:23
*/
@Api
(
tags
=
"8.0保险列表"
)
@RestController
@Transactional
@RequestMapping
(
value
=
"/insurePlan"
,
produces
=
{
"application/json"
})
public
class
InsurePlanController
{
@Autowired
private
InsurePlanMapper
insurePlanMapper
;
@Autowired
private
InsureProductPlanMapper
insureProductPlanMapper
;
@GetMapping
(
value
=
"/planList"
)
@ApiOperation
(
value
=
"方案列表"
,
httpMethod
=
"GET"
,
notes
=
"方案列表"
)
public
Result
<
Object
>
planList
()
{
List
<
InsurePlan
>
list
=
insurePlanMapper
.
getList
();
Map
<
String
,
List
<
InsurePlan
>>
map
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
InsurePlan:
:
getType
));
return
ResultUtil
.
data
(
map
);
}
@GetMapping
(
value
=
"/getPlanListbyProduct"
)
@ApiOperation
(
value
=
"产品方案列表"
,
httpMethod
=
"GET"
,
notes
=
"产品方案列表"
)
public
Result
<
Object
>
getPlanListbyProduct
(
@RequestParam
(
"productId"
)
Integer
productId
)
{
List
<
ProductDto
>
list
=
insureProductPlanMapper
.
getListByProductId
(
productId
);
return
ResultUtil
.
data
(
list
);
}
@PostMapping
(
value
=
"/savePlan"
)
@ApiOperation
(
value
=
"保存方案"
,
httpMethod
=
"POST"
,
notes
=
"保存方案"
)
public
Result
<
Object
>
savePlan
(
@RequestBody
ProductDto
productDto
)
{
InsureProduct
insureProduct
=
InsureProduct
.
builder
().
id
(
productDto
.
getProductId
()).
build
().
selectById
();
InsureProductPlan
insureProductPlan
=
InsureProductPlan
.
builder
().
productId
(
insureProduct
.
getId
())
.
createTime
(
new
Date
()).
name
(
productDto
.
getPlanName
()).
price
(
productDto
.
getPrice
()).
planJson
(
productDto
.
getPlanJson
().
toString
()).
build
();
if
(
insureProductPlan
.
insert
())
{
return
ResultUtil
.
data
(
"保存成功"
);
}
return
ResultUtil
.
error
(
"保存失败"
);
}
;
}
src/main/java/cn/timer/api/controller/insure/InsureProductController.java
View file @
4f3e8e64
package
cn
.
timer
.
api
.
controller
.
insure
;
package
cn
.
timer
.
api
.
controller
.
insure
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
cn.timer.api.bean.insure.InsureProduct
;
import
cn.timer.api.bean.insure.InsureProduct
;
import
cn.timer.api.dao.insure.InsureProductMapper
;
import
cn.timer.api.dao.insure.InsureProductMapper
;
import
cn.timer.api.dto.insure.PolicyDto
;
import
cn.timer.api.dto.insure.PolicyDto
;
import
cn.timer.api.dto.insure.ProductDto
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.ResultUtil
;
import
cn.timer.api.utils.ResultUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
@@ -29,17 +31,26 @@ import org.springframework.web.bind.annotation.*;
...
@@ -29,17 +31,26 @@ import org.springframework.web.bind.annotation.*;
@RestController
@RestController
@Transactional
@Transactional
@RequestMapping
(
value
=
"/insureProduct"
,
produces
=
{
"application/json"
})
@RequestMapping
(
value
=
"/insureProduct"
,
produces
=
{
"application/json"
})
public
class
InsureProductController
{
public
class
InsureProductController
{
@Autowired
@Autowired
private
InsureProductMapper
insureProductMapper
;
private
InsureProductMapper
insureProductMapper
;
@GetMapping
(
value
=
"/productList"
)
@GetMapping
(
value
=
"/productList"
)
@ApiOperation
(
value
=
"12.产品列表"
,
httpMethod
=
"GET"
,
notes
=
"产品列表"
)
@ApiOperation
(
value
=
"12.产品列表"
,
httpMethod
=
"GET"
,
notes
=
"产品列表"
)
public
Result
<
Object
>
productList
()
{
public
Result
<
Object
>
productList
()
{
List
<
InsureProduct
>
productList
=
InsureProduct
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
InsureProduct
>().
lambda
().
eq
(
InsureProduct:
:
getIsDel
,
0
));
List
<
InsureProduct
>
productList
=
InsureProduct
.
builder
().
build
().
selectList
(
new
QueryWrapper
<
InsureProduct
>().
lambda
().
eq
(
InsureProduct:
:
getIsDel
,
0
));
if
(
productList
.
size
()>
0
)
{
return
ResultUtil
.
data
(
productList
);
return
ResultUtil
.
data
(
productList
);
}
}
return
ResultUtil
.
error
(
"暂无产品"
);
@PostMapping
(
value
=
"/saveProduct"
)
@ApiOperation
(
value
=
"保存产品"
,
httpMethod
=
"POST"
,
notes
=
"保存产品"
)
public
Result
<
Object
>
saveProduct
(
@RequestBody
InsureProduct
insureProduct
)
{
insureProduct
.
setCreateTime
(
new
Date
());
if
(
insureProduct
.
insert
())
{
return
ResultUtil
.
data
(
"添加产品成功"
);
}
return
ResultUtil
.
error
(
"添加产品失败"
);
}
}
;
}
}
src/main/java/cn/timer/api/controller/insure/InsureUserController.java
View file @
4f3e8e64
...
@@ -12,6 +12,7 @@ import java.util.Optional;
...
@@ -12,6 +12,7 @@ import java.util.Optional;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
cn.timer.api.bean.insure.InsurePolicy
;
import
cn.timer.api.bean.insure.InsurePolicy
;
import
cn.timer.api.bean.insure.InsureProductPlan
;
import
cn.timer.api.bean.insure.InsureUser
;
import
cn.timer.api.bean.insure.InsureUser
;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.config.annotation.UserBean
;
...
@@ -69,6 +70,9 @@ public class InsureUserController{
...
@@ -69,6 +70,9 @@ public class InsureUserController{
@ApiOperation
(
value
=
"被保人详情"
,
httpMethod
=
"POST"
,
notes
=
"保单列表"
)
@ApiOperation
(
value
=
"被保人详情"
,
httpMethod
=
"POST"
,
notes
=
"保单列表"
)
public
Result
<
Object
>
userDetial
(
@RequestParam
(
"userId"
)
String
userId
)
{
public
Result
<
Object
>
userDetial
(
@RequestParam
(
"userId"
)
String
userId
)
{
InsureUser
user
=
InsureUser
.
builder
().
id
(
Integer
.
parseInt
(
userId
)).
build
().
selectById
();
InsureUser
user
=
InsureUser
.
builder
().
id
(
Integer
.
parseInt
(
userId
)).
build
().
selectById
();
InsureProductPlan
insureProductPlan
=
InsureProductPlan
.
builder
().
id
(
user
.
getProductPlanId
()).
build
().
selectById
();
user
.
setPlanIds
(
JSON
.
parseArray
(
insureProductPlan
.
getPlanJson
(),
String
.
class
));
user
.
setProductName
(
insureProductPlan
.
getName
());
return
ResultUtil
.
data
(
user
);
return
ResultUtil
.
data
(
user
);
}
}
...
...
src/main/java/cn/timer/api/controller/insure/enums/PlanEnum.java
View file @
4f3e8e64
...
@@ -4,7 +4,7 @@ import cn.timer.api.utils.ExcelUtils;
...
@@ -4,7 +4,7 @@ import cn.timer.api.utils.ExcelUtils;
/**
/**
* @Description TODO
* @Description TODO
* @Author wgd
* @Author wgd
2022/09/26 废弃枚举类
* @Date 2022/3/24 17:20
* @Date 2022/3/24 17:20
*/
*/
public
enum
PlanEnum
{
public
enum
PlanEnum
{
...
@@ -20,6 +20,7 @@ public enum PlanEnum {
...
@@ -20,6 +20,7 @@ public enum PlanEnum {
B_100
(
40
,
"100万意外/10万医疗/扩展24小时(B类)"
,
"B类"
,
"36972"
,
"63120"
),
B_100
(
40
,
"100万意外/10万医疗/扩展24小时(B类)"
,
"B类"
,
"36972"
,
"63120"
),
C_50
(
60
,
"50万意外/5万医疗/扩展24小时(C类)"
,
"C类"
,
"36969"
,
"63121"
),
C_50
(
60
,
"50万意外/5万医疗/扩展24小时(C类)"
,
"C类"
,
"36969"
,
"63121"
),
C_80
(
75
,
"80万意外/10万医疗/扩展24小时(C类)"
,
"C类"
,
"36970"
,
"63121"
);
C_80
(
75
,
"80万意外/10万医疗/扩展24小时(C类)"
,
"C类"
,
"36970"
,
"63121"
);
private
Integer
price
;
private
Integer
price
;
private
String
name
;
private
String
name
;
private
String
type
;
private
String
type
;
...
...
src/main/java/cn/timer/api/dao/insure/InsurePlanMapper.java
0 → 100644
View file @
4f3e8e64
package
cn
.
timer
.
api
.
dao
.
insure
;
import
cn.timer.api.bean.insure.InsurePlan
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* 投保方案
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-09-23 11:53:23
*/
@Repository
public
interface
InsurePlanMapper
extends
BaseMapper
<
InsurePlan
>
{
List
<
InsurePlan
>
getList
();
List
<
InsurePlan
>
findPlanByIds
(
@Param
(
"list"
)
List
ids
);
}
src/main/java/cn/timer/api/dao/insure/InsureProductPlanMapper.java
0 → 100644
View file @
4f3e8e64
package
cn
.
timer
.
api
.
dao
.
insure
;
import
cn.timer.api.bean.insure.InsurePlan
;
import
cn.timer.api.bean.insure.InsureProduct
;
import
cn.timer.api.bean.insure.InsureProductPlan
;
import
cn.timer.api.dto.insure.ProductDto
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* 投保方案中间表
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-09-26 10:06:39
*/
@Repository
public
interface
InsureProductPlanMapper
extends
BaseMapper
<
InsureProductPlan
>
{
List
<
ProductDto
>
getListByProductId
(
@Param
(
"productId"
)
Integer
productId
);
}
src/main/java/cn/timer/api/dto/insure/InsureDto.java
View file @
4f3e8e64
...
@@ -27,7 +27,9 @@ public class InsureDto {
...
@@ -27,7 +27,9 @@ public class InsureDto {
private
Integer
type
;
/*类型 1是新增 3是替换*/
private
Integer
type
;
/*类型 1是新增 3是替换*/
private
String
productId
;
private
String
productId
;
private
List
<
PlansDto
>
plans
;
private
List
<
PlansDto
>
plans
;
private
String
benefitBasicPlan
;
/*方案名称*/
// private String benefitBasicPlan;/*方案名称*/
/*原为方案名称,2022/09/26改为使用insure_product_plan表的id*/
private
Integer
benefitBasicPlan
;
private
String
benefitOccupationCategory
;
private
String
benefitOccupationCategory
;
private
String
tricycleFrameNumber
;
private
String
tricycleFrameNumber
;
private
String
[]
oldIds
;
private
String
[]
oldIds
;
...
...
src/main/java/cn/timer/api/dto/insure/PlansDto.java
View file @
4f3e8e64
...
@@ -11,8 +11,11 @@ import lombok.Data;
...
@@ -11,8 +11,11 @@ import lombok.Data;
public
class
PlansDto
{
public
class
PlansDto
{
private
int
index
;
private
int
index
;
private
String
[]
userIds
;
private
String
[]
userIds
;
private
String
benefitBasicPlan
;
/*方案名称*/
/*方案名称*/
// private String benefitBasicPlan;
/*原为方案名称,2022/09/26改为使用insure_product_plan表的id*/
private
Integer
benefitBasicPlan
;
private
String
benefitOccupationCategory
;
private
String
benefitOccupationCategory
;
private
String
tricycleFrameNumber
;
private
String
tricycleFrameNumber
;
private
Integer
price
;
private
Double
price
;
}
}
src/main/java/cn/timer/api/dto/insure/PolicyDto.java
View file @
4f3e8e64
...
@@ -48,4 +48,5 @@ public class PolicyDto {
...
@@ -48,4 +48,5 @@ public class PolicyDto {
private
String
userName
;
private
String
userName
;
private
String
companyName
;
private
String
companyName
;
private
boolean
isAll
=
false
;
private
boolean
isAll
=
false
;
private
Integer
productPlanId
;
}
}
src/main/java/cn/timer/api/dto/insure/ProductDto.java
0 → 100644
View file @
4f3e8e64
package
cn
.
timer
.
api
.
dto
.
insure
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Description TODO
* @Author wgd
* @Date 2022/9/26 9:45
*/
@Data
public
class
ProductDto
{
private
Integer
id
;
private
Integer
productId
;
private
String
planName
;
private
String
planJson
;
private
double
price
;
private
Date
createTime
;
private
List
plans
;
}
src/main/resources/mapping/insure/InsurePlanMapper.xml
0 → 100644
View file @
4f3e8e64
<?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.InsurePlanMapper"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"cn.timer.api.bean.insure.InsurePlan"
id=
"insurePlanMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"planId"
column=
"plan_id"
/>
<result
property=
"type"
column=
"type"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"deleteFlag"
column=
"delete_flag"
/>
<result
property=
"typeName"
column=
"type_name"
/>
</resultMap>
<select
id=
"getList"
resultType=
"cn.timer.api.bean.insure.InsurePlan"
>
select * from insure_plan where delete_flag = 0
</select>
<select
id=
"findPlanByIds"
resultType=
"cn.timer.api.bean.insure.InsurePlan"
>
select * from insure_plan WHERE id in
<foreach
item=
"item"
index=
"index"
collection=
"list"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</select>
</mapper>
src/main/resources/mapping/insure/InsurePolicyMapper.xml
View file @
4f3e8e64
...
@@ -238,7 +238,7 @@
...
@@ -238,7 +238,7 @@
ip.id AS id,
ip.id AS id,
ip.policy_no AS policyNo,
ip.policy_no AS policyNo,
ip.create_time as createTime,
ip.create_time as createTime,
ip
.scheme_
name AS schemeName,
ip
p.
name AS schemeName,
qy.`name` as `name`,
qy.`name` as `name`,
count( iu.id ) AS totalUser,
count( iu.id ) AS totalUser,
ip.policy_date_start as policyDateStart,
ip.policy_date_start as policyDateStart,
...
@@ -252,6 +252,7 @@
...
@@ -252,6 +252,7 @@
insure_policy ip
insure_policy ip
LEFT JOIN insure_user iu ON iu.policy_id = ip.id
LEFT JOIN insure_user iu ON iu.policy_id = ip.id
LEFT JOIN qyzx_ent_info_m qy on qy.id=ip.org_code
LEFT JOIN qyzx_ent_info_m qy on qy.id=ip.org_code
LEFT JOIN insure_product_plan ipp ON iu.product_plan_id = ipp.id
<where>
<where>
<if
test=
"policy.productId!=null and policy.productId!=''"
>
<if
test=
"policy.productId!=null and policy.productId!=''"
>
and ip.product_id = #{policy.productId}
and ip.product_id = #{policy.productId}
...
@@ -263,7 +264,7 @@
...
@@ -263,7 +264,7 @@
and ip.org_code = #{policy.orgCode}
and ip.org_code = #{policy.orgCode}
</if>
</if>
<if
test=
"policy.benefitBasicPlan!=null and policy.benefitBasicPlan!=''"
>
<if
test=
"policy.benefitBasicPlan!=null and policy.benefitBasicPlan!=''"
>
and iu.
benefit_basic_plan
= #{policy.benefitBasicPlan}
and iu.
product_plan_id
= #{policy.benefitBasicPlan}
</if>
</if>
<if
test=
"policy.policyDateStart!=null and policy.policyDateStart!=''"
>
<if
test=
"policy.policyDateStart!=null and policy.policyDateStart!=''"
>
and ip.policy_date_start
<![CDATA[ >= ]]>
#{policy.policyDateStart}
and ip.policy_date_start
<![CDATA[ >= ]]>
#{policy.policyDateStart}
...
@@ -319,11 +320,15 @@
...
@@ -319,11 +320,15 @@
iu.insured_name as insuredName,
iu.insured_name as insuredName,
iu.benefit_basic_plan as benefitBasicPlan,
iu.benefit_basic_plan as benefitBasicPlan,
iu.benefit_occupation_category as benefitOccupationCategory,
iu.benefit_occupation_category as benefitOccupationCategory,
iu.product_plan_id as productPlanId,
ip.policy_pay_type as policyPayType,
ip.policy_pay_type as policyPayType,
ip.product_id as productId
ip.product_id as productId,
iu.product_plan_id as productPlanId,
ipp.name as name
FROM
FROM
insure_policy ip
insure_policy ip
LEFT JOIN insure_user iu ON iu.policy_id = ip.id
LEFT JOIN insure_user iu ON iu.policy_id = ip.id
left join insure_product_plan ipp on ipp.id=iu.product_plan_id
WHERE
WHERE
ip.id = #{id}
ip.id = #{id}
LIMIT 1
LIMIT 1
...
...
src/main/resources/mapping/insure/InsureProductPlanMapper.xml
0 → 100644
View file @
4f3e8e64
<?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.InsureProductPlanMapper"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"cn.timer.api.bean.insure.InsureProductPlan"
id=
"insureProductPlanMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"planJson"
column=
"plan_json"
/>
<result
property=
"price"
column=
"price"
/>
<result
property=
"productId"
column=
"product_id"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"deleteFlag"
column=
"delete_flag"
/>
<result
property=
"name"
column=
"name"
/>
</resultMap>
<select
id=
"getListByProductId"
resultType=
"cn.timer.api.dto.insure.ProductDto"
>
select ipp.id as id,
ipp.price as price,
ipp.plan_json as planJson,
ipp.`name` as planName,
ipp.create_time as createTime
from insure_product_plan ipp
LEFT JOIN insure_product ip on ip.id = ipp.product_id
WHERE ip.id = #{productId}
</select>
</mapper>
src/main/resources/mapping/insure/InsureUserMapper.xml
View file @
4f3e8e64
...
@@ -32,6 +32,8 @@
...
@@ -32,6 +32,8 @@
<result
property=
"applyType"
column=
"apply_type"
/>
<result
property=
"applyType"
column=
"apply_type"
/>
<result
property=
"reason"
column=
"reason"
/>
<result
property=
"reason"
column=
"reason"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"productPlanId"
column=
"product_plan_id"
/>
</resultMap>
</resultMap>
<select
id=
"queryObject"
resultType=
"cn.timer.api.bean.insure.InsureUser"
>
<select
id=
"queryObject"
resultType=
"cn.timer.api.bean.insure.InsureUser"
>
...
@@ -303,7 +305,7 @@
...
@@ -303,7 +305,7 @@
and ip.id=#{policyDto.id}
and ip.id=#{policyDto.id}
</if>
</if>
<if
test=
"policyDto.planId !=null and policyDto.planId !=''"
>
<if
test=
"policyDto.planId !=null and policyDto.planId !=''"
>
and iu.
benefit_basic_plan
= #{policyDto.planId}
and iu.
product_plan_id
= #{policyDto.planId}
</if>
</if>
<if
test=
"policyDto.categoryId !=null and policyDto.categoryId !=''"
>
<if
test=
"policyDto.categoryId !=null and policyDto.categoryId !=''"
>
and iu.benefit_occupation_category = #{policyDto.categoryId}
and iu.benefit_occupation_category = #{policyDto.categoryId}
...
@@ -429,13 +431,16 @@
...
@@ -429,13 +431,16 @@
</select>
</select>
<select
id=
"selectPlansListById"
resultType=
"cn.timer.api.dto.insure.InsureUserDto"
>
<select
id=
"selectPlansListById"
resultType=
"cn.timer.api.dto.insure.InsureUserDto"
>
SELECT policy_id as policyId,
SELECT iu.policy_id as policyId,
benefit_basic_plan as benefitBasicPlan,
iu.benefit_basic_plan as benefitBasicPlan,
benefit_occupation_category as benefitOccupationCategory,
iu.benefit_occupation_category as benefitOccupationCategory,/*废弃*/
count(id) as totalUser
count(iu.id) as totalUser,
FROM insure_user
iu.product_plan_id as productPlanId,
ipp.name as name
FROM insure_user iu
left join insure_product_plan ipp on ipp.id=iu.product_plan_id
WHERE policy_id = #{policyId}
WHERE policy_id = #{policyId}
group by
benefit_basic_plan,
benefit_occupation_category
group by benefit_occupation_category
</select>
</select>
<update
id=
"updateInsure"
>
<update
id=
"updateInsure"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment