|
|
@@ -5,7 +5,8 @@ select * from ((SELECT
|
|
|
t5.address,
|
|
|
t5.enterprisename,
|
|
|
t5.abbreviation,
|
|
|
- case when ifnull(t6.cardno,'')='' then '未安装' else '已安装' end isinstalled,
|
|
|
+ case when (LENGTH(t6.cardno)>0 and t6.isvoid=0) then '已安装' else '未安装' end isinstalled,
|
|
|
+ case when current_date between t6.begdate and t6.enddate then '在保' else '过保' end warrantystatus,
|
|
|
t6.cardno,
|
|
|
t6.begdate,
|
|
|
t6.enddate,
|
|
|
@@ -20,7 +21,8 @@ select * from ((SELECT
|
|
|
t2.spec,
|
|
|
t3.unitname,
|
|
|
t7.name as customername,
|
|
|
- t7.phonenumber as customerphonenumber
|
|
|
+ t7.phonenumber as customerphonenumber,
|
|
|
+ t2.topclassnum
|
|
|
FROM sa_itemsku t1
|
|
|
LEFT JOIN plm_item t2 ON t1.itemid = t2.itemid AND t1.siteid = t2.siteid
|
|
|
LEFT JOIN plm_unit t3 ON t3.unitid = t2.unitid AND t3.siteid = t2.siteid
|
|
|
@@ -44,7 +46,8 @@ select * from ((SELECT
|
|
|
t5.address,
|
|
|
t5.enterprisename,
|
|
|
t5.abbreviation,
|
|
|
- case when ifnull(t6.cardno,'')='' then '未安装' else '已安装' end isinstalled,
|
|
|
+ case when (LENGTH(t6.cardno)>0 and t6.isvoid=0) then '已安装' else '未安装' end isinstalled,
|
|
|
+ case when current_date between t6.begdate and t6.enddate then '在保' else '过保' end warrantystatus,
|
|
|
t6.cardno,
|
|
|
t6.begdate,
|
|
|
t6.enddate,
|
|
|
@@ -59,7 +62,8 @@ select * from ((SELECT
|
|
|
t2.spec,
|
|
|
t3.unitname,
|
|
|
t7.name as customername,
|
|
|
- t7.phonenumber as customerphonenumber
|
|
|
+ t7.phonenumber as customerphonenumber,
|
|
|
+ t2.topclassnum
|
|
|
FROM sa_itemsku t1
|
|
|
INNER JOIN sa_agents a ON t1.sa_agentsid = a.sa_agentsid
|
|
|
AND t1.siteid = a.siteid
|