【ssi】增删改查六操作小框架(十)

(六)BLPunishment.xml

<!-- 2012年07月10日 atip-11 复用同一句,只是返回类型不一样 团长 -->
   < sql id ="queryById.selectSql" >
    select p.punishid, p.projectcode, p.dispatchunit,p.dispatchdate,p.penaltynumber,p.unitsprovided,p.creater,p.createdate,p.punishmenttype,p.externalpunishmenttype,p.punishmentsource,p.punishmentsubject,p.regulatorysource,p.regulatorybody,p.regulatoryoccurrencetime,p.supervisionnumber,p.updatedate,p.updater,p.remark,p.flag,p.companyseries,p.auditmain,p.koanumber,p.ishavafile from t_atip_punishment p WHERE p.punishmenttype=#punishmentType# and p.punishId = #punishId#
   </ sql >

  <!-- 2012年07月10日 atip-11 根据punishId查询指定一条数据 团长 -->
   < select id ="innerPunish.queryById" parameterClass ="innerPunishment"   resultClass ="innerPunishment" >
     < include refid ="queryById.selectSql" />
   </ select >

  <!-- 2012年07月09日 atip-11 根据主表主键,检索对应的子表数据 团长 始终 -->
   < select id ="innerPunish.querySubByPunishID" parameterClass ="BLPunishment"   resultClass ="BLPunishmentSub" >
    select sub.PUNISHID,sub.PUNISHMENTID,sub.PUNISHEDUNIT,sub.MAINPROBLEM,sub.INVOLVESAMOUNT,sub.FINEAMOUNT,sub.DISCIPLINE,sub.ORGANIZATIONPROCESSING,sub.ECONOMICSANCTIONS,sub.PUNISHMENTRESULTSNOTE,sub.ONETICKETVOTE,sub.ONETICKETVOTERESON,sub.RESPONSIBILITY,sub.PUNISHEDPEOPLE, sub.POSITION,sub.BEPUNISHEDPEOPLELEVEL from t_atip_punishment_sub sub where sub.punishid = #punishId#
   </ select >

  <!-- 2012年07月09日 atip-11 查询分页数据和数据总数时使用的where子句 团长 始终 -->
   < sql id ="innerPunish.queryPagedList.where" >
     < isNotEmpty property ="dispatchUnit" prepend ="and" >
      t.DISPATCHUNIT like '%$dispatchUnit$%'
     </ isNotEmpty >
     < isNotEmpty property ="dispatchDateStart" prepend ="and" >
      <![CDATA[
        t.dispatchdate > date'$dispatchDateStart$'
      ]]>
     </ isNotEmpty >
     < isNotEmpty property ="dispatchDateEnd" prepend ="and" >
      <![CDATA[    
        t.dispatchdate < date'$dispatchDateEnd$'
      ]] >
     </ isNotEmpty >
     < isNotEmpty property ="penaltyNumber" prepend ="and" >
      t.penaltynumber like '%$penaltyNumber$%'
     </ isNotEmpty >
     < isNotEmpty property ="subParam" prepend ="and" >
      t.punishid in (select distinct ts.punishid from t_atip_punishment_sub ts where 1=1
       < isNotEmpty property ="subParam.punishedUnit" prepend ="and" >
        ts.punishedunit like '%$subParam.punishedUnit$%'
       </ isNotEmpty >
       < isNotEmpty property ="subParam.punishedPeople" prepend ="and" >
        ts.punishedpeople like '%$subParam.punishedPeople$%'
       </ isNotEmpty >
       < isNotEmpty property ="subParam.discipline" prepend ="and" >
        ts.discipline =#subParam.discipline#
       </ isNotEmpty >
       < isNotEmpty property ="subParam.organizationProcessing"
         prepend ="and" >
    ts.organizationprocessing=#subParam.organizationProcessing#
       </ isNotEmpty >
       < isNotEmpty property ="subParam.economicSanctions" prepend ="and" >
        ts.economicsanctions =#subParam.economicSanctions#
       </ isNotEmpty >
      )
     </ isNotEmpty >
   </ sql >
  <!-- 2012年07月09日 atip-11 查询分页数据 团长 始终 -->
   < sql id ="innerPunish.queryPagedList" >
    select t.punishid, t.dispatchUnit, t.dispatchdate,t.penaltynumber from t_atip_punishment t where t.punishmenttype ='01'
     < include refid ="innerPunish.queryPagedList.where" />
   </ sql >

  <!-- 2012年07月09日 atip-11 查询数据总数 团长 始终 -->
   < select id ="innerPunish.queryTotalCount" parameterClass ="innerPunishment"
     resultClass ="java.lang.Integer" >
    select count(0) from t_atip_punishment t where t.punishmenttype ='01'
     < include refid ="innerPunish.queryPagedList.where" />
     </ select >

(七)Struts_admin.xml

  <!-- 2012年07月09日 atip-11 内部处罚管理action 团长 -->
   < action name ="innerPunish_*" method ="{1}" class ="innerPunishmentAction" >
       < result name ="success" type ="json" />
   </ action >

你可能感兴趣的:(spring,crud,struts2.0)