Commit 3879b600 authored by wujiang's avatar wujiang

提交代码

parent 3ec52e68
...@@ -28,7 +28,7 @@ public interface HygfIcbcRecordMapper extends BaseMapper<HygfIcbcRecord> { ...@@ -28,7 +28,7 @@ public interface HygfIcbcRecordMapper extends BaseMapper<HygfIcbcRecord> {
List<HygfIcbcRecordDTO> listObject(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO); List<HygfIcbcRecordDTO> listObject(@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") @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> pageList(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO); List<HygfIcbcRecordDTO> pageList(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO,@Param("current") int current,@Param("size") int size);
@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<HygfIcbcRecordDTO> pageListSum(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO); List<HygfIcbcRecordDTO> pageListSum(@Param ("param") HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO);
......
...@@ -490,7 +490,7 @@ ...@@ -490,7 +490,7 @@
and hygf_peasant_household.preparation_money_state in ('待发货','待补货','暂存发货') and hygf_peasant_household.preparation_money_state in ('待发货','待补货','暂存发货')
</if> </if>
<if test="map.regionalCompaniesSeq!=null and map.regionalCompaniesSeq !='' "> <if test="map.regionalCompaniesSeq!=null and map.regionalCompaniesSeq !='' ">
and hygf_peasant_household.regional_companies_code like concat('%',#{map.regionalCompaniesSeq},'%') and hygf_peasant_household.regional_companies_code like concat('%',#{map.regionalCompaniesSeq},'%')
</if> </if>
<if test="map.developerId!=null and map.developerId !=''"> <if test="map.developerId!=null and map.developerId !=''">
and hygf_peasant_household.developer_code like concat('%',#{map.developerId},'%') and hygf_peasant_household.developer_code like concat('%',#{map.developerId},'%')
......
...@@ -95,9 +95,9 @@ ...@@ -95,9 +95,9 @@
<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
MAX(icbc.sequence_nbr) AS sequenceNbr, MAX(icbc.sequence_nbr) AS sequenceNbr,
MAX(ifnull ( icbc.cust_name, ph.owners_name )) AS custName, MAX(ph.owners_name ) AS custName,
MAX(ifnull ( icbc.phone, ph.telephone )) AS phone, MAX(ph.telephone) AS phone,
MAX(ifnull ( icbc.id_card, ph.id_card )) AS idCard, MAX(ph.id_card) AS idCard,
MAX(ph.amos_user_id) AS amosUserId, MAX(ph.amos_user_id) AS amosUserId,
MAX(icbc.open_account_status) AS openAccountStatus, MAX(icbc.open_account_status) AS openAccountStatus,
MAX(icbc.out_user_id) AS outUserId, MAX(icbc.out_user_id) AS outUserId,
...@@ -132,11 +132,11 @@ ...@@ -132,11 +132,11 @@
</if> </if>
) 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 = ph.amos_user_id
<where> <where>
1=1 1=1
<if test="param.type != null and param.type != ''"> <if test="param.type != null and param.type != ''">
AND icbc.type LIKE CONCAT('%', #{param.type}, '%') AND icbc.type = #{param.type}
</if> </if>
<if test="param != null"> <if test="param != null">
<if test="param.openAccountStatus != null and param.openAccountStatus != ''"> <if test="param.openAccountStatus != null and param.openAccountStatus != ''">
...@@ -155,6 +155,7 @@ ...@@ -155,6 +155,7 @@
</if> </if>
GROUP BY ph.amos_user_id GROUP BY ph.amos_user_id
ORDER BY MAX(ph.rec_date) DESC ORDER BY MAX(ph.rec_date) DESC
LIMIT #{current},#{size}
</select> </select>
<select id="pageListSum" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO"> <select id="pageListSum" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfIcbcRecordDTO">
......
...@@ -454,20 +454,19 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc ...@@ -454,20 +454,19 @@ public class HygfIcbcServiceImpl extends BaseService<HygfIcbcRecordDTO, HygfIcbc
} }
public Map<String, Object> queryForPage(int current, int size, HygfIcbcRecordQueryDTO hygfIcbcRecordQueryDTO) { public Map<String, Object> 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,current,size);
PageInfo<HygfIcbcRecordDTO> page = new PageInfo(list); PageInfo<HygfIcbcRecordDTO> page = new PageInfo(list);
//PageHelper.startPage(current, Integer.MAX_VALUE);
List<HygfIcbcRecordDTO> list1 = hygfIcbcRecordMapper.pageList(hygfIcbcRecordQueryDTO,0,Integer.MAX_VALUE);
double sum = list1.stream().filter(e -> null != e.getPaymentAmount()).mapToDouble(HygfIcbcRecordDTO::getPaymentAmount).sum();
Page<HygfIcbcRecordDTO> pagenew = new Page<>(); Page<HygfIcbcRecordDTO> pagenew = new Page<>();
pagenew.setCurrent(current); pagenew.setCurrent(current);
pagenew.setTotal(page.getTotal()); pagenew.setTotal(list1.size());
pagenew.setSize(size); pagenew.setSize(size);
pagenew.setRecords(toModels(page.getList())); pagenew.setRecords(toModels(page.getList()));
Map<String, Object> resultMap = BeanUtil.beanToMap(pagenew); Map<String, Object> resultMap = BeanUtil.beanToMap(pagenew);
List<HygfIcbcRecordDTO> list1 = hygfIcbcRecordMapper.pageListSum(hygfIcbcRecordQueryDTO);
double sum = list1.stream().filter(e -> null != e.getPaymentAmount()).mapToDouble(HygfIcbcRecordDTO::getPaymentAmount).sum();
resultMap.put("paymentAmountAll", sum); resultMap.put("paymentAmountAll", sum);
return resultMap; return resultMap;
......
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