Explorar el Código

修改事件驱动报表未以前的版本

zhoupeng hace 1 año
padre
commit
b13cc27164

+ 12 - 2
chaunyi_opc/opc_common/src/main/java/com/example/opc_common/util/ConstantStr.java

@@ -18,7 +18,7 @@ public class ConstantStr {
     public static final long TEN_MINUTE = 60 * 10;
     public static final long HALF_HOUR = 60 * 30;
     public static final long ONE_HOUR = 60 * 60;
-    public static final long TWO_HOUR = 60 * 60;
+    public static final long TWO_HOUR = 60 * 60 * 2;
     public static final long FIVE_HOUR = 60 * 60 * 5;
 
     //用户类型,0前端用户,1后端用户
@@ -127,17 +127,27 @@ public class ConstantStr {
     //统计图取值格式
     public static final Integer CHART_VALUE_HOUR = 0;
 
-    //报表类型,0手动,1自动,2事件,3自动子表,4事件子表
+    //报表类型,0手动,1自动,2事件,3自动子表,4事件子表,5设备报表,5设备子表
     public static final Integer MANUAL_REPORT = 0;
     public static final Integer AUTOMATIC_REPORT = 1;
     public static final Integer EVENT_DRIVEN_REPORT = 2;
     public static final Integer AUTOMATIC_GENERATE_REPORT = 3;
     public static final Integer EVENT_GENERATE_REPORT = 4;
+    public static final Integer DEVICE_REPORT = 5;
+    public static final Integer DEVICE_GENERATE_REPORT = 6;
 
     //报表取值类型;0原始值,1计算值
     public static final Integer ORIGINAL_VALUE = 0;
     public static final Integer CALCULATED_VALUE = 1;
 
+    //变量类型(1单变量,2双变量)
+    public static final Integer UNIVARIATE = 1;
+    public static final Integer BIVARIATE = 2;
+
+    //时间项类型(0开始,1结束)
+    public static final Integer START_TIME_ITEM = 0;
+    public static final Integer END_TIME_ITEM = 1;
+
     //消息通知状态,0未读,1已读
     public static final Integer NO_READ = 0;
     public static final Integer ALREADY_READ = 1;

+ 3 - 1
chaunyi_opc/opc_da/src/main/java/com/example/opc_da/dao/RawDataDao.java

@@ -58,7 +58,9 @@ public interface RawDataDao {
 
     Integer updateAttachRawData(AttachRawData attachRawData);
 
-    List<Long> getEventRealIndexList(Integer itemGroupId, Integer dataSourceId, Integer itemId, List<Long> indexList, Integer eventMode, Double modeValue);
+    List<Long> getEventRealIndexList(Integer itemGroupId, Integer dataSourceId, Integer itemId, List<Long> indexList);
 
     AttachRawData getAttachRawDataReal(Integer itemGroupId, Integer dataSourceId, String itemReadName);
+
+    Integer addDeviceRawData(List<Integer> tableIdList, CursorRawData cursorRawData);
 }

+ 2 - 0
chaunyi_opc/opc_da/src/main/java/com/example/opc_da/dao/ReportTableDao.java

@@ -155,4 +155,6 @@ public interface ReportTableDao {
     Long getTttiCountByItemId(List<Item> itemList);
 
     Long getTtciCountByItemId(List<Item> itemList);
+
+    List<Integer> getDeviceTableByItemId(List<Item> itemList, Integer reportTableType);
 }

+ 19 - 5
chaunyi_opc/opc_da/src/main/java/com/example/opc_da/service/impl/ReportTableServiceImpl.java

@@ -102,9 +102,14 @@ public class ReportTableServiceImpl implements ReportTableService {
             reportTableTask.addAutoReport(tableTemplate);
         } else if (templateType.equals(ConstantStr.EVENT_DRIVEN_REPORT)) {
             if (Blank.isNotEmpty(tableTemplate.getTableTemplateChartList())) {
-                throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "事件驱动报表模板中,不能存在统计图");
+                throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "事件驱动报表不能存在统计图");
             }
             reportTableTask.addEventReport(tableTemplate);
+        } else if (templateType.equals(ConstantStr.DEVICE_REPORT)) {
+            if (Blank.isNotEmpty(tableTemplate.getTableTemplateChartList())) {
+                throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "设备报表不能存在统计图");
+            }
+            reportTableTask.addDeviceReport(tableTemplate);
         } else {
             throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "目前只支持手动,自动,事件驱动类型的报表");
         }
