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
a9397a26
Commit
a9397a26
authored
Mar 31, 2022
by
翁国栋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
运营后台--
用户保单列表条件查询
parent
ff32ab44
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
15 deletions
+37
-15
src/main/java/cn/timer/api/controller/insure/InsureUserController.java
+12
-5
src/main/java/cn/timer/api/dao/insure/InsureUserMapper.java
+2
-2
src/main/resources/mapping/insure/InsureUserMapper.xml
+23
-8
No files found.
src/main/java/cn/timer/api/controller/insure/InsureUserController.java
View file @
a9397a26
...
@@ -4,6 +4,7 @@ import java.util.List;
...
@@ -4,6 +4,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.Optional
;
import
cn.timer.api.bean.insure.InsurePolicy
;
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
;
...
@@ -12,6 +13,7 @@ import cn.timer.api.dto.insure.PolicyDto;
...
@@ -12,6 +13,7 @@ import cn.timer.api.dto.insure.PolicyDto;
import
cn.timer.api.utils.Page
;
import
cn.timer.api.utils.Page
;
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.beust.jcommander.internal.Lists
;
import
com.beust.jcommander.internal.Lists
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
...
@@ -41,9 +43,9 @@ public class InsureUserController{
...
@@ -41,9 +43,9 @@ public class InsureUserController{
@ApiOperation
(
value
=
"3.保单列表--运营后台"
,
httpMethod
=
"Post"
,
notes
=
"保单列表"
)
@ApiOperation
(
value
=
"3.保单列表--运营后台"
,
httpMethod
=
"Post"
,
notes
=
"保单列表"
)
public
Result
<
Object
>
policyList
(
@RequestBody
PolicyDto
policyDto
)
{
public
Result
<
Object
>
policyList
(
@RequestBody
PolicyDto
policyDto
)
{
Map
map
=
Maps
.
newHashMap
();
Map
map
=
Maps
.
newHashMap
();
List
<
PolicyDto
>
list
=
insureUserMapper
.
selectPolicyList
(
policyDto
.
getPage
(),
String
.
valueOf
(
policyDto
.
getId
())
);
List
<
PolicyDto
>
list
=
insureUserMapper
.
selectPolicyList
(
policyDto
);
map
.
put
(
"list"
,
Optional
.
ofNullable
(
list
).
orElse
(
Lists
.
newArrayList
()));
map
.
put
(
"list"
,
Optional
.
ofNullable
(
list
).
orElse
(
Lists
.
newArrayList
()));
map
.
put
(
"total"
,
insureUserMapper
.
totalUser
(
String
.
valueOf
(
policyDto
.
getId
())
));
map
.
put
(
"total"
,
insureUserMapper
.
totalUser
(
policyDto
));
return
ResultUtil
.
data
(
map
);
return
ResultUtil
.
data
(
map
);
}
}
@GetMapping
(
value
=
"/userDetial"
)
@GetMapping
(
value
=
"/userDetial"
)
...
@@ -55,11 +57,16 @@ public class InsureUserController{
...
@@ -55,11 +57,16 @@ public class InsureUserController{
@PostMapping
(
value
=
"/userPolicyList"
)
@PostMapping
(
value
=
"/userPolicyList"
)
@ApiOperation
(
value
=
"3.保单列表--8小时端"
,
httpMethod
=
"Post"
,
notes
=
"保单列表"
)
@ApiOperation
(
value
=
"3.保单列表--8小时端"
,
httpMethod
=
"Post"
,
notes
=
"保单列表"
)
public
Result
<
Object
>
userPolicyList
(
@CurrentUser
UserBean
userBean
,
@RequestBody
Page
page
)
{
public
Result
<
Object
>
userPolicyList
(
@CurrentUser
UserBean
userBean
,
PolicyDto
policyDto
)
{
Map
map
=
Maps
.
newHashMap
();
Map
map
=
Maps
.
newHashMap
();
List
<
PolicyDto
>
list
=
insureUserMapper
.
selectPolicyList
(
page
,
String
.
valueOf
(
userBean
.
getOrgCode
()));
InsurePolicy
insurePolicy
=
InsurePolicy
.
builder
().
build
().
selectOne
(
new
QueryWrapper
<
InsurePolicy
>().
lambda
().
eq
(
InsurePolicy:
:
getOrgCode
,
userBean
.
getOrgCode
()).
eq
(
InsurePolicy:
:
getStatus
,
1
));
if
(
insurePolicy
==
null
){
return
ResultUtil
.
error
(
"保单号不存在"
);
}
policyDto
.
setId
(
insurePolicy
.
getId
());
List
<
PolicyDto
>
list
=
insureUserMapper
.
selectPolicyList
(
policyDto
);
map
.
put
(
"list"
,
Optional
.
ofNullable
(
list
).
orElse
(
Lists
.
newArrayList
()));
map
.
put
(
"list"
,
Optional
.
ofNullable
(
list
).
orElse
(
Lists
.
newArrayList
()));
map
.
put
(
"total"
,
insureUserMapper
.
totalUser
(
String
.
valueOf
(
userBean
.
getOrgCode
())
));
map
.
put
(
"total"
,
insureUserMapper
.
totalUser
(
policyDto
));
return
ResultUtil
.
data
(
map
);
return
ResultUtil
.
data
(
map
);
}
}
...
...
src/main/java/cn/timer/api/dao/insure/InsureUserMapper.java
View file @
a9397a26
...
@@ -19,8 +19,8 @@ import java.util.List;
...
@@ -19,8 +19,8 @@ import java.util.List;
*/
*/
@Repository
@Repository
public
interface
InsureUserMapper
extends
BaseMapper
<
InsureUser
>
{
public
interface
InsureUserMapper
extends
BaseMapper
<
InsureUser
>
{
List
<
PolicyDto
>
selectPolicyList
(
@Param
(
"p
age"
)
Page
page
,
@Param
(
"id"
)
String
id
);
List
<
PolicyDto
>
selectPolicyList
(
@Param
(
"p
olicyDto"
)
PolicyDto
policyDto
);
Integer
totalUser
(
@Param
(
"
id"
)
String
id
);
Integer
totalUser
(
@Param
(
"
policyDto"
)
PolicyDto
policyDto
);
List
<
InsureUser
>
selectListByIds
(
@Param
(
"array"
)
String
[]
ids
);
List
<
InsureUser
>
selectListByIds
(
@Param
(
"array"
)
String
[]
ids
);
}
}
src/main/resources/mapping/insure/InsureUserMapper.xml
View file @
a9397a26
...
@@ -283,12 +283,20 @@
...
@@ -283,12 +283,20 @@
from insure_user iu
from insure_user iu
LEFT JOIN yggl_main_emp yme on yme.id=iu.user_id
LEFT JOIN yggl_main_emp yme on yme.id=iu.user_id
LEFT JOIN insure_policy ip on ip.id=iu.policy_id
LEFT JOIN insure_policy ip on ip.id=iu.policy_id
where yme.org_code = 3
<where>
<if
test=
"id !=null and id !=''"
>
ip.id=#{policyDto.id}
and ip.id=#{id}
<if
test=
"policyDto.name !=null and policyDto.name !=''"
>
and iu.insured_e_contact like CONCAT('%',#{policyDto.name},'%')
</if>
<if
test=
"policyDto.policyDateStart !=null and policyDto.policyDateStart !=''"
>
and iu.policy_date_start
<![CDATA[>=]]>
#{policyDto.policyDateStart}
</if>
<if
test=
"policyDto.status !=null and policyDto.status !=''"
>
and iu.insure_status = #{policyDto.status}
</if>
</if>
<if
test=
"page.offset != null and page.totalPage !=null"
>
</where>
limit #{page.offset},#{page.totalPage}
<if
test=
"policyDto.page.offset != null and policyDto.page.totalPage !=null"
>
LIMIT #{policyDto.page.offset},#{policyDto.page.totalPage}
</if>
</if>
</select>
</select>
...
@@ -296,10 +304,17 @@
...
@@ -296,10 +304,17 @@
select count(iu.id) from insure_user iu
select count(iu.id) from insure_user iu
LEFT JOIN yggl_main_emp yme on yme.id=iu.user_id
LEFT JOIN yggl_main_emp yme on yme.id=iu.user_id
LEFT JOIN insure_policy ip on ip.id=iu.policy_id
LEFT JOIN insure_policy ip on ip.id=iu.policy_id
where yme.org_code = 3
<where>
<if
test=
"id !=null and id !=''"
>
<if
test=
"policyDto.id !=null and policyDto.id !=''"
>
and ip.id=#{id}
and ip.id=#{policyDto.id}
</if>
<if
test=
"policyDto.name !=null and policyDto.name !=''"
>
and iu.insured_e_contact like CONCAT('%',#{policyDto.name},'%')
</if>
<if
test=
"policyDto.policyDateStart !=null and policyDto.policyDateStart !=''"
>
and iu.policy_date_start
<![CDATA[>=]]>
#{policyDto.policyDateStart}
</if>
</if>
</where>
</select>
</select>
<!--根据id数组查询员工-->
<!--根据id数组查询员工-->
...
...
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