select
@pageTag(){
t.*
@}
from xzx_city_partner t
where 1=1
@//数据权限,该sql语句功能点,如果不考虑数据权限,可以删除此行
and #function("xzxCityPartner.query")#
批量逻辑删除
update xzx_city_partner set del_flag = 1 where id in( #join(ids)#)
insert xzx_partner_gaode (partner_id,partner_key,
town_id,create_time,del_flag,city_id,address_area) values
@for(info in gaodeModels){
(#info.partnerId#,#info.partnerKey#,#info.townId#,#info.createTime#,#info.delFlag#,#info.cityId#,#info.addressArea#)
@if(!isEmpty(info.townId)){
#text(infoLP.last?"":"," )#
@}
@}
update xzx_partner_gaode set del_flag=1 where partner_id=#partnerId#
select * from xzx_city_partner where id=#id# and del_flag=0
select a.* from xzx_city_partner a
left join (select c.partner_id,b.order_id from xzx_order_info b
left join xzx_user_other_info c on b.receiver=c.user_id ) m
on a.id=m.partner_id
where a.del_flag=0 and m.order_id=#orderId#
select * from xzx_city_partner where user_id like #"%"+userId+"%"# and del_flag=0
select * from xzx_partner_gaode where partner_id=#partnerId# and del_flag=0
select city_id from xzx_partner_gaode where del_flag=0 and partner_id=#partnerId# and partner_id<>partner_key group by city_id
select b.level_1_name as provinceName,b.level_2_name as cityName,b.level_3_name as townName
from xzx_partner_gaode a
LEFT JOIN xzx_sys_address_level_info b on a.town_id = b.level_3_id
where 1=1 and partner_id<>partner_key and del_flag=0
@if(!isEmpty(partnerId)){
and a.partner_id= #partnerId#
@}
select a.id,a.partner_name,a.mobile_phone,a.account_no,IFNULL(sum(b.money),0) as czMoney,
IFNULL(sum(c.money),0) as txMoney,a.effective_statr_time,a.effective_end_time,a.create_time,a.prohibit ,a.packing_station,
a.partner_type,a.password,a.id_card as idCard,a.attachment_id,a.attachment_id1,a.email,a.user_id,a.partner_key as partnerKeys
from xzx_city_partner a
LEFT JOIN xzx_pay_info b ON a.user_id = b.create_user_id
LEFT JOIN xzx_pay_request_info c ON a.user_id=c.create_user_id
LEFT JOIN xzx_account_info d ON a.user_id = d.user_id
WHERE a.del_flag=0
@if(!isEmpty(prohibit)){
and a.prohibit = #prohibit#
@}
@if(!isEmpty(startTime)){
and a.create_time >= #startTime#
@}
@if(!isEmpty(endTime)){
and a.create_time <= #endTime#
@}
@if(!isEmpty(name)){
and (a.partner_name like #"%"+name+"%"# or a.mobile_phone like #"%"+name+"%"# or a.packing_station like #"%"+name+"%"# )
@}
@if(!isEmpty(partnerType)){
and a.partner_type = #partnerType#
@}
@if(!isEmpty(partnerIdList)){
and (a.id in ( #join(partnerIdList)# ) or a.packing_station =#packingStation#)
@}
GROUP BY a.id order by a.create_time desc
limit #page#, #limit#
queryCityPartnerCount
===
select count(k.id) from (
select a.id as id
from xzx_city_partner a
WHERE a.del_flag=0
@if(!isEmpty(prohibit)){
and a.prohibit = #prohibit#
@}
@if(!isEmpty(startTime)){
and a.create_time >= #startTime#
@}
@if(!isEmpty(endTime)){
and a.create_time <= #endTime#
@}
@if(!isEmpty(name)){
and (a.partner_name like #"%"+name+"%"# or a.mobile_phone like #"%"+name+"%"# or a.packing_station like #"%"+name+"%"# )
@}
@if(!isEmpty(partnerType)){
and a.partner_type = #partnerType#
@}
@if(!isEmpty(partnerIdList)){
and (a.id in ( #join(partnerIdList)# ) or a.packing_station =#packingStation#)
@}
GROUP BY a.id
)k
select b.fence_name,b.id from xzx_partner_fence a
left join xzx_electronic_fence b on a.fence_id = b.id
where a.partner_id=#id# and b.del_flag=0 and a.del_flag=0
select IFNULL(hbb,0) from xzx_partner_account where user_id=#userId# limit 1
select a.* from xzx_city_partner a
left join xzx_user_other_info b on a.id=b.partner_id
where b.user_id=#receiver#
group by a.id
select x.flowNo,x.payName,x.payTime,x.money,x.partnerName,x.payStatus,x.mobilePhone,x.partnerType from (
select a.pay_order_id as flowNo,'充值' as payName,a.create_time as payTime,a.money as money,b.partner_name as partnerName,
a.status as payStatus,b.mobile_phone as mobilePhone,b.partner_type as partnerType
from xzx_pay_info a
LEFT JOIN xzx_city_partner b ON a.create_user_id = b.user_id
where 1=1 and b.user_id is not null
@if(!isEmpty(userId)){
and a.create_user_id =#userId#
@}
@if(!isEmpty(payType)){
and a.pay_type = #payType#
@}
@if(!isEmpty(payStatus)){
and a.status = #payStatus#
@}
@if(!isEmpty(startTime)){
and a.create_time >= #startTime#
@}
@if(!isEmpty(endTime)){
and a.create_time <= #endTime#
@}
@if(!isEmpty(name)){
and (b.mobile_phone like #"%"+name+"%"# or b.partner_name like #"%"+name+"%"#)
@}
@if(!isEmpty(partnerIds)){
and b.id in ( #join(partnerIds)#)
@}
UNION ALL
select c.pay_order_id as flowNo,'提现' as payName,c.create_time as payTime,c.money as money,d.partner_name as partnerName,
c.status as payStatus,d.mobile_phone as mobilePhone,d.partner_type as partnerType
from xzx_pay_request_info c
LEFT JOIN xzx_city_partner d ON c.create_user_id=d.user_id
where 1=1 and d.user_id is not null
@if(!isEmpty(userId)){
and c.create_user_id =#userId#
@}
@if(!isEmpty(payType)){
and c.pay_type = #payType#
@}
@if(!isEmpty(payStatus)){
and c.status = #payStatus#
@}
@if(!isEmpty(startTime)){
and c.create_time >= #startTime#
@}
@if(!isEmpty(endTime)){
and c.create_time <= #endTime#
@}
@if(!isEmpty(name)){
and (d.mobile_phone like #"%"+name+"%"# or d.partner_name like #"%"+name+"%"#)
@}
@if(!isEmpty(partnerIds)){
and d.id in ( #join(partnerIds)#)
@}
) x order by x.payTime desc
LIMIT #page#, #limit#
queryDetailsPresentationCount
===
select count(k.flowNo) from (
select a.pay_order_id as flowNo
from xzx_pay_info a
LEFT JOIN xzx_city_partner b ON a.create_user_id = b.user_id
where 1=1
@if(!isEmpty(userId)){
and a.create_user_id =#userId#
@}
@if(!isEmpty(payType)){
and a.pay_type = #payType#
@}
@if(!isEmpty(payStatus)){
and a.status = #payStatus#
@}
@if(!isEmpty(startTime)){
and a.create_time >= #startTime#
@}
@if(!isEmpty(endTime)){
and a.create_time <= #endTime#
@}
@if(!isEmpty(name)){
and (b.mobile_phone like #"%"+name+"%"# or b.partner_name like #"%"+name+"%"#)
@}
@if(!isEmpty(partnerIds)){
and b.id in ( #join(partnerIds)#)
@}
UNION ALL
select c.pay_order_id as flowNo
from xzx_pay_request_info c
LEFT JOIN xzx_city_partner d ON c.create_user_id=d.user_id
where 1=1
@if(!isEmpty(userId)){
and c.create_user_id =#userId#
@}
@if(!isEmpty(payType)){
and c.pay_type = #payType#
@}
@if(!isEmpty(payStatus)){
and c.status = #payStatus#
@}
@if(!isEmpty(startTime)){
and c.create_time >= #startTime#
@}
@if(!isEmpty(endTime)){
and c.create_time <= #endTime#
@}
@if(!isEmpty(name)){
and (d.mobile_phone like #"%"+name+"%"# or d.partner_name like #"%"+name+"%"#)
@}
@if(!isEmpty(partnerIds)){
and d.id in ( #join(partnerIds)#)
@}
)k
select * from xzx_longi_lati where 1=1 and name=#name# limit 1
select level_3_id from xzx_sys_address_level_info where 1=1 and level_2_name=#city#
select level_2_id from xzx_sys_address_level_info where 1=1 and level_2_name=#city# limit 1
select level_1_id from xzx_sys_address_level_info where 1=1 and level_1_name=#city# limit 1
select level_3_id from xzx_sys_address_level_info where 1=1 and level_3_name=#city# limit 1
select partner_id from xzx_partner_gaode where town_id = #townId# and del_flag=0 and partner_id<>partner_key limit 1
select partner_id from xzx_partner_gaode where del_flag=0 and partner_id<>partner_key and city_id=#city# limit 1
INSERT INTO `xzx_pay_info` (`pay_order_id`, `order_id`, `create_user_id`, `money`,
`account_id`, `pay_type`, `open_id`, `status`, `create_time`, `check_num`, `pay_img`, `pay_time`)
VALUES (#payOrderId#, NULL, #createUserId#, #money#, #accountId#,
#payType#, NULL, #status#, SYSDATE(), NULL, #payImg#, #payTime#)
update xzx_account_info set money=#money# where user_id=#userId#
update xzx_partner_account set
hbb=#hbb#
@if(!isEmpty(overdraftLimit)){
, overdraft_limit=#overdraftLimit#
@}
where user_id=#userId#
update xzx_partner_account set overdraft_limit=#overdraftLimit#,fixed_limit=#fixedLimit# where user_id=#userId#
INSERT INTO `xzx_pay_info` (`pay_order_id`, `order_id`, `create_user_id`, `money`,
`account_id`, `pay_type`, `open_id`, `status`, `create_time`, `check_num`, `pay_img`, `pay_time`)
VALUES (#payOrderId#, NULL, #createUserId#, #money#, #accountId#,
'1', NULL, #status#, SYSDATE(), NULL, #payImg#, #payTime#)
INSERT INTO `xzx_partner_account_log` (`account_id`, `flow_no`, `type`, `create_time`,
`money`, `account_money`, `hbb`, `user_name`, `user_phone`, `role_name`, `approver_status`, `del_flag`)
VALUES (#accountId#, #flowNo#, #type#, #createTime#, #money#,
#accountMoney#, #hbb#, #userName#, #userPhone#, #roleName#, #approverStatus#, #delFlag#)
INSERT INTO `xzx_remittance_user`
(`recharge_name`, `recharge_phone`, `company`, `company_account`, `bank_name`, `create_time`, `update_time`,`create_user_id`,`pay_order_id`)
VALUES (#rechargeName#, #rechargePhone#, #company#,
#companyAccount#, #bankName#, #createTime#, NULL,#createUserId#,#payOrderId#)
select * from xzx_pay_info where pay_order_id=#payOrderId#
update xzx_pay_info set
status=#status#
@if(!isEmpty(unpassReason)){
, unpass_reason=#unpassReason#
@}
where pay_order_id=#payOrderId#
select a.* from xzx_electronic_fence a
where a.del_flag=0 and
a.id not in (select b.fence_id from xzx_partner_fence b
where b.fence_id=a.id and b.del_flag=0
@if(!isEmpty(id)){
and b.partner_id<>#id#
@}
)
group by a.id order by a.create_time desc
select a.* from xzx_electronic_fence a
left join xzx_partner_fence b on a.id=b.fence_id
where a.del_flag=0 and b.del_flag=0
@if(!isEmpty(partnerIds)){
and b.partner_id=#partnerIds#
@}
group by a.id order by a.create_time desc
select a.* from xzx_electronic_fence a
where a.del_flag=0
group by a.id order by a.create_time desc
select * from xzx_city_partner where del_flag=0
@if(!isEmpty(mobilePhone)){
and mobile_phone=#mobilePhone#
@}
@if(!isEmpty(partnerType)){
and partner_type=#partnerType#
@}
@if(!isEmpty(partnerName)){
and partner_name=#partnerName#
@}
@if(!isEmpty(partnerIdList)){
and id in ( #join(partnerIdList)# )
@}
select city_id from xzx_partner_gaode where del_flag=0 and partner_id=#pid# group by city_id
select level_2_name from xzx_sys_address_level_info where level_2_id=#cityId# group by level_2_name
select count(id) from xzx_partner_fence where
partner_id=#partnerId#
and del_flag=0
select * from core_user where id=#id#
select * from xzx_city_partner
where del_flag=0
@if(!isEmpty(partnerId)){
and (id=#partnerId# or packing_station=#partnerId#)
@}
insert into xzx_partner_trace (partner_id, partner_key, partner_service_id, partner_service_type, create_time, del_flag)
values (
#partnerId#, #partnerKey#, #partnerServiceId#, #partnerServiceType#, #createTime#, #delFlag#
)
select partner_service_id from xzx_partner_trace where partner_id=#partnerId# and del_flag=0
update xzx_partner_trace set del_flag=1 where partner_id=#partnerId# and del_flag=0
select partner_service_id from xzx_partner_trace where del_flag=0 and partner_service_type=#serviceType# and partner_id=#partnerId# limit 1
select town_id from xzx_partner_gaode where del_flag=0 and partner_id=#partnerId#
select town_id from xzx_partner_gaode where del_flag=0 and partner_id in ( #join(partnerIdList)#)
select a.* from xzx_user_other_info a
left join xzx_order_info b on b.receiver=a.user_id
where a.del_flag=0
@if(!isEmpty(partnerId)){
and a.partner_id in ( #join(partnerId)#)
@}
@if(!isEmpty(userType)){
and a.user_type=#userType#
@}
@if(!isEmpty(userId)){
and a.user_id=#userId#
@}
@if(!isEmpty(orderId)){
and b.order_id=#orderId#
@}
@if(!isEmpty(userName)){
and (a.name like #"%"+userId+"%"# or a.mobile_phone like #"%"+userId+"%"#)
@}
select partner_service_id from xzx_partner_trace where del_flag=0 and partner_id=#partnerId#
@if(!isEmpty(type)){
and partner_service_type=#type#
@}
select trace_id from xzx_order_info where order_id =#orderId#
@if(!isEmpty(receiver)){
and a.receiver=#userId#
@}
@if(!isEmpty(startTime)){
and b.receive_time>=#startTime#
@}
@if(!isEmpty(endTime)){
and b.receive_time<=#endTime#
@}
queryOrderByIds
===
select a.trace_id from xzx_order_info a
left join xzx_order_detail_info b on a.order_id=b.order_id
where a.del_flag=0
@if(!isEmpty(receiver)){
and a.receiver=#userId#
@}
@if(!isEmpty(startTime)){
and b.receive_time>=#startTime#
@}
@if(!isEmpty(endTime)){
and b.receive_time<=#endTime#
@}
update xzx_partner_account set del_flag= #delFlag# where user_id=#userId# and del_flag=0
update xzx_account_info set del_flag=#delFlag# where user_id=#userId# and del_flag=0
select flow_no as flowNo,IFNULL(account_money,0) as account,
hbb as money,IFNULL(money,0) as hbb,
user_name as userName,user_phone as userPhone,
type,role_name as roleName ,approver,approver_time,create_time
from xzx_partner_account_log where account_id=#accountId#
@if(!isEmpty(startTime)){
and create_time>=#startTime#
@}
@if(!isEmpty(endTime)){
and create_time<=#endTime#
@}
@if(!isEmpty(type)){
and type=#type#
@}
@if(!isEmpty(userName)){
and (user_name like #"%"+userName+"%"# or user_phone like #"%"+userName+"%"#)
@}
limit #page#,#limit#
select count(id) from xzx_partner_account_log where account_id=#accountId#
@if(!isEmpty(startTime)){
and create_time>=#startTime#
@}
@if(!isEmpty(endTime)){
and create_time<=#endTime#
@}
@if(!isEmpty(type)){
and type=#type#
@}
@if(!isEmpty(userName)){
and (user_name like #"%"+userName+"%"# or user_phone like #"%"+userName+"%"#)
@}
select create_time,flow_no as flowNo,IFNULL(new_money,0) as accountMoney,IFNULL(money,0) as money,IFNULL(new_hbb,0) as hbb,create_user_name as userName,create_user_mobile as userPhone,type,create_user_type as roleName from xzx_platform_account_log
where 1=1
@if(!isEmpty(startTime)){
and create_time>=#startTime#
@}
@if(!isEmpty(endTime)){
and create_time<=#endTime#
@}
@if(!isEmpty(type)){
and type=#type#
@}
@if(!isEmpty(userName)){
and (create_user_name like #"%"+userName+"%"# or create_user_mobile like #"%"+userName+"%"#)
@}
limit #page#,#limit#
select count(id) from xzx_platform_account_log where 1=1
@if(!isEmpty(startTime)){
and create_time>=#startTime#
@}
@if(!isEmpty(endTime)){
and create_time<=#endTime#
@}
@if(!isEmpty(type)){
and type=#type#
@}
@if(!isEmpty(userName)){
and (create_user_name like #"%"+userName+"%"# or create_user_mobile like #"%"+userName+"%"#)
@}
select group_concat(field_value) as account from xzx_platform_account_info;
select * from xzx_partner_account where user_id=#userId# and del_flag=0 limit 1
select IFNULL(c.name,n.nick_name) as userName,a.*,
IFNULL(c.mobile_phone,n.mobile_phone) as mobilePhone,
IFNULL(c.user_type,'1') as userType from xzx_account_log a
left join xzx_account_info d on a.account_id=d.account_id
left join ( select k.name,k.mobile_phone,k.user_type,k.user_id,k.partner_id from xzx_user_other_info k where k.del_flag=0) c on a.create_user_id = c.user_id
left join ( select m.mobile_phone,m.nick_name,m.user_id from xzx_user_info m where m.del_flag=0)n on a.create_user_id=n.user_id
where d.del_flag=0
@if(!isEmpty(userName)){
and (c.name like #"%"+userName+"%"# or c.mobile_phone like #"%"+userName+"%"# or n.mobile_phone like #"%"+userName+"%"#)
@}
@if(!isEmpty(startTime)){
and a.create_time>=#startTime#
@}
@if(!isEmpty(endTime)){
and a.create_time<=#endTime#
@}
@if(!isEmpty(typeList)){
and a.channel_type in ( #join(typeList)#)
@}
@if(!isEmpty(channelType)){
and a.channel_type=#channelType#
@}
@if(!isEmpty(accountId)){
and a.account_id=#accountId#
@}
@if(!isEmpty(partnerIds)){
and c.partner_id in ( #join(partnerIds)# )
@}
order by a.create_time desc
limit #page#,#limit#
select count(k.id) from (
select a.id from xzx_account_log a
left join xzx_account_info d on a.account_id=d.account_id
left join ( select k.name,k.mobile_phone,k.user_type,k.user_id,k.partner_id from xzx_user_other_info k where k.del_flag=0) c on a.create_user_id = c.user_id
left join ( select m.mobile_phone,m.nick_name,m.user_id from xzx_user_info m where m.del_flag=0)n on a.create_user_id=n.user_id
where d.del_flag=0
@if(!isEmpty(userName)){
and (c.name like #"%"+userName+"%"# or c.mobile_phone like #"%"+userName+"%"# or n.mobile_phone like #"%"+userName+"%"#)
@}
@if(!isEmpty(startTime)){
and a.create_time>=#startTime#
@}
@if(!isEmpty(endTime)){
and a.create_time<=#endTime#
@}
@if(!isEmpty(typeList)){
and a.channel_type in ( #join(typeList)#)
@}
@if(!isEmpty(channelType)){
and a.channel_type=#channelType#
@}
@if(!isEmpty(accountId)){
and a.account_id=#accountId#
@}
@if(!isEmpty(partnerIds)){
and c.partner_id in ( #join(partnerIds)# )
@}
) k
select b.level_1_id as pId,b.level_1_name as pName,b.level_2_id as cId,b.level_2_name as cName,a.town_id as cityId,b.level_3_name as cityName from xzx_partner_gaode a
left join xzx_sys_address_level_info b on a.town_id=b.level_3_id
where a.del_flag=0 and partner_id<>partner_key and a.town_id is not null
@if(!isEmpty(id)){
and a.partner_id=#id#
@}
select b.level_2_id as code,b.level_2_name as value from xzx_partner_gaode a
left join xzx_sys_address_level_info b on a.town_id=b.level_3_id
where a.del_flag=0 and partner_id<>partner_key and a.town_id is not null and b.level_1_id = #pid#
@if(!isEmpty(id)){
and a.partner_id=#id#
@}
group by b.level_2_id
select b.level_3_id as code,b.level_3_name as value from xzx_partner_gaode a
left join xzx_sys_address_level_info b on a.town_id=b.level_3_id
where a.del_flag=0 and partner_id<>partner_key and a.town_id is not null and b.level_2_id = #cid#
@if(!isEmpty(id)){
and a.partner_id=#id#
@}
select b.level_1_id as code,b.level_1_name as value from xzx_partner_gaode a
left join xzx_sys_address_level_info b on a.town_id=b.level_3_id
where a.del_flag=0 and partner_id<>partner_key and a.town_id is not null
@if(!isEmpty(id)){
and a.partner_id=#id#
@}
group by b.level_1_id
select id from xzx_city_partner where del_flag=0 and mobile_phone=#mobilePhone#
update xzx_account_info set is_prohibit=#isProhibit# where account_id=#accountId#
update xzx_user_other_info set del_flag=1 where partner_id=#id# and del_flag=0
update xzx_account_info set del_flag=1 where account_id=#accountId#
select count(a.id) from xzx_partner_gaode a
left join xzx_sys_address_level_info b on a.town_id =b.level_3_id
where level_3_name in ( #join(areaList)#) and a.del_flag=0
select * from xzx_user_other_info where del_flag=0 and user_type=#userType#
@if(!isEmpty(partnerIds)){
and partner_id in ( #join(partnerIds)# )
@}
select a.order_id,c.complete_time,a.address from xzx_order_info a
left join xzx_user_other_info b on a.receiver= b.user_id
left join xzx_order_detail_info c on a.order_id=c.order_id
where a.del_flag<>1 and b.del_flag=0 and b.user_type=2
and order_status in (4,5,7) and a.create_type in (1,3)
@if(!isEmpty(startTime)){
and c.complete_time>=#startTime#
@}
@if(!isEmpty(endTime)){
and c.complete_time<=#endTime#
@}
@if(!isEmpty(userId)){
and b.user_id=#userId#
@}
select * from xzx_city_partner where del_flag=0 and partner_type=1
@if(!isEmpty(partnerIds)){
AND id in ( #join(partnerIds)# )
@}
select * from xzx_city_partner where del_flag=0 and partner_type=2 and prohibit=0
select b.* from xzx_user_info b
left join xzx_user_address_info c on b.user_id=c.user_id
where b.del_flag=0 and c.flag=1
@if(!isEmpty(userName)){
and (b.name like #"%"+userName+"%"# or b.mobile_phone like #"%"+userName+"%"#)
@}
@if(!isEmpty(roleType)){
AND b.user_type =#roleType#
@}
@if(!isEmpty(townIds)){
AND c.township_id in (#join(townIds)#)
@}
select * from xzx_user_other_info
where del_flag=0
@if(!isEmpty(pid)){
AND (partner_id =#pid# or partner_id in (#join(packageStationList)#) )
@}
@if(!isEmpty(userName)){
and (name like #"%"+userName+"%"# or mobile_phone like #"%"+userName+"%"#)
@}
@if(!isEmpty(roleType)){
AND user_type =#roleType#
@}
select * from xzx_account_info where del_flag=0
@if(!isEmpty(userIds)){
AND user_id in ( #join(userIds)# )
@}
@if(!isEmpty(isProhibit)){
AND is_prohibit = #isProhibit#
@}
order by CAST(money AS DECIMAL) desc
limit #page#,#limit#
select count(account_id)
from xzx_account_info where del_flag=0
@if(!isEmpty(userIds)){
AND user_id in ( #join(userIds)# )
@}
@if(!isEmpty(isProhibit)){
AND is_prohibit =#isProhibit#
@}
order by money desc
update xzx_account_info set fixed_limit=#fixedLimit#,overdraft_limit=#overdraftLimit# where account_id=#accountId#
update xzx_account_info set fixed_limit=0,overdraft_limit=0
where user_id in ( #join(userIds)#)
select user_id from xzx_user_other_info where partner_id=#partnerId#
select * from xzx_account_info where account_id=#accountId#
select k.userId from (
select a.user_id as userId,a.name as userName,a.mobile_phone as mobilePhone,a.regist_time as createTime from xzx_user_info a where a.del_flag=0
union all
select b.user_id as userId,b.name as userName,b.mobile_phone as mobilePhone,b.regist_time as createTime from xzx_user_other_info b where b.del_flag=0
union all
select c.user_id as userId,c.partner_name as userName,c.mobile_phone as mobilePhone,c.create_time as createTime from xzx_city_partner c where c.del_flag=0
) k
where 1=1
@if(!isEmpty(userName)){
and (k.userName like #"%"+userName+"%"# or k.mobilePhone like #"%"+userName+"%"#)
@}
order by k.createTime desc
select id from xzx_city_partner where del_flag=0 and partner_type=2 and packing_station=#partnerId#