@@ -144,6 +149,11 @@ public class ReportTableServiceImpl implements ReportTableService {
                 throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "事件驱动报表模板中,不能存在统计图");
             }
             reportTableTask.updateEventReport(tableTemplate, reportTable);
+        } else if (templateType.equals(ConstantStr.DEVICE_REPORT)) {
+            if (Blank.isNotEmpty(tableTemplate.getTableTemplateChartList())) {
+                throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "设备报表不能存在统计图");
+            }
+            reportTableTask.updateDeviceReport(tableTemplate, reportTable);
         } else {
             throw new CustomException(ResultEnum.REQUEST_WRONGPARAMS.getRespCode(), "目前只支持手动,自动,事件驱动类型的报表");
         }
@@ -207,7 +217,7 @@ public class ReportTableServiceImpl implements ReportTableService {
         Integer templateType = tableTemplate.getTemplateType();
         if (flag) {
             if (reportTableDao.delTableTemplateById(id) <= 0) {
-                return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "删除报表模板失败");
+                return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "删除报表失败");
             }
             reportTableDao.delTtiByTtId(id);
             List<TableTemplateChart> tableTemplateCharts = reportTableDao.getTtcByTemplateId(id);
@@ -235,10 +245,11 @@ public class ReportTableServiceImpl implements ReportTableService {
                 //将相应的报表变为逻辑删除
                 reportTableDao.logicDeleteReportTable(id, templateType, ConstantStr.PUBLIC_IS_DELETE);
             }
