助手设计

助手设计:
1、.tld文件
   继承tagSuport,实现doEndTag,其中通过流操作在页面动态生产控件
   private String getSelectHtml(List list)
  
   表头:  
  <select id="HELPER-ALL-QUESTIONS" parameterClass="java.util.Map"  resultClass="com.palic.elis.common.codetable.common.dto.ElisCodeTableDTO">
  <![CDATA[
    select ASSISTANT_NO as codeId, DESCRIPTION as description
      from LCS_ASSISTANT_TYPE
     where CHANNEL_TYPE = #channelType#
       and ASSISTANT_ATTRIBUTE = #helperType#
  ]]>
  <dynamic>
      <isNotEmpty prepend="and" property="filterType">
           <![CDATA[
           assistant_no like channel_type||#filterType#||'%'
           ]]>
      </isNotEmpty>
  </dynamic>
  </select>
 
查询佣金某项目标题及详细(LinkedList,每项是String[] )
  /lcs.helper.lcsHelperDetail.do  lcsHelperDetail
 
  <select id="HELPER-TITLE" parameterClass="java.util.Map"  resultClass="java.lang.String">
  <![CDATA[
    select b.description
      from lcs_assistant_type        a,
           lcs_assistant_element     b,
           lcs_assistant_text_format c
     where a.assistant_no = c.assistant_no
       and b.element_no = c.element_no
       and a.assistant_no = #helperNo#
       and a.channel_type = #channelType#
       and a.assistant_attribute = #helperType#
       and c.IS_DISABLE = 'Y'
     order by c.format_number
    ]]>
  </select>
 
  <select id="HELPER-CHECK-ITEMS" parameterClass="java.util.Map"  resultClass="java.lang.String">
  <![CDATA[
    select /*+ index(a IX_LCSASSDETAIL_EMPDATEASS)*/a.TEXT
      from LCS_ASSISTANT_DETAIL    a,
           lcs_batch_trace         c
     where a.BELONG_DATE = trunc(to_date(#yearMonth#, 'yyyymm'), 'mm')
       and a.EMP_TYPE = #channelType#
       and a.ASSISTANT_NO = #helperNo#
       and a.EMPLOYEE_NO = #employeeNo#
       and c.trace_month = #yearMonth#
       and c.channel_type = #channelType#
       and c.trace_type = '00012'
       and c.region_code = #databaseRegionCode#
       and c.text like substr(a.TEXT, 0, instr(a.TEXT, ';'))||'%'
       and a.SEQ = substr(c.text, instr(c.text, ';')+1, length(c.text))
       and a.times > 0
     order by TIMES
   ]]>
  </select>
 
 
  查出佣金项对应的助手text数据(;号隔开),页面根据助手类型号在iframe页面导入详细项目页面。
  <script type="text/javascript" language="JavaScript">
  <!--
  getHelperInfo();
  getMoreDetail();
  //-->
  </script>
 
 
  显示返回包含标题和内容的结果,标题instatus.first用特殊html格式显示,内容正常显示
  <c:if test="${not empty result}">                                                   
  <elis:tabletitle title="查询结果"></elis:tabletitle>                                
  <table width="100%" cellspacing="0" cellpadding="4" class="table_1" id="resultTable">
   <c:forEach items="${result}" var="results" varStatus="status">                    
    <tr>                                                                            
     <c:forEach items="${results}" varStatus="instatus">                           
       <c:if test="${status.first }">                                              
          <th class="td_1"><c:out value="${results[instatus.index]}"/></th>        
       </c:if>                                                                     
       <c:if test="${!status.first}">                                              
         <td class="td_3"><c:out value="${results[instatus.index]}"/></td>         
       </c:if>                                                                     
     </c:forEach>                                                                  
          </tr>                                                                       
       </c:forEach>                                                                   
  </table>                                                                            
  </c:if>                                        
 
 
 
  数据结构:
一、项目表头查询(3个基表):
1、LCS_ASSISTANT_TYPE LCS助手类型表  assistant_no,desc,attribute(01佣金,07考核)          
2、lcs_assistant_text_format  LCS助手明细格式元素表 ASSISTANT_NO,FORMAT_NUMBER(order by format_number显示各字段的顺列),ELEMENT_NO(元素号)
3、lcs_assistant_element  LCS助手元素详细表  ELEMENT_NO,DESCRIPTION

查询流程:
1、页面选择下拉框,每项对应一个assitantno,然后点击查询
2、根据assitantno查询出多个子项elementno


二、助手详细数据查询(大表,需要按belong_date分区)
LCS_ASSISTANT_DETAIL LCS助手明细数据表  EMPLOYEE_NO、BELONG_DATE、ASSISTANT_NO、TIMES(显示各行的顺序序)、TEXT、DELETE_FLAG
快速查询:
1、区分度较高的索引:BELONG_DATE, EMPLOYEE_NO, ASSISTANT_NO, EMP_TYPE
2、关联表  select * from lcs_batch_trace a where a.text like 'ELDER_MGR_M%'; 记录每次考核的时间和考核类型。用seq字段关联。
3、表分区

 

分区相关:

数据量:
     --8612682 一年860万数据量
   select count(1) from lcs_assistant_detail a where a.BELONG_DATE  > date'2013-01-01' and a.BELONG_DATE <date '2014-01-01';
  
一般而言,衡量大型表是以数据为标准的,但对于适合分区的大型表,衡量大型表更重要的是对数据访问的性能,如果对于某些表的访问和维护有较严重的性能问题,就可以视为大型表,就应该考虑通过更好的设计和分区来解决性能问题。
创建分区表必须经过如下三个步骤:
1,  创建分区函数
2,  创建映射到分区函数的分区方案
3,  创建使用该分区方案的分区表

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值