日期:2014-05-16 浏览次数:20823 次
<!-- <table tableName="BROWSELOGS" enableMysqlPagination="true"> <table tableName="BROWSELOGS" enableOraclePagination="false" > --> <table tableName="BROWSELOGS"> <columnOverride column="ID" javaType="Integer" /> <columnOverride column="VISITOR" javaType="Integer" /> <columnOverride column="DOTIME" jdbcType="Timestamp" /> </table>
<classPathEntry location="D:\UserLibraries\Oracle10g_driver.jar" /> <ibatorContext id="context" targetRuntime="Ibatis2Java5" >
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE ibatorConfiguration PUBLIC "-//Apache Software Foundation//DTD Apache iBATIS Ibator Configuration 1.0//EN" "http://ibatis.apache.org/dtd/ibator-config_1_0.dtd" > <ibatorConfiguration> <classPathEntry location="D:\UserLibraries\mysql-connector-java-5.1.12-bin.jar" /> <ibatorContext id="context1" targetRuntime="Ibatis2Java5"> <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/demo" userId="root" password="aaa" /> <javaModelGenerator targetPackage="com.ibatis.pojo" targetProject="test" /> <sqlMapGenerator targetPackage="com.ibatis.sqlmap" targetProject="test" /> <daoGenerator targetPackage="com.ibatis.dao" targetProject="test" type="SPRING" /> <table tableName="ueye_account" enableMysqlPagination="true"> <columnOverride column="ID" javaType="Integer" /> <columnOverride column="VISITOR" javaType="Integer" /> <columnOverride column="DOTIME" jdbcType="Timestamp" /> </table> </ibatorContext> </ibatorConfiguration>
protected List criteriaWithoutValue; protected List criteriaWithSingleValue; protected List criteriaWithListValue; protected List criteriaWithBetweenValue;
// //过滤条件,仿造的是example类中的情况 // Criteria criteria=example.createCriteria(); // //得到example里面的list // List<Object> listSingle=criteria.getCriteriaWithSingleValue(); // //再把它注入回去 // criteria.setCriteriaWithSingleValue(this.processFilterInfo(listSingle, sigma.getFilterInfo())); processFilterInfo方法: public List<Object> processFilterInfo(List<Object> listSingle,List<FilterInfo> filterInfos){ for (int i = 0; i < filterInfos.size(); i++) { String columnId=filterInfos.get(i).getColumnId(); String logic=filterInfos.get(i).getLogic(); String value=filterInfos.get(i).getValue(); if(logic.equalsIgnoreCase("equal")){ Map<String,Object> map = new HashMap<String,Object>(); map.put("condition", columnId+" ="); map.put("value", value); listSingle.add(map); }else if(logic.equalsIgnoreCase("notequal")){ Map<String,Object> map = new HashMap<String,Object>(); map.put("condition", columnId+" <>"); map.put("value", value); listSingle.add(map);
org.apache.ibatis.ibator.generator.ibatis2.sqlmap---