身份证号脱敏:
CONCAT(LEFT(ui.idcard,6),'****',RIGHT(ui.idcard,4)) as 身份证号 ,
姓名脱敏:
CONCAT(LEFT(o.custom_name,1),'**') as 客户姓名 ,
手机号脱敏:
CONCAT(LEFT(o.custom_phone,3),'****',RIGHT(ui.idcard,4)) as 客户手机号,
case when:
case
when c.on_time = 0 then 0
when c.on_time = 1 THEN 1
end as 服务时效 ,
case when 然后合并字段:
case
when r1.`code` = r2.pid THEN CONCAT(r2.`name`,r3.`name`)
ELSE CONCAT(r1.`name`,r2.`name`,r3.`name`)
end AS 服务地点,