-            return Result.ok("删除报表模板成功");
+            return Result.ok("删除报表成功");
         } else {
             ReportTable reportTable = reportTableDao.getReportTableByTemplate(tableTemplate);
-            if (templateType.equals(ConstantStr.MANUAL_REPORT) || templateType.equals(ConstantStr.EVENT_DRIVEN_REPORT)) {
+            if (templateType.equals(ConstantStr.MANUAL_REPORT) || templateType.equals(ConstantStr.EVENT_DRIVEN_REPORT)
+                    || templateType.equals(ConstantStr.DEVICE_REPORT)) {
                 return Result.ok("此报表在运行配置中生成了相应的数据报表,确认要删除?", "fail");
             } else if (templateType.equals(ConstantStr.AUTOMATIC_REPORT)) {
                 String cronId = reportTable.getCronId();
@@ -246,7 +257,7 @@ public class ReportTableServiceImpl implements ReportTableService {
                     return Result.ok("此报表在运行配置中生成了相应的数据报表,确认要删除?", "fail");
                 }
                 if (reportTableDao.delTableTemplateById(id) <= 0) {
-                    return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "删除报表模板失败");
+                    return Result.no(ResultEnum.SERVER_ERROR.getRespCode(), "删除报表失败");
                 }
                 reportTableDao.delTtiByTtId(id);
                 List<TableTemplateChart> tableTemplateCharts = reportTableDao.getTtcByTemplateId(id);
@@ -294,6 +305,9 @@ public class ReportTableServiceImpl implements ReportTableService {
         } else if (reportTableType.equals(ConstantStr.EVENT_DRIVEN_REPORT)) {
             Integer chTableId = reportTableDao.getEventChTableId(id);
             reportTable.setReportTableItemList(reportTableDao.getTableItemListById(chTableId));
+        } else if (reportTableType.equals(ConstantStr.DEVICE_REPORT)) {
+            Integer chTableId = reportTableDao.getEventChTableId(id);
+            reportTable.setReportTableItemList(reportTableDao.getTableItemListById(chTableId));
         } else {
             reportTable.setReportTableItemList(reportTableDao.getTableItemListById(id));
             reportTable.setReportChartList(reportTableDao.getReportChartList(id));

+ 22 - 3
chaunyi_opc/opc_da/src/main/java/com/example/opc_da/task/OpcAsyncTask.java

@@ -65,6 +65,19 @@ public class OpcAsyncTask {
         }
     }
 
+    /**
+     * 新增一条设备报表临时数据
+     *
+     * @param cursorRawData
+     */
+    public void addDeviceRawData(List<Integer> tableIdList, CursorRawData cursorRawData) {
+        if (Blank.isNotEmpty(cursorRawData)) {
+            if (Blank.isNotEmpty(tableIdList)) {
+                rawDataDao.addDeviceRawData(tableIdList, cursorRawData);
+            }
+        }
+    }
+
     public synchronized void addAttachRawData(AttachRawData attachRawData) {
         if (Blank.isNotEmpty(attachRawData)) {
             AttachRawData attachRawData1 = rawDataDao.getAttachRawDataReal(attachRawData.getItemGroupId(), attachRawData.getDataSourceId(), attachRawData.getItemName());
@@ -98,14 +111,12 @@ public class OpcAsyncTask {
                         ReportTable reportTable = reportTableDao.getReportTableById(tableId);
                         Integer tableTemplateId = reportTable.getTableTemplateId();
                         TableTemplate tableTemplate = reportTableDao.getTableTemplateById(tableTemplateId);
-                        Integer eventMode = tableTemplate.getEventMode();
-                        Double modeValue = tableTemplate.getModeValue();
                         Integer eventNum = tableTemplate.getEventNum();
                         Integer chTableId = reportTableDao.getEventChTableId(tableId);
                         List<TableTemplateTableItem> tableTemplateItemList = reportTableDao.getTttiByTemplateId(tableTemplateId);
                         TableTemplateTableItem tableTemplateTableItem = tableTemplateItemList.get(0);
                         //判断哪些符合驱动报表,并将符合的index返回回来
-                        List<Long> realIndexList = rawDataDao.getEventRealIndexList(itemGroupId, dataSourceId, tableTemplateTableItem.getItemId(), indexList, eventMode, modeValue);
+                        List<Long> realIndexList = rawDataDao.getEventRealIndexList(itemGroupId, dataSourceId, tableTemplateTableItem.getItemId(), indexList);
                         if (Blank.isNotEmpty(realIndexList)) {
                             int size = realIndexList.size();
                             if (Blank.isEmpty(chTableId)) {
@@ -540,6 +551,14 @@ public class OpcAsyncTask {
         }
     }
 
+    public void packDeviceTable(List<Item> itemList, List<Integer> tableIdList, Integer dataSourceId, Long dataIndex) {
+        if (Blank.isNotEmpty(itemList)) {
+            for (Integer tableId : tableIdList) {
+
+            }
+        }
+    }
+
     /**
      * 组装通过周期和改变读取的数据
      *

+ 18 - 13
chaunyi_opc/opc_da/src/main/resources/mapper/RawDataDao.xml

@@ -39,12 +39,26 @@
     </insert>
 
     <insert id="addAttachRawData">
-        insert into t_attach_raw_data
-        (item_group_id, data_source_id, item_name, data_type, org_data_value, data_value, data_value_time,
+        insert into t_device_attach_raw_data
+        (report_table_id, item_group_id, data_source_id, item_name, data_type, org_data_value, data_value,
+         data_value_time,
          create_time)
-            VALUE (#{itemGroupId}, #{dataSourceId}, #{itemName}, #{dataType},
+        VALUES (#{itemGroupId}, #{dataSourceId}, #{itemName}, #{dataType},
+                #{orgDataValue}, #{dataValue},
+                #{dataValueTime}, #{createTime})
+    </insert>
+    
+    <insert id="addDeviceRawData">
+        insert into t_device_raw_data
+        (item_group_id, data_source_id, item_name, data_type, org_data_value, data_value, data_value_time, data_index,
+        value_belong_time,
+        is_record, create_time)
+        VALUES
+        <foreach collection="tableIdList" item="tableId" separator=",">
+            (#{tableId},#{itemGroupId}, #{dataSourceId}, #{itemName}, #{dataType},
             #{orgDataValue}, #{dataValue},
-            #{dataValueTime}, #{createTime})
+            #{dataValueTime}, #{dataIndex}, #{valueBelongTime}, #{isRecord}, #{createTime})
+        </foreach>
     </insert>
 
     <update id="updateAttachRawData">
@@ -297,15 +311,6 @@
         <foreach collection="indexList" item="index" separator="," open="(" close=")">
             #{index}
         </foreach>
-        <if test="eventMode==0">
-            AND #{modeValue} &lt;data_value
-        </if>
-        <if test="eventMode==1">
-            AND #{modeValue} &gt; data_value
-        </if>
-        <if test="eventMode==2">
-            AND #{modeValue} = data_value
-        </if>
         ORDER BY data_index
     </select>
 

+ 45 - 19
chaunyi_opc/opc_da/src/main/resources/mapper/ReportTableDao.xml

@@ -4,17 +4,19 @@
 
     <sql id="tableTemplate">
         id
-        , user_id, template_name, template_type, template_data, event_mode, mode_value, event_num, version, update_time, create_time
+        , user_id, template_name, template_type, template_data, event_num, is_gen_count_time,
+        variable_type, start_item_id, start_value, end_item_id, end_value, version, update_time, create_time
     </sql>
 
     <sql id="tableTemplateNoData">
         id
-        , user_id, template_name , template_type, event_num, version, update_time, create_time
+        , user_id, template_name , template_type, event_num, is_gen_count_time,
+        variable_type, start_item_id, start_value, end_item_id, end_value, version, update_time, create_time
     </sql>
 
     <sql id="tableTemplateTableItem">
         id
-        , table_template_id, item_id , place_holder, xaxis, yaxis, value_taking_mode, value_type, bucket_type,
+        , table_template_id, item_id , time_item_type, place_holder, xaxis, yaxis, value_taking_mode, value_type, bucket_type,
             bucket_value, standby
     </sql>
 
@@ -31,27 +33,31 @@
 
     <sql id="reportTable">
         id
-        , report_table_type, table_template_id, user_id, report_table_name, report_table_data, start_time, current_num, version, create_time, is_delete
+        , report_table_type, table_template_id, user_id, report_table_name, report_table_data, start_time,
+            current_num, is_gen_count_time, version, create_time, is_delete
     </sql>
 
     <sql id="reportTableItem">
         id
-        , report_table_id, item_id, value_type, xaxis, yaxis, standby, value_list, value_time_list, value_index_list
+        , report_table_id, item_id, time_item_type, value_type, xaxis, yaxis, standby, value_list, value_time_list, value_index_list
     </sql>
 
     <sql id="reportTableNoData">
         id
-        , report_table_type, table_template_id, user_id, report_table_name, start_time, current_num, version, create_time, is_delete
+        , report_table_type, table_template_id, user_id, report_table_name, start_time, current_num,
+            is_gen_count_time, version, create_time, is_delete
     </sql>
 
     <sql id="reportTableCron">
         id
-        , report_table_type, table_template_id, user_id, report_table_name, report_table_data, start_time, current_num, version, cron_id, cron , run_state, create_time, is_delete
+        , report_table_type, table_template_id, user_id, report_table_name, report_table_data, start_time,
+            current_num, is_gen_count_time, version, cron_id, cron , run_state, create_time, is_delete
     </sql>
 
     <sql id="reportTableCronNoData">
         id
-        , report_table_type, table_template_id, user_id, report_table_name, start_time, current_num, version, cron_id, cron , run_state, create_time, is_delete
+        , report_table_type, table_template_id, user_id, report_table_name, start_time, current_num,
+            is_gen_count_time, version, cron_id, cron , run_state, create_time, is_delete
     </sql>
 
     <sql id="reportChart">
@@ -76,27 +82,29 @@
 
     <sql id="item">
         id
-        , item_group_id, item_name, item_read_name, node_index , data_type, `describe`, data_model_id, is_driver_item
+        , item_group_id, item_name, item_read_name, node_index , data_type, `describe`, data_model_id
     </sql>
 
     <insert id="addTableTemplate" parameterType="com.example.opc_common.entity.TableTemplate" useGeneratedKeys="true"
             keyProperty="id">
-        insert into t_table_template(user_id, template_name, template_type, template_data, event_mode, mode_value,
+        insert into t_table_template(user_id, template_name, template_type, template_data,
                                      event_num, version,
                                      update_time,
                                      create_time)
             VALUE ( #{userId},
             #{templateName}, #{templateType},
-            #{templateData}, #{eventMode}, #{modeValue}, #{eventNum}, #{version},#{updateTime},#{createTime}
+            #{templateData}, #{eventNum}, #{version},#{updateTime},#{createTime}
             )
     </insert>
 
     <insert id="addReportTable" parameterType="com.example.opc_common.entity.ReportTable" useGeneratedKeys="true"
             keyProperty="id">
         insert into t_report_table(report_table_type, table_template_id, user_id, report_table_name,
-                                   report_table_data, start_time, current_num, version, cron_id, cron,
+                                   report_table_data, start_time, current_num, is_gen_count_time, version, cron_id,
+                                   cron,
                                    create_time, is_delete) VALUE
-            (#{reportTableType},#{tableTemplateId}, #{userId}, #{reportTableName}, #{reportTableData}, #{startTime}, #{currentNum}, #{version},
+            (#{reportTableType},#{tableTemplateId}, #{userId}, #{reportTableName}, #{reportTableData}, #{startTime},
+            #{currentNum}, #{isGenCountTime}, #{version},
             #{cronId}, #{cron}, #{createTime}, #{isDelete})
     </insert>
 
@@ -120,13 +128,14 @@
 
     <insert id="addTableTemplateItem">
         <if test="tableTemplateTableItemList!= null and tableTemplateTableItemList.size() >0">
-            insert into t_table_template_table_item (table_template_id, item_id, is_driver_item, place_holder, xaxis,
+            insert into t_table_template_table_item (table_template_id, item_id, time_item_type, place_holder, xaxis,
             yaxis,
             value_taking_mode, value_type, bucket_type, bucket_value, standby)
             values
             <foreach collection="tableTemplateTableItemList" item="tableTemplateTableItem" separator=",">
                 (#{tableTemplateTableItem.tableTemplateId},
-                #{tableTemplateTableItem.itemId},#{tableTemplateTableItem.isDriverItem},
+                #{tableTemplateTableItem.itemId},
+                #{tableTemplateTableItem.timeItemType},
                 #{tableTemplateTableItem.placeHolder},
                 #{tableTemplateTableItem.xaxis}
                 , #{tableTemplateTableItem.yaxis},
@@ -139,9 +148,9 @@
     </insert>
 
     <insert id="addReportTableItem">
-        insert into t_report_table_item (report_table_id, item_id, value_type, xaxis, yaxis, standby,
+        insert into t_report_table_item (report_table_id, item_id, time_item_type, value_type, xaxis, yaxis, standby,
                                          value_list, value_time_list, value_index_list)
-            value (#{reportTableId}, #{itemId}, #{valueType}, #{xaxis}, #{yaxis}, #{standby},
+            value (#{reportTableId}, #{itemId}, #{timeItemType}, #{valueType}, #{xaxis}, #{yaxis}, #{standby},
             #{valueList}, #{valueTimeList}, #{valueIndexList})
     </insert>
 
@@ -670,7 +679,6 @@
         SELECT tttti.id,
                tttti.table_template_id,
                tttti.item_id,
-               tttti.is_driver_item,
                ti.item_group_id,
                ti.item_name,
                ti.item_type,
@@ -687,7 +695,6 @@
                  LEFT JOIN t_item ti ON tttti.item_id = ti.id
                  LEFT JOIN t_item_group tig ON ti.item_group_id = tig.id
         WHERE tttti.table_template_id = #{tableTemplateId}
-        order by tttti.is_driver_item DESC
     </select>
 
     <select id="getTableByItemId" resultType="java.lang.Integer">
@@ -729,6 +736,7 @@
         select trti.id
              , trti.report_table_id
              , trti.item_id
+             , trti.time_item_type
              , trti.value_type
              , ti.item_name
              , ti.describe
@@ -941,4 +949,22 @@
         </foreach>
     </select>
 
+    <select id="getDeviceTableByItemId" resultType="java.lang.Integer">
+        SELECT id
+        FROM t_report_table
+        WHERE table_template_id IN
+        (SELECT DISTINCT (table_template_id) AS table_template_id
+        FROM t_table_template_table_item
+        WHERE 1=1
+        <if test="itemList!= null and itemList.size() >0">
+            and item_id in
+            <foreach collection="itemList" item="item" separator="," open="(" close=")">
+                #{item.id}
+            </foreach>
+            and time_item_type is not null
+        </if>
+        )
+        AND report_table_type = #{reportTableType}
+    </select>
+
 </mapper>

+ 1 - 1
chaunyi_opc/opc_ua/src/main/java/com/example/opc_ua/dao/RawDataDao.java

@@ -39,5 +39,5 @@ public interface RawDataDao {
 
     Integer updateAttachRawData(AttachRawData attachRawData);
 
-    List<Long> getEventRealIndexList(Integer itemGroupId, Integer dataSourceId, Integer itemId, List<Long> indexList, Integer eventMode, Double modeValue);
+    List<Long> getEventRealIndexList(Integer itemGroupId, Integer dataSourceId, Integer itemId, List<Long> indexList);
 }

+ 1 - 3
chaunyi_opc/opc_ua/src/main/java/com/example/opc_ua/task/OpcAsyncTask.java

@@ -89,14 +89,12 @@ public class OpcAsyncTask {
                         ReportTable reportTable = reportTableDao.getReportTableById(tableId);
                         Integer tableTemplateId = reportTable.getTableTemplateId();
                         TableTemplate tableTemplate = reportTableDao.getTableTemplateById(tableTemplateId);
-                        Integer eventMode = tableTemplate.getEventMode();
-                        Double modeValue = tableTemplate.getModeValue();
                         Integer eventNum = tableTemplate.getEventNum();
                         Integer chTableId = reportTableDao.getEventChTableId(tableId);
                         List<TableTemplateTableItem> tableTemplateItemList = reportTableDao.getTttiByTemplateId(tableTemplateId);
                         TableTemplateTableItem tableTemplateTableItem = tableTemplateItemList.get(0);
                         //判断哪些符合驱动报表,并将符合的index返回回来
-                        List<Long> realIndexList = rawDataDao.getEventRealIndexList(itemGroupId, dataSourceId, tableTemplateTableItem.getItemId(), indexList, eventMode, modeValue);
+                        List<Long> realIndexList = rawDataDao.getEventRealIndexList(itemGroupId, dataSourceId, tableTemplateTableItem.getItemId(), indexList);
                         if (Blank.isNotEmpty(realIndexList)) {
                             int size = realIndexList.size();
                             if (Blank.isEmpty(chTableId)) {

+ 0 - 9
chaunyi_opc/opc_ua/src/main/resources/mapper/RawDataDao.xml

@@ -197,15 +197,6 @@
         <foreach collection="indexList" item="index" separator="," open="(" close=")">
             #{index}
         </foreach>
-        <if test="eventMode==0">
-            AND #{modeValue} &lt;data_value
-        </if>
-        <if test="eventMode==1">
-            AND #{modeValue} &gt; data_value
-        </if>
-        <if test="eventMode==2">
-            AND #{modeValue} = data_value
-        </if>
         ORDER BY data_index
     </select>
 

+ 1 - 3
chaunyi_opc/opc_ua/src/main/resources/mapper/ReportTableDao.xml

@@ -76,7 +76,7 @@
 
     <sql id="item">
         id
-        , item_group_id, item_name, item_read_name, node_index , data_type, `describe`, data_model_id, is_driver_item
+        , item_group_id, item_name, item_read_name, node_index , data_type, `describe`, data_model_id
     </sql>
 
     <insert id="addReportTable" parameterType="com.example.opc_common.entity.ReportTable" useGeneratedKeys="true"
@@ -249,7 +249,6 @@
         SELECT tttti.id,
                tttti.table_template_id,
                tttti.item_id,
-               tttti.is_driver_item,
                ti.item_group_id,
                ti.item_name,
                ti.item_type,
@@ -266,7 +265,6 @@
                  LEFT JOIN t_item ti ON tttti.item_id = ti.id
                  LEFT JOIN t_item_group tig ON ti.item_group_id = tig.id
         WHERE tttti.table_template_id = #{tableTemplateId}
-        order by tttti.is_driver_item DESC
     </select>
 
 </mapper>