本帖最后由 seener_wal 于 2012-02-29 20:05:46 编辑

解决方案 »

  1.   

    select * from aj_jbxx where slsj  >= '201101' and slsj <= '201103'select * from aj_jbxx where slsj between '20120102' and '20120202'上面2条语句中 随便一条语句中的条件加进去就可以
      

  2.   

    <select id="getObjList" resultClass="cases" parameterClass="cases">
     select AJBH,AJMC, SLSJ,dic_trans(AJLB,'类别') AJLB from aj_jbxx
     where 1 = 1   
    <isNotEmpty prepend="AND" property="AJMC">
     AJMC like '%$AJMC$%'
     </isNotEmpty>
     <isNotEmpty prepend="AND" property="AJLB">
     AJLB = #AJLB#
     </isNotEmpty>
     <isNotEmpty prepend="AND" property="slsjFrom">
     slsj>= #slsjFrom#
     </isNotEmpty> 
     <isNotEmpty prepend="AND" property="slsjTo">
     slsj< #slsjTo#
     </isNotEmpty>  
    </select>
    你的参数类cases要声明slsjFrom和slsjTo
    或者用Map来传参数,灵活性强
      

  3.   

     <isNotEmpty prepend="AND" property="slsjTo">
      slsj< #slsjTo#
      </isNotEmpty>   
    => 
     <isNotEmpty prepend="AND" property="slsjTo">
      slsj &lt; #slsjTo#
      </isNotEmpty>  
      

  4.   


    xml里面写不了 <=  转义的话=号要转吗