master
kira 8 years ago
parent 70d8160871
commit 46cd2a2bdd

@ -432,7 +432,9 @@ public class RetailAppServiceImp implements RetailAppService {
public JSONObject getRefunds(JSONObject device, AppQueryBean appQueryBean) { public JSONObject getRefunds(JSONObject device, AppQueryBean appQueryBean) {
JSONObject appParam = appQueryBean.toParams(); JSONObject appParam = appQueryBean.toParams();
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("client_id",device.getIntValue("client_id")); if(appParam.get("client_ids")==null) {
param.put("client_id", device.getIntValue("client_id"));
}
param.put("start_time",appParam.getDate("begin")); param.put("start_time",appParam.getDate("begin"));
param.put("end_time",appParam.getDate("end")); param.put("end_time",appParam.getDate("end"));
return refundService.listUnionAllApply(param, new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit())); return refundService.listUnionAllApply(param, new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit()));

@ -435,7 +435,7 @@ public class RefundServiceImpl implements RefundService, ApplicationEventPublish
@Override @Override
public JSONObject listUnionAllApply(JSONObject params, PageBounds pagination) { public JSONObject listUnionAllApply(JSONObject params, PageBounds pagination) {
if(params.get("cleint_id")==null && params.get("client_ids")==null){ if(params.get("client_id")==null && params.get("client_ids")==null){
return null; return null;
} }
return PageListUtils.buildPageListResult(refundMapper.listUnionAllApply(params, pagination)); return PageListUtils.buildPageListResult(refundMapper.listUnionAllApply(params, pagination));

@ -77,6 +77,7 @@
confirm_time confirm_time, confirm_time confirm_time,
operator_name operator_name, operator_name operator_name,
`status` `status` , `status` `status` ,
amount amount,
1 type 1 type
FROM FROM
pmt_refunds pmt_refunds
@ -85,10 +86,10 @@
and client_id = #{client_id} and client_id = #{client_id}
</if> </if>
<if test="start_time!=null"> <if test="start_time!=null">
and create_time &lt;= #{start_time} and create_time &gt;= #{start_time}
</if> </if>
<if test="start_time!=null"> <if test="start_time!=null">
and create_time &gt;= #{end_time} and create_time &lt;= #{end_time}
</if> </if>
<if test="client_ids!=null"> <if test="client_ids!=null">
client_id in client_id in
@ -99,27 +100,28 @@
</where> </where>
UNION ALL UNION ALL
SELECT SELECT
order_id order_id, ra.order_id order_id,
client_id client_id, ra.client_id client_id,
applytime create_time, ra.applytime create_time,
audittime confirm_time, ra.audittime confirm_time,
auditorname operator_name, ra.auditorname operator_name,
audit_result `status` , ra.audit_result `status` ,
r.amount amount,
2 type 2 type
FROM FROM
pmt_refund_applies pmt_refund_applies ra left join pmt_refunds r on ra.refund_id = r.refund_id
<where> <where>
<if test="client_id!=null"> <if test="client_id!=null">
and client_id = #{client_id} and ra.client_id = #{client_id}
</if> </if>
<if test="start_time!=null"> <if test="start_time!=null">
and applytime &lt;= #{start_time} and ra.applytime &gt;= #{start_time}
</if> </if>
<if test="start_time!=null"> <if test="start_time!=null">
and applytime &gt;= #{end_time} and ra.applytime &lt;= #{end_time}
</if> </if>
<if test="client_ids!=null"> <if test="client_ids!=null">
client_id in ra.client_id in
<foreach collection="client_ids" open="(" close=")" separator="," item="item"> <foreach collection="client_ids" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>

Loading…
Cancel
Save