Commit ceda0a63 authored by yangyang's avatar yangyang

对接聚富通

parent 807ed8e4
...@@ -28,7 +28,7 @@ public class IcbcEnum { ...@@ -28,7 +28,7 @@ public class IcbcEnum {
@AllArgsConstructor @AllArgsConstructor
public static enum OpenAccountState { public static enum OpenAccountState {
INITIAL("初始", "00"), INITIAL("未开户", "00"),
OPENING("开户中", "01"), OPENING("开户中", "01"),
......
...@@ -36,4 +36,12 @@ public class HygfIcbcRecordQueryDTO { ...@@ -36,4 +36,12 @@ public class HygfIcbcRecordQueryDTO {
@ApiModelProperty (value = "所属地址") @ApiModelProperty (value = "所属地址")
private String address; private String address;
private Integer current;
private Integer size;
private Integer limit;
private Integer offset;
} }
...@@ -21,5 +21,8 @@ import java.util.List; ...@@ -21,5 +21,8 @@ import java.util.List;
public interface HygfIcbcRecordMapper extends BaseMapper<HygfIcbcRecord> { public interface HygfIcbcRecordMapper extends BaseMapper<HygfIcbcRecord> {
@UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and") @UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and")
Integer listObjectCount(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO);
@UserEmpower (field = {"ph.regional_companies_code"}, dealerField = {"ph.developer_code", "ph.regional_companies_code", "ph.developer_user_id"}, fieldConditions = {"in", "in", "in"}, relationship = "and")
List<HygfIcbcRecordDTO> listObject(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO); List<HygfIcbcRecordDTO> listObject(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO);
} }
...@@ -9,6 +9,34 @@ ...@@ -9,6 +9,34 @@
sequence_nbr,cust_name,id_card,phone,medium_id,project_id,open_account_state,protocol_status,protocol_start_time,protocol_end_time,trx_limit_amount,day_limit_amount,protocol_limit_amount,app_id,out_user_id,out_vendor_id,sign_entrsut_prtl_status sequence_nbr,cust_name,id_card,phone,medium_id,project_id,open_account_state,protocol_status,protocol_start_time,protocol_end_time,trx_limit_amount,day_limit_amount,protocol_limit_amount,app_id,out_user_id,out_vendor_id,sign_entrsut_prtl_status
</sql> </sql>
<select id="listObjectCount" resultType="integer">
SELECT count(1)
FROM
hygf_peasant_household ph LEFT JOIN hygf_icbc_record icbc ON ph.amos_user_id = icbc.amos_user_id
<where>
ph.is_delete = 0
<if test="param != null">
<if test="param.openAccountStatus != null and param.openAccountStatus != ''">
AND icbc.protocol_status = #{param.openAccountStatus}
</if>
<if test="param.custName != null and param.custName != ''">
AND ph.owners_name LIKE CONCAT('%', #{param.custName}, '%')
</if>
<if test="param.idCard != null and param.idCard != ''">
AND ph.id_card LIKE CONCAT('%', #{param.idCard}, '%')
</if>
<if test="param.phone != null and param.phone != ''">
AND ph.telephone LIKE CONCAT('%', #{param.phone}, '%')
</if>
<if test="param.regionalCompaniesSeq != null and param.regionalCompaniesSeq != ''">
AND ph.regional_companies_seq = #{param.regionalCompaniesSeq}
</if>
</if>
</where>
GROUP BY
ph.amos_user_id
</select>
<select id="listObject" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO"> <select id="listObject" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO">
SELECT DISTINCT SELECT DISTINCT
icbc.sequence_nbr, icbc.sequence_nbr,
...@@ -40,6 +68,9 @@ ...@@ -40,6 +68,9 @@
</if> </if>
</if> </if>
</where> </where>
<if test="param.offset != null and param.offset != '' and param.limit != null and param.limit != ''">
LIMIT ${param.offset}, ${param.limit}
</if>
GROUP BY GROUP BY
ph.amos_user_id ph.amos_user_id
ORDER BY ORDER BY
......
...@@ -104,11 +104,9 @@ public class HygfIcbcController extends BaseController { ...@@ -104,11 +104,9 @@ public class HygfIcbcController extends BaseController {
@GetMapping (value = "/page") @GetMapping (value = "/page")
@ApiOperation (httpMethod = "GET", value = "聚富通电子钱包分页查询", notes = "聚富通电子钱包分页查询") @ApiOperation (httpMethod = "GET", value = "聚富通电子钱包分页查询", notes = "聚富通电子钱包分页查询")
@UserLimits @UserLimits
public ResponseModel<Page<HygfIcbcRecordDTO>> queryForPage(@RequestParam (value = "current") int current, public ResponseModel<Page<HygfIcbcRecordDTO>> queryForPage(@ApiParam HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) {
@RequestParam(value = "size") int size,
@ApiParam @RequestParam HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) {
return ResponseHelper.buildResponse(hygfIcbcService.queryForPage(current, size, hygfIcbcRecordQueryDTO)); return ResponseHelper.buildResponse(hygfIcbcService.queryForPage(hygfIcbcRecordQueryDTO.getCurrent(), hygfIcbcRecordQueryDTO.getSize(), hygfIcbcRecordQueryDTO));
} }
} }
...@@ -292,16 +292,16 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -292,16 +292,16 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
} }
public Page<HygfIcbcRecordDTO> queryForPage(int current, int size, HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) { public Page<HygfIcbcRecordDTO> queryForPage(int current, int size, HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) {
PageHelper.startPage(current, size); // PageHelper.startPage(current, size);
// List<HygfIcbcRecord> hygfIcbcRecords = this.lambdaQuery().eq(StringUtils.isNotEmpty(hygfIcbcRecordQueryDTO.getOpenAccountState()), HygfIcbcRecord::getOpenAccountState, hygfIcbcRecordQueryDTO.getOpenAccountState()).like(StringUtils.isNotEmpty(hygfIcbcRecordQueryDTO.getCustName()), HygfIcbcRecord::getCustName, hygfIcbcRecordQueryDTO.getCustName()).like(StringUtils.isNotEmpty(hygfIcbcRecordQueryDTO.getIdCard()), HygfIcbcRecord::getIdCard, hygfIcbcRecordQueryDTO.getIdCard()).eq(StringUtils.isNotEmpty(hygfIcbcRecordQueryDTO.getPhone()), HygfIcbcRecord::getPhone, hygfIcbcRecordQueryDTO.getPhone()).list(); Integer total = hygfIcbcRecordMapper.listObjectCount(hygfIcbcRecordQueryDTO);
hygfIcbcRecordQueryDTO.setLimit(size);
hygfIcbcRecordQueryDTO.setOffset((current - 1) * size);
List<HygfIcbcRecordDTO> list = hygfIcbcRecordMapper.listObject(hygfIcbcRecordQueryDTO); List<HygfIcbcRecordDTO> list = hygfIcbcRecordMapper.listObject(hygfIcbcRecordQueryDTO);
toModels(list);
PageInfo<HygfIcbcRecordDTO> pageInfo = new PageInfo<>(list);
Page<HygfIcbcRecordDTO> page = new Page<>(); Page<HygfIcbcRecordDTO> page = new Page<>();
page.setSize(pageInfo.getSize()); page.setSize(size);
page.setCurrent(pageInfo.getPageNum()); page.setCurrent(current);
page.setTotal(pageInfo.getTotal()); page.setTotal(total);
page.setRecords(list); page.setRecords(toModels(list));
return page; return page;
} }
......
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