edit | blame | history | raw

queryByCondition

select 
@pageTag(){
t.*
@}
from xzx_order_appraise_info t
where 1=1  
@//数据权限,该sql语句功能点,如果不考虑数据权限,可以删除此行  
and #function("xzxOrderAppraiseInfo.query")#

batchDelXzxOrderAppraiseInfoByIds

  • 批量逻辑删除

    update xzx_order_appraise_info set del_flag = 1 where id in( #join(ids)#)

queryAppraiseInfoList

select a.create_time as time,b.name as receiverName,b.mobile_phone as receiverPhone,
a.star,a.tag_codes,c.nick_name as userName,c.mobile_phone as userPhone, 
a.anonymous_flag,a.order_id,a.content,a.resource_ids,d.create_time as createTime,d.reserve_time as reserveTime,
e.receive_time as receiveTime,d.order_status as orderStatus,d.address_area as addressArea,d.address as address,e.remark
from xzx_order_appraise_info a
LEFT JOIN xzx_order_info d ON a.order_id=d.order_id
LEFT JOIN xzx_order_detail_info e ON a.order_id=e.order_id
LEFT JOIN xzx_user_other_info b on a.receiver_id=b.user_id and b.user_type=2
LEFT JOIN xzx_user_info c on a.create_user_id = c.user_id and (c.user_type=1 or c.user_type is null)   
where a.del_flag=0 and b.del_flag=0
@if(!isEmpty(name)){
        AND b.name like #"%"+name+"%"# or b.mobile_phone like #"%"+name+"%"# 
@} 
@if(!isEmpty(partnerIds)){
            AND b.partner_id in ( #join(partnerIds)# )
    @}      
limit #page#, #limit# 

queryAppraiseInfoCount

select count(k.id) from (
        select a.id as id
            from xzx_order_appraise_info a
            LEFT JOIN xzx_user_other_info b on a.receiver_id=b.user_id and b.user_type=2
            LEFT JOIN xzx_user_info c on a.create_user_id = c.user_id and (c.user_type=1 or c.user_type is null)   
            where a.del_flag=0 and b.del_flag=0
            @if(!isEmpty(name)){
                    AND b.name like #"%"+name+"%"# or b.mobile_phone like #"%"+name+"%"# 
            @} 
            @if(!isEmpty(partnerIds)){
                            AND b.partner_id in ( #join(partnerIds)# )
                    @}    
        )k

queryConfigByAppraseInfo

select config_type_name 
from xzx_sys_config_info 
where config_group=#value#
group by config_type_name

queryConfigByTagCode

select config_value 
from xzx_sys_config_info 
where config_type_code in (#join(codes)#)

queryConfigByTagCodeOne

select config_value 
from xzx_sys_config_info 
where config_type_code =#typeCode#

queryResourceUrls

select resource_url from xzx_sys_resource_info where id in (#join(resArr)#)   

queryReceiverTotalList

select count(id) as num,AVG(star) as star,b.name as name
from xzx_order_appraise_info a
left join xzx_user_other_info b on a.receiver_id=b.user_id and b.user_type=2 
where 1=1 and b.del_flag=0
@if(!isEmpty(name)){
    AND b.name like #"%"+name+"%"# or b.mobile_phone like #"%"+name+"%"# 
@} 
@if(!isEmpty(partnerIds)){
        AND b.partner_id in ( #join(partnerIds)# )
    @} 
group by receiver_id 

queryStarTotalNum

select count(a.id) as num,a.star as star 
from xzx_order_appraise_info a
left join(
       select m.partner_id,n.order_id from xzx_user_other_info m
       LEFT JOIN xzx_order_info n on n.receiver=m.user_id
    )j on a.order_id = j.order_id
where 1=1    
  @if(!isEmpty(partnerIds)){
             AND j.partner_id in ( #join(partnerIds)# )
         @}    
group by a.star

getModelCodeList

select tag_codes as codes from xzx_order_appraise_info where star=#star#