Commit 25f80813 authored by hezhuozhi's avatar hezhuozhi

Merge remote-tracking branch 'origin/developer_bw' into developer_bw

parents 3dc98baa 71269f0a
...@@ -34,5 +34,5 @@ public interface HygfIcbcRecordMapper extends BaseMapper<HygfIcbcRecord> { ...@@ -34,5 +34,5 @@ public interface HygfIcbcRecordMapper extends BaseMapper<HygfIcbcRecord> {
List<HygfIcbcRecordExportDTO> exportTotal(String developerCode, String regionalCompaniesCode, String province, String city, String district); List<HygfIcbcRecordExportDTO> exportTotal(String developerCode, String regionalCompaniesCode, String province, String city, String district);
@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")
List<HygfIcbcRecordExportDTO> paymentAmountExport(String developerCode, String regionalCompaniesCode, String province, String city, String district); List<HygfIcbcRecordExportDTO> paymentAmountExport(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO);
} }
...@@ -95,36 +95,41 @@ ...@@ -95,36 +95,41 @@
<select id="pageList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO"> <select id="pageList" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO">
SELECT SELECT
icbc.sequence_nbr, icbc.sequence_nbr,
ifnull( icbc.cust_name, ph.owners_name ) AS custName, ifnull ( icbc.cust_name, ph.owners_name ) AS custName,
ifnull( icbc.phone, ph.telephone ) AS phone, ifnull ( icbc.phone, ph.telephone ) AS phone,
ifnull( icbc.id_card, ph.id_card ) AS idCard, ifnull ( icbc.id_card, ph.id_card ) AS idCard,
ph.amos_user_id, ph.amos_user_id,
icbc.open_account_status, icbc.open_account_status,
icbc.out_user_id as outUserId, icbc.out_user_id AS outUserId,
icbc.protocol_status, icbc.protocol_status,
icbc.medium_id, icbc.medium_id,
ph.rec_date, ph.rec_date,
ph.regional_companies_name as regionalCompaniesName, ph.regional_companies_name AS regionalCompaniesName,
ph.regional_companies_code as regionalCompaniesCode, ph.regional_companies_code AS regionalCompaniesCode,
wr.paymentAmount, wr.paymentAmount,
wr.payment_time as paymentTime wr.payment_time AS paymentTime,
wrall.paymentAmount allPaymentAmount
FROM FROM
( (
SELECT SELECT
amos_user_id, amos_user_id,
MAX(developer_code) AS developer_code, MAX ( developer_code ) AS developer_code,
MAX(regional_companies_code ) AS regional_companies_code , MAX ( regional_companies_code ) AS regional_companies_code,
MAX(is_delete) AS is_delete, MAX ( is_delete ) AS is_delete,
MAX(owners_name) AS owners_name, MAX ( owners_name ) AS owners_name,
MAX(telephone) AS telephone, MAX ( telephone ) AS telephone,
MAX(id_card) AS id_card, MAX ( id_card ) AS id_card,
MAX(regional_companies_name) AS regional_companies_name, MAX ( regional_companies_name ) AS regional_companies_name,
MAX(project_address) AS project_address, MAX ( project_address ) AS project_address,
MAX(rec_date) AS rec_date MAX ( rec_date ) AS rec_date
FROM hygf_peasant_household GROUP BY amos_user_id FROM
hygf_peasant_household
GROUP BY
amos_user_id
) ph ) ph
LEFT JOIN hygf_icbc_record icbc ON ph.amos_user_id = icbc.amos_user_id LEFT JOIN hygf_icbc_record icbc ON ph.amos_user_id = icbc.amos_user_id
LEFT JOIN ( SELECT amos_user_id, MAX ( payment_time ) payment_time, SUM ( payment_amount ) paymentAmount FROM hygf_icbc_withhold_record WHERE withhold_status = '成功' GROUP BY amos_user_id ) wr ON wr.amos_user_id = icbc.amos_user_id LEFT JOIN ( SELECT amos_user_id, MAX ( payment_time ) payment_time, SUM ( payment_amount ) paymentAmount FROM hygf_icbc_withhold_record WHERE withhold_status = '成功' GROUP BY amos_user_id ) wr ON wr.amos_user_id = icbc.amos_user_id
LEFT JOIN ( SELECT amos_user_id, SUM ( payment_amount ) paymentAmount FROM hygf_icbc_withhold_record GROUP BY amos_user_id ) wrall ON wrall.amos_user_id = icbc.amos_user_id
<where> <where>
ph.is_delete = 0 ph.is_delete = 0
<if test="param.custName != null and param.custName != ''"> <if test="param.custName != null and param.custName != ''">
...@@ -254,20 +259,31 @@ ...@@ -254,20 +259,31 @@
LEFT JOIN LEFT JOIN
PaymentAmounts pa ON pa.amos_user_id = ph.amos_user_id PaymentAmounts pa ON pa.amos_user_id = ph.amos_user_id
<where> <where>
<if test="developerCode != null and developerCode != ''"> <if test="param.custName != null and param.custName != ''">
AND ph.developer_code = #{developerCode} AND (ph.owners_name LIKE CONCAT('%', #{param.custName}, '%') OR re.cust_name LIKE CONCAT('%', #{param.custName}, '%'))
</if> </if>
<if test="regionalCompaniesCode != null and regionalCompaniesCode != ''"> <if test="param.idCard != null and param.idCard != ''">
AND ph.regional_companies_code = #{regionalCompaniesCode} AND (ph.id_card LIKE CONCAT('%', #{param.idCard}, '%') OR icbc.id_card LIKE CONCAT('%', #{param.idCard}, '%'))
</if> </if>
<if test="province != null and province != ''"> <if test="param.phone != null and param.phone != ''">
AND ph.project_address LIKE CONCAT ('%',#{province},'%') AND (ph.telephone LIKE CONCAT('%', #{param.phone}, '%') OR icbc.phone LIKE CONCAT('%', #{param.phone}, '%'))
</if> </if>
<if test="city != null and city != ''"> <if test="param.regionalCompaniesName != null and param.regionalCompaniesName != ''">
AND ph.project_address LIKE CONCAT ('%',#{city},'%') AND ph.regional_companies_name LIKE CONCAT('%', #{param.regionalCompaniesName}, '%')
</if> </if>
<if test="district != null and district != ''"> <if test="param.addressName != null and param.addressName != ''">
AND ph.project_address LIKE CONCAT ('%',#{district},'%') AND ph.project_address LIKE CONCAT('%', #{param.addressName}, '%')
</if>
<if test="param != null">
<if test="param.openAccountStatus != null and param.openAccountStatus != ''">
<if test="param.openAccountStatus != '00'">
AND re.open_account_status = #{param.openAccountStatus}
</if>
<if test="param.openAccountStatus == '00'">
AND (re.open_account_status = #{param.openAccountStatus} OR re.open_account_status is null)
</if>
</if>
</if> </if>
</where> </where>
GROUP BY GROUP BY
......
...@@ -150,4 +150,13 @@ public class HygfIcbcController extends BaseController { ...@@ -150,4 +150,13 @@ public class HygfIcbcController extends BaseController {
hygfIcbcService.exportData(response,developerCode,regionalCompaniesCode,province,city,district); hygfIcbcService.exportData(response,developerCode,regionalCompaniesCode,province,city,district);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "聚富通信息", notes = "聚富通信息")
@GetMapping(value = "/exportExcel")
public void exportData( HttpServletResponse response,HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) {
hygfIcbcService.exportExcel(response,hygfIcbcRecordQueryDTO);
}
} }
...@@ -457,9 +457,7 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -457,9 +457,7 @@ 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<HygfIcbcRecordDTO> list = hygfIcbcRecordMapper.pageList(hygfIcbcRecordQueryDTO); List<HygfIcbcRecordDTO> list = hygfIcbcRecordMapper.pageList(hygfIcbcRecordQueryDTO);
for (HygfIcbcRecordDTO hygfIcbcRecordDTO : list) {
}
PageInfo<HygfIcbcRecordDTO> page = new PageInfo(list); PageInfo<HygfIcbcRecordDTO> page = new PageInfo(list);
...@@ -684,4 +682,11 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -684,4 +682,11 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
} }
public void exportExcel(HttpServletResponse response, HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO){
List<HygfIcbcRecordExportDTO> hygfIcbcRecordExportDTOS = hygfIcbcRecordMapper.paymentAmountExport(hygfIcbcRecordQueryDTO);
if (CollectionUtil.isNotEmpty(hygfIcbcRecordExportDTOS)){
ExcelUtil.createTemplate(response,"聚富通信息","聚富通信息",hygfIcbcRecordExportDTOS, HygfIcbcRecordExportDTO.class,null,false);
}
}
} }
\ No newline at end of file
...@@ -734,6 +734,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit ...@@ -734,6 +734,7 @@ public class IcbcWithholdServiceImpl extends BaseService<IcbcWithholdDto,IcbcWit
HygfIcbcWithholdRecordExportDTO exportDTO = new HygfIcbcWithholdRecordExportDTO(); HygfIcbcWithholdRecordExportDTO exportDTO = new HygfIcbcWithholdRecordExportDTO();
BeanUtil.copyProperties(icbcWithholdRecordDto,exportDTO); BeanUtil.copyProperties(icbcWithholdRecordDto,exportDTO);
exportDTO.setDesc(icbcWithhold.getDesc()); exportDTO.setDesc(icbcWithhold.getDesc());
exportDTO.setUploader(icbcWithhold.getConfirmator());
datas.add(exportDTO); datas.add(exportDTO);
} }
......
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