wisdom #2
@@ -33,11 +33,10 @@ const getAllTagsDb = async (searchParams = {}) => {
|
|||||||
{ column: "a.unit", param: searchParams.unit, type: "string" },
|
{ column: "a.unit", param: searchParams.unit, type: "string" },
|
||||||
{ column: "b.device_name", param: searchParams.device, type: "string" },
|
{ column: "b.device_name", param: searchParams.device, type: "string" },
|
||||||
{
|
{
|
||||||
column: "b.device_description",
|
column: "b.device_code",
|
||||||
param: searchParams.device,
|
param: searchParams.device,
|
||||||
type: "string",
|
type: "string",
|
||||||
},
|
},
|
||||||
{ column: "b.ip_address", param: searchParams.device, type: "string" },
|
|
||||||
{
|
{
|
||||||
column: "c.sub_section_name",
|
column: "c.sub_section_name",
|
||||||
param: searchParams.subsection,
|
param: searchParams.subsection,
|
||||||
@@ -54,8 +53,7 @@ const getAllTagsDb = async (searchParams = {}) => {
|
|||||||
COUNT(*) OVER() AS total_data,
|
COUNT(*) OVER() AS total_data,
|
||||||
a.*,
|
a.*,
|
||||||
b.device_name,
|
b.device_name,
|
||||||
b.ip_address,
|
b.device_code,
|
||||||
b.device_description,
|
|
||||||
c.sub_section_name
|
c.sub_section_name
|
||||||
FROM m_tags a
|
FROM m_tags a
|
||||||
LEFT JOIN m_device b ON a.device_id = b.device_id
|
LEFT JOIN m_device b ON a.device_id = b.device_id
|
||||||
@@ -82,8 +80,7 @@ const getTagsByIdDb = async (id) => {
|
|||||||
SELECT
|
SELECT
|
||||||
a.*,
|
a.*,
|
||||||
b.device_name,
|
b.device_name,
|
||||||
b.ip_address,
|
b.device_code,
|
||||||
b.device_description,
|
|
||||||
c.sub_section_name
|
c.sub_section_name
|
||||||
FROM m_tags a
|
FROM m_tags a
|
||||||
LEFT JOIN m_device b ON a.device_id = b.device_id
|
LEFT JOIN m_device b ON a.device_id = b.device_id
|
||||||
|
|||||||
Reference in New Issue
Block a user