-- 软件抓图上传接口 需要上传的图片视图
CREATE view  v_gnkssctp
as
SELECT (case when a.his_xmdm='8522' then 'xdt' else '' end) gnlx,concat(c.cus_name,'_',a.id,'.jpg') picname
FROM ltkj_jianchajianyan_tree a
         left join tj_order b  on b.card_id = a.card_id join tj_customer c on c.cus_id = b.user_id
         left join sys_attachment d on d.old_file_name<>concat(c.cus_name,'_',a.id,'.jpg')
where a.his_xmdm  in ('8522','gmd');
