优化SQL代码,增加查询速度

This commit is contained in:
yuyang 2021-12-27 15:45:06 +08:00
parent 1efa9aa95b
commit 180b3427ea
14 changed files with 100 additions and 96 deletions

View File

@ -304,13 +304,13 @@
LEFT JOIN xhpc_dict_biz xdb on xdb.`code` = 'operator_attribute' and xdb.dict_key = xo.attribute LEFT JOIN xhpc_dict_biz xdb on xdb.`code` = 'operator_attribute' and xdb.dict_key = xo.attribute
where xo.del_flag = 0 where xo.del_flag = 0
<if test="name != null and name != ''"> <if test="name != null and name != ''">
and xo.name like concat(concat('%', #{name}), '%') and xo.name like concat('%', #{name}, '%')
</if> </if>
<if test="contactName != null and contactName != ''"> <if test="contactName != null and contactName != ''">
and xo.contact_name like concat(concat('%', #{contactName}), '%') and xo.contact_name like concat('%', #{contactName}, '%')
</if> </if>
<if test="contactPhone != null and contactPhone != ''"> <if test="contactPhone != null and contactPhone != ''">
and xo.contact_phone like concat(concat('%', #{contactPhone}), '%') and xo.contact_phone like concat('%', #{contactPhone}, '%')
</if> </if>
<if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 --> <if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 -->
AND xo.create_time &gt;= #{createTimeStart} AND xo.create_time &gt;= #{createTimeStart}

View File

@ -670,6 +670,17 @@
left join et_dispute_orders as ed on ed.start_charge_seq = ho.internet_serial_number and ed.dispute_order_status !=2 left join et_dispute_orders as ed on ed.start_charge_seq = ho.internet_serial_number and ed.dispute_order_status !=2
left join xhpc_internet_user as inu on inu.internet_user_id = ho.user_id and ho.internet_serial_number is not null left join xhpc_internet_user as inu on inu.internet_user_id = ho.user_id and ho.internet_serial_number is not null
left join xhpc_app_user as apu on apu.app_user_id = ho.user_id and ho.internet_serial_number is null left join xhpc_app_user as apu on apu.app_user_id = ho.user_id and ho.internet_serial_number is null
<if test="number==1">
inner join (
select xiu.internet_user_id as user_id from xhpc_internet_user as xiu inner join(select user_id from xhpc_history_order where source=1) us1 on us1.user_id = xiu.internet_user_id where xiu.phone like concat('%', #{phone}, '%')
union
select xau.app_user_id as user_id from xhpc_app_user as xau inner join(select user_id from xhpc_history_order where source=0) us2 on us2.user_id = xau.app_user_id where xau.phone like concat('%', #{phone}, '%')
union
select xcp.community_personnel_id as user_id from xhpc_community_personnel as xcp inner join(select user_id from xhpc_history_order where source=2) us3.user_id = xcp.community_personnel_id where xcp.account like concat('%', #{phone}, '%')
union
select xcup.customers_personnel_id as user_id from xhpc_customers_personnel as xcup inner join(select user_id from xhpc_history_order where source=3) us4.user_id = xcup.customers_personnel_id where xcup.account like concat('%', #{phone}, '%')
) ut on ut.app_user_id = ho.user_id
</if>
where ho.status =0 and ho.del_flag=0 where ho.status =0 and ho.del_flag=0
<if test="type !=null"> <if test="type !=null">
and ho.type=#{type} and ho.type=#{type}
@ -716,17 +727,7 @@
<if test="operatorId !=null"> <if test="operatorId !=null">
and op.operator_id =#{operatorId} and op.operator_id =#{operatorId}
</if> </if>
<if test="number==1">
and ho.user_id in(
select internet_user_id as user_id from xhpc_internet_user where phone like concat('%', #{phone}, '%') and internet_user_id in (select user_id from xhpc_history_order where source=1)
union
select app_user_id as user_id from xhpc_app_user where phone like concat('%', #{phone}, '%') and app_user_id in (select user_id from xhpc_history_order where source=0)
union
select community_personnel_id as user_id from xhpc_community_personnel where account like concat('%', #{phone}, '%') and community_personnel_id in (select user_id from xhpc_history_order where source=2)
union
select customers_personnel_id as user_id from xhpc_customers_personnel where account like concat('%', #{phone}, '%') and customers_personnel_id in (select user_id from xhpc_history_order where source=3)
)
</if>
<if test="number==2"> <if test="number==2">
<if test="source ==0"> <if test="source ==0">
and ho.user_id in(select app_user_id from xhpc_app_user where app_user_id in (select user_id from xhpc_history_order where source=0)) and ho.user_id in(select app_user_id from xhpc_app_user where app_user_id in (select user_id from xhpc_history_order where source=0))

View File

@ -137,7 +137,7 @@
and xho.user_id = #{userId} and xho.user_id = #{userId}
</if> </if>
<if test="serialNumber != null and serialNumber != ''"> <if test="serialNumber != null and serialNumber != ''">
and xho.serial_number like concat(concat('%', #{serialNumber}), '%') and xho.serial_number like concat('%', #{serialNumber}, '%')
</if> </if>
<if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 --> <if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 -->
AND xco.create_time &gt;= #{createTimeStart} AND xco.create_time &gt;= #{createTimeStart}
@ -146,7 +146,7 @@
AND xco.create_time &lt;= #{createTimeEnd} AND xco.create_time &lt;= #{createTimeEnd}
</if> </if>
<if test="chargingStationName != null and chargingStationName != ''"> <if test="chargingStationName != null and chargingStationName != ''">
and xcs.`name`like concat(concat('%', #{chargingStationName}), '%') and xcs.`name`like concat('%', #{chargingStationName}, '%')
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
and xho.reconciliation_status = #{status} and xho.reconciliation_status = #{status}

View File

@ -165,7 +165,7 @@
and su.user_id = #{userId} and su.user_id = #{userId}
</if> </if>
<if test="serialNumber != null and serialNumber != ''"> <if test="serialNumber != null and serialNumber != ''">
and xho.serial_number like concat(concat('%', #{serialNumber}), '%') and xho.serial_number like concat('%', #{serialNumber}, '%')
</if> </if>
<if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 --> <if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 -->
AND xco.create_time &gt;= #{createTimeStart} AND xco.create_time &gt;= #{createTimeStart}
@ -174,7 +174,7 @@
AND xco.create_time &lt;= #{createTimeEnd} AND xco.create_time &lt;= #{createTimeEnd}
</if> </if>
<if test="chargingStationName != null and chargingStationName != ''"> <if test="chargingStationName != null and chargingStationName != ''">
and xcs.`name`like concat(concat('%', #{chargingStationName}), '%') and xcs.`name`like concat('%', #{chargingStationName}, '%')
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
and xho.sorting_status = #{status} and xho.sorting_status = #{status}

View File

@ -410,17 +410,16 @@
left join xhpc_internet_user as inu on inu.internet_user_id = co.user_id and co.source =1 left join xhpc_internet_user as inu on inu.internet_user_id = co.user_id and co.source =1
left join xhpc_app_user as apu on apu.app_user_id = co.user_id and co.source =0 left join xhpc_app_user as apu on apu.app_user_id = co.user_id and co.source =0
LEFT JOIN ( LEFT JOIN (
SELECT SELECT charging_order_id,real_time_order_id,soc,charging_degree,charging_time FROM xhpc_real_time_order
charging_order_id, WHERE real_time_order_id IN ( SELECT max( real_time_order_id ) FROM xhpc_real_time_order GROUP BY charging_order_id )
real_time_order_id,
soc,
charging_degree,
charging_time
FROM
xhpc_real_time_order
WHERE
real_time_order_id IN ( SELECT max( real_time_order_id ) FROM xhpc_real_time_order GROUP BY charging_order_id )
) ro ON ro.charging_order_id = co.charge_order_id ) ro ON ro.charging_order_id = co.charge_order_id
<if test="number==1">
inner join (
SELECT cro.user_id user_id FROM xhpc_charge_order cro inner join(SELECT app_user_id FROM xhpc_app_user where phone like concat('%', #{phone}, '%')) us1 on us1.app_user_id = cro.user_id where xco.source = 0
union
SELECT cro.user_id user_id FROM xhpc_charge_order xco inner join(SELECT internet_user_id from xhpc_internet_user where phone like concat('%', #{phone}, '%')) us2 on us2.internet_user_id = xco.user_id where xco.source = 1
) ut on ut.app_user_id = xro.user_id
</if>
where co.status=#{status} and co.del_flag=0 where co.status=#{status} and co.del_flag=0
<if test="internetId !=null"> <if test="internetId !=null">
and co.source =1 and co.source =1
@ -454,14 +453,6 @@
<if test="operatorId !=null"> <if test="operatorId !=null">
and op.operator_id =#{operatorId} and op.operator_id =#{operatorId}
</if> </if>
<if test="number==1">
and co.user_id in (
SELECT cro.user_id
FROM xhpc_charge_order cro WHERE cro.source = 0 AND cro.user_id IN ( SELECT app_user_id FROM xhpc_app_user where phone like concat('%', #{phone}, '%'))
union
SELECT cro.user_id FROM xhpc_charge_order cro WHERE cro.source = 1 AND cro.user_id IN (SELECT internet_user_id from xhpc_internet_user where phone like concat('%', #{phone}, '%'))
)
</if>
<if test="number==2"> <if test="number==2">
<if test="source !=null and source ==0"> <if test="source !=null and source ==0">
and co.user_id in ( and co.user_id in (

View File

@ -372,6 +372,8 @@ public class XhpcRefundAuditController extends BaseController {
" <partner_trade_no>" + partner_trade_no + "</partner_trade_no>\n" + " <partner_trade_no>" + partner_trade_no + "</partner_trade_no>\n" +
" <sign>" + sign + "</sign>\n" + " <sign>" + sign + "</sign>\n" +
"</xml> "; "</xml> ";
logger.info("++++++++++++xmlString++++++++++++++++"+xmlString);
return xmlString; return xmlString;
} }
@ -392,7 +394,7 @@ public class XhpcRefundAuditController extends BaseController {
refundOrder.setStatus(2); refundOrder.setStatus(2);
refundOrder.setRemark(map.get("err_code_des").toString()); refundOrder.setRemark(map.get("err_code_des").toString());
updateXhpcRefundOrder(refundOrder,amountRefundOrder,userId,phone,2); updateXhpcRefundOrder(refundOrder,amountRefundOrder,userId,phone,2);
logger.info("++++++++++++审核失败原因++++++++++++++++"+map.get("err_code_des").toString()); logger.info("++++++++++++审核失败原因++++++++++++++++"+map.get("err_code_des").toString()+"错误代码:"+map.get("err_code").toString());
return AjaxResult.error(map.get("err_code_des")); return AjaxResult.error(map.get("err_code_des"));
} else { } else {
//退款成功修改订单 //退款成功修改订单
@ -595,6 +597,7 @@ public class XhpcRefundAuditController extends BaseController {
if(type ==1){ if(type ==1){
xhpcUserAccountStatementService.add(refundOrder.getRefundOrderId(), amount, userId, StatusConstants.FLOWING_WATER_REFUND); xhpcUserAccountStatementService.add(refundOrder.getRefundOrderId(), amount, userId, StatusConstants.FLOWING_WATER_REFUND);
}else{ }else{
xhpcUserAccountStatementService.add(refundOrder.getRefundOrderId(), amount, userId, StatusConstants.FLOWING_WATER_REFUND_ERROE); xhpcUserAccountStatementService.add(refundOrder.getRefundOrderId(), amount, userId, StatusConstants.FLOWING_WATER_REFUND_ERROE);
try{ try{
//发送短信 //发送短信
@ -635,4 +638,17 @@ public class XhpcRefundAuditController extends BaseController {
} }
} }
@GetMapping("/text")
public void text(){
try{
//发送短信
HashMap<String, String> paramMap = new HashMap<>();
paramMap.put("phone", "18123374652");
paramMap.put("content", "【小华充电】退款-尊敬的用户,当前退款人数较多,申请退款失败,请您重新提交申请!");
smsService.sendNotice(paramMap);
}catch (Exception e){
System.out.println("发送失败");
}
}
} }

View File

@ -159,36 +159,37 @@
LEFT JOIN xhpc_community_personnel cop on cop.community_personnel_id = xro.user_id and xro.source =2 LEFT JOIN xhpc_community_personnel cop on cop.community_personnel_id = xro.user_id and xro.source =2
LEFT JOIN xhpc_customers_personnel cup on cup.customers_personnel_id = xro.user_id and xro.source =3 LEFT JOIN xhpc_customers_personnel cup on cup.customers_personnel_id = xro.user_id and xro.source =3
LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = 'recharge_order_status' and sdd.dict_value = xro.`status` LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = 'recharge_order_status' and sdd.dict_value = xro.`status`
<if test="source == null and phone != null and phone != ''">
inner join (
select xau.app_user_id from xhpc_app_user as xau inner join (select user_id from xhpc_recharge_order where source=0) us1 on us1.user_id=xau.app_user_id where xau.phone like concat('%', #{phone}, '%')
union
select xcop.community_personnel_id as app_user_id from xhpc_community_personnel as xcop inner join (select user_id from xhpc_recharge_order where source=2) us2 on us2.user_id=xcop.community_personnel_id where xcop.phone like concat('%', #{phone}, '%')
union
select xcup.customers_personnel_id as app_user_id from xhpc_customers_personnel as xcup inner join (select user_id from xhpc_recharge_order where source=3) us3 on us3.user_id = xcup.customers_personnel_id where xcup.phone like concat('%', #{phone}, '%')
) ut on ut.app_user_id = xro.user_id
</if>
where xro.del_flag = 0 where xro.del_flag = 0
<if test="source != null and phone != null"> <if test="source != null and phone != null and phone != ''">
<if test="source==0 "> <if test="source==0 ">
and xro.source=#{source} and xau.phone like concat(concat('%', #{phone}), '%') and xro.source=#{source} and xau.phone like concat('%', #{phone}, '%')
</if> </if>
<if test="source=2"> <if test="source=2">
and xro.source=#{source} and cop.account like concat(concat('%', #{phone}), '%') and xro.source=#{source} and cop.account like concat('%', #{phone}, '%')
</if> </if>
<if test="source=3"> <if test="source=3">
and xro.source=#{source} and cup.account like concat(concat('%', #{phone}), '%') and xro.source=#{source} and cup.account like concat('%', #{phone}, '%')
</if> </if>
</if> </if>
<if test="source != null and phone == null"> <if test="source != null">
and xro.source=#{source} and xro.source=#{source}
</if> </if>
<if test="source == null and phone != null">
and xau.app_user_id in (
select app_user_id from xhpc_app_user where phone like concat(concat('%', #{phone}), '%') and app_user_id in (select user_id from xhpc_recharge_order where source=0)
union
select community_personnel_id as app_user_id from xhpc_community_personnel where account like concat(concat('%', #{phone}), '%') and community_personnel_id in (select user_id from xhpc_recharge_order where source=2)
union
select customers_personnel_id from xhpc_customers_personnel where account like concat(concat('%', #{phone}), '%') and community_personnel_id in (select user_id from xhpc_recharge_order where source=3)
)
</if>
<if test="rechargeOrderNumber != null and rechargeOrderNumber != ''"> <if test="rechargeOrderNumber != null and rechargeOrderNumber != ''">
and xro.recharge_order_number like concat(concat('%', #{rechargeOrderNumber}), '%') and xro.recharge_order_number like concat('%', #{rechargeOrderNumber}, '%')
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
and xro.status like concat(concat('%', #{status}), '%') and xro.status like concat('%', #{status}, '%')
</if> </if>
<if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 --> <if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 -->
AND xro.create_time &gt;= #{createTimeStart} AND xro.create_time &gt;= #{createTimeStart}
@ -212,13 +213,13 @@
LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = 'recharge_order_status' and sdd.dict_value = xro.`status` LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = 'recharge_order_status' and sdd.dict_value = xro.`status`
where xro.del_flag = 0 where xro.del_flag = 0
<if test="phone != null and phone != ''"> <if test="phone != null and phone != ''">
and xau.phone like concat(concat('%', #{phone}), '%') and xau.phone like concat('%', #{phone}, '%')
</if> </if>
<if test="rechargeOrderNumber != null and rechargeOrderNumber != ''"> <if test="rechargeOrderNumber != null and rechargeOrderNumber != ''">
and xro.recharge_order_number like concat(concat('%', #{rechargeOrderNumber}), '%') and xro.recharge_order_number like concat('%', #{rechargeOrderNumber}, '%')
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
and xro.status like concat(concat('%', #{status}), '%') and xro.status like concat('%', #{status}, '%')
</if> </if>
<if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 --> <if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 -->
AND xro.create_time &gt;= #{createTimeStart} AND xro.create_time &gt;= #{createTimeStart}

View File

@ -194,40 +194,35 @@
LEFT JOIN xhpc_customers_personnel cup on cup.customers_personnel_id = xro.user_id and xro.source =3 LEFT JOIN xhpc_customers_personnel cup on cup.customers_personnel_id = xro.user_id and xro.source =3
LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = 'refund_order_status' and sdd.dict_value = xro.`status` LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = 'refund_order_status' and sdd.dict_value = xro.`status`
LEFT JOIN sys_dict_data sdds on sdds.`dict_type` = 'refund_examine_status' and sdds.dict_value =xro.examine_status LEFT JOIN sys_dict_data sdds on sdds.`dict_type` = 'refund_examine_status' and sdds.dict_value =xro.examine_status
<if test="source == null and phone != null and phone !=''">
inner join (
select xau.app_user_id from xhpc_app_user as xau inner join(select user_id from xhpc_recharge_order where source=0) us1 on us1.user_id = xau.app_user_id where xau.phone like concat('%', #{phone}, '%')
union
select xcop.community_personnel_id as app_user_id from xhpc_community_personnel as xcop inner join (select user_id from xhpc_recharge_order where source=2) us2 on us2.user_id=xcop.community_personnel_id where xcop.phone like concat('%', #{phone}, '%')
union
select xcup.customers_personnel_id as app_user_id from xhpc_customers_personnel as xcup inner join (select user_id from xhpc_recharge_order where source=3) us3 on us3.user_id = xcup.customers_personnel_id where xcup.phone like concat('%', #{phone}, '%')
) ut on ut.app_user_id = xro.app_user_id
</if>
where xro.del_flag = 0 where xro.del_flag = 0
<if test="source != null and phone != null"> <if test="source != null and phone != null">
<if test="source==0 "> <if test="source==0 ">
and xro.source=#{source} and xau.phone like concat(concat('%', #{phone}), '%') and xro.source=#{source} and xau.phone like concat('%', #{phone}, '%')
</if> </if>
<if test="source=2"> <if test="source=2">
and xro.source=#{source} and cop.account like concat(concat('%', #{phone}), '%') and xro.source=#{source} and cop.account like concat('%', #{phone}, '%')
</if> </if>
<if test="source=3"> <if test="source=3">
and xro.source=#{source} and cup.account like concat(concat('%', #{phone}), '%') and xro.source=#{source} and cup.account like concat('%', #{phone}, '%')
</if> </if>
</if> </if>
<if test="source != null and phone == null"> <if test="source != null">
and xro.source=#{source} and xro.source=#{source}
</if> </if>
<if test="source == null and phone != null">
and xau.app_user_id in (
select app_user_id from xhpc_app_user where phone like concat(concat('%', #{phone}), '%') and app_user_id in
(select user_id from xhpc_recharge_order where source=0)
union
select community_personnel_id as app_user_id from xhpc_community_personnel where account like
concat(concat('%', #{phone}), '%') and community_personnel_id in (select user_id from xhpc_recharge_order
where source=2)
union
select customers_personnel_id as app_user_id from xhpc_customers_personnel where account like
concat(concat('%', #{phone}), '%') and community_personnel_id in (select user_id from xhpc_recharge_order
where source=3)
)
</if>
<if test="refundOrderNumber != null and refundOrderNumber != ''"> <if test="refundOrderNumber != null and refundOrderNumber != ''">
and xro.refund_order_number like concat(concat('%', #{refundOrderNumber}), '%') and xro.refund_order_number like concat('%', #{refundOrderNumber}, '%')
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
and xro.status like concat(concat('%', #{status}), '%') and xro.status like concat('%', #{status}, '%')
</if> </if>
<if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 --> <if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 -->
AND xro.create_time &gt;= #{createTimeStart} AND xro.create_time &gt;= #{createTimeStart}
@ -250,13 +245,13 @@
xro.examine_status xro.examine_status
where xro.del_flag = 0 where xro.del_flag = 0
<if test="phone != null and phone != ''"> <if test="phone != null and phone != ''">
and xau.phone like concat(concat('%', #{phone}), '%') and xau.phone like concat('%', #{phone}, '%')
</if> </if>
<if test="refundOrderNumber != null and refundOrderNumber != ''"> <if test="refundOrderNumber != null and refundOrderNumber != ''">
and xro.refund_order_number like concat(concat('%', #{refundOrderNumber}), '%') and xro.refund_order_number like concat('%', #{refundOrderNumber}, '%')
</if> </if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
and xro.status like concat(concat('%', #{status}), '%') and xro.status like concat('%', #{status}, '%')
</if> </if>
<if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 --> <if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 -->
AND xro.create_time &gt;= #{createTimeStart} AND xro.create_time &gt;= #{createTimeStart}

View File

@ -192,7 +192,7 @@
xau.app_user_id xau.app_user_id
WHERE xau.del_flag = 0 WHERE xau.del_flag = 0
<if test="phone != null and phone != ''"> <if test="phone != null and phone != ''">
and xau.phone like concat(concat('%', #{phone}), '%') and xau.phone like concat('%', #{phone}, '%')
</if> </if>
ORDER BY xau.create_time DESC ORDER BY xau.create_time DESC
</select> </select>
@ -203,7 +203,7 @@
(select count(DISTINCT user_id) from xhpc_charge_order where create_time &gt;= #{time}) userVitality (select count(DISTINCT user_id) from xhpc_charge_order where create_time &gt;= #{time}) userVitality
from xhpc_app_user xau from xhpc_app_user xau
<if test="phone != null and phone != ''"> <if test="phone != null and phone != ''">
and xau.phone like concat(concat('%', #{phone}), '%') and xau.phone like concat('%', #{phone}, '%')
</if> </if>
ORDER BY xau.create_time DESC ORDER BY xau.create_time DESC
</select> </select>

View File

@ -210,10 +210,10 @@
xhpc_community_personnel xhpc_community_personnel
where community_id=#{communityId} and del_flag=0 where community_id=#{communityId} and del_flag=0
<if test="account !=null and account !=''"> <if test="account !=null and account !=''">
and account like concat(concat('%', #{account}), '%') and account like concat('%', #{account), '%')
</if> </if>
<if test="phone !=null and phone !=''"> <if test="phone !=null and phone !=''">
and phone like concat(concat('%', #{phone}), '%') and phone like concat('%', #{phone}, '%')
</if> </if>
<if test="status !=null"> <if test="status !=null">
and status=#{status} and status=#{status}

View File

@ -204,10 +204,10 @@
xhpc_customers_personnel xhpc_customers_personnel
where customers_id=#{customersId} and del_flag=0 where customers_id=#{customersId} and del_flag=0
<if test="account !=null and account !=''"> <if test="account !=null and account !=''">
and account like concat(concat('%', #{account}), '%') and account like concat('%', #{account}, '%')
</if> </if>
<if test="phone !=null and phone !=''"> <if test="phone !=null and phone !=''">
and phone like concat(concat('%', #{phone}), '%') and phone like concat('%', #{phone}, '%')
</if> </if>
<if test="status !=null"> <if test="status !=null">
and status=#{status} and status=#{status}

View File

@ -260,13 +260,13 @@
LEFT JOIN sys_user su on su.internet_user_id = xiu.internet_user_id LEFT JOIN sys_user su on su.internet_user_id = xiu.internet_user_id
WHERE xiu.del_flag = 0 WHERE xiu.del_flag = 0
<if test="name != null and name != ''"> <if test="name != null and name != ''">
and xiu.name like concat(concat('%', #{name}), '%') and xiu.name like concat('%', #{name}, '%')
</if> </if>
<if test="contactName != null and contactName != ''"> <if test="contactName != null and contactName != ''">
and xiu.contact_name like concat(concat('%', #{contactName}), '%') and xiu.contact_name like concat('%', #{contactName}, '%')
</if> </if>
<if test="contactPhone != null and contactPhone != ''"> <if test="contactPhone != null and contactPhone != ''">
and xiu.contact_phone like concat(concat('%', #{contactPhone}), '%') and xiu.contact_phone like concat('%', #{contactPhone}, '%')
</if> </if>
<if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 --> <if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 -->
AND xiu.create_time &gt;= #{createTimeStart} AND xiu.create_time &gt;= #{createTimeStart}
@ -318,7 +318,7 @@
LEFT JOIN sys_user su on su.internet_user_id = xiu.internet_user_id LEFT JOIN sys_user su on su.internet_user_id = xiu.internet_user_id
WHERE xiu.del_flag = 0 WHERE xiu.del_flag = 0
<if test="name != null and name != ''"> <if test="name != null and name != ''">
and xiu.name like concat(concat('%', #{name}), '%') and xiu.name like concat('%', #{name}, '%')
</if> </if>
ORDER BY xiu.update_time DESC ORDER BY xiu.update_time DESC
</select> </select>

View File

@ -299,13 +299,13 @@
LEFT JOIN xhpc_dict_biz xdb on xdb.`code` = 'operator_attribute' and xdb.dict_key = xo.attribute LEFT JOIN xhpc_dict_biz xdb on xdb.`code` = 'operator_attribute' and xdb.dict_key = xo.attribute
where xo.del_flag = 0 where xo.del_flag = 0
<if test="name != null and name != ''"> <if test="name != null and name != ''">
and xo.name like concat(concat('%', #{name}), '%') and xo.name like concat('%', #{name}, '%')
</if> </if>
<if test="contactName != null and contactName != ''"> <if test="contactName != null and contactName != ''">
and xo.contact_name like concat(concat('%', #{contactName}), '%') and xo.contact_name like concat('%', #{contactName}, '%')
</if> </if>
<if test="contactPhone != null and contactPhone != ''"> <if test="contactPhone != null and contactPhone != ''">
and xo.contact_phone like concat(concat('%', #{contactPhone}), '%') and xo.contact_phone like concat('%', #{contactPhone}, '%')
</if> </if>
<if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 --> <if test="createTimeStart != null and createTimeStart != ''"><!-- 开始时间检索 -->
AND xo.create_time &gt;= #{createTimeStart} AND xo.create_time &gt;= #{createTimeStart}

View File

@ -78,10 +78,10 @@
from sys_user from sys_user
WHERE del_flag = 0 and user_type = '00' WHERE del_flag = 0 and user_type = '00'
<if test="userName != null and userName != ''"> <if test="userName != null and userName != ''">
and user_name like concat(concat('%', #{userName}), '%') and user_name like concat('%', #{userName}, '%')
</if> </if>
<if test="nickName != null and nickName != ''"> <if test="nickName != null and nickName != ''">
and nick_name like concat(concat('%', #{nickName}), '%') and nick_name like concat('%', #{nickName}, '%')
</if> </if>
ORDER BY update_time DESC ORDER BY update_time DESC
</select> </select>
@ -107,10 +107,10 @@
LEFT JOIN xhpc_operator xo on xo.operator_id = su.operator_id LEFT JOIN xhpc_operator xo on xo.operator_id = su.operator_id
WHERE su.del_flag = 0 and user_type = '03' WHERE su.del_flag = 0 and user_type = '03'
<if test="userName != null and userName != ''"> <if test="userName != null and userName != ''">
and su.user_name like concat(concat('%', #{userName}), '%') and su.user_name like concat('%', #{userName}, '%')
</if> </if>
<if test="nickName != null and nickName != ''"> <if test="nickName != null and nickName != ''">
and su.nick_name like concat(concat('%', #{nickName}), '%') and su.nick_name like concat('%', #{nickName}, '%')
</if> </if>
<if test="operatorId != null and operatorId != ''"> <if test="operatorId != null and operatorId != ''">
and su.operator_id = #{operatorId} and su.operator_id = #{operatorId}