MyBatis3一个查询DAO的实现

/**
 * 订单查询(用于订单列表展示用)
 */
public List queryOrd(String ordno, String custno, int startRow, int rowSize, Ord.St... stArr) {
    Map map = params4queryOrd(ordno, custno, stArr);
    return getSqlSession().selectList(sqlmapNamespace + "." + "queryOrd", map, new RowBounds(startRow, rowSize));
}
public int countOrd(String ordno, String custno, Ord.St... stArr) {
    Map map = params4queryOrd(ordno, custno, stArr);
    return getSqlSession().selectOne(sqlmapNamespace + "." + "countOrd", map);
}
private Map params4queryOrd(String ordno, String custno, Ord.St... stArr) {
    Map map = new HashMap<>(3);
    if (ordno != null) map.put("ordno", ordno);
    if (custno != null) map.put("custno", custno);
    if (stArr != null && stArr.length > 0) {
        int[] arr = new int[stArr.length];
        for (int i = 0; i < stArr.length; i++) {
            arr[i] = stArr[i].key;
        }
        map.put("stArr", arr);
    }
    return map;
}

    select * from ord
    


    select count(1) from ord
    


    
        and ordno=#{ordno}
        and custno=#{custno}
        
            state in
            
                #{st}