本项目采用的是 Spring+Mybatis 的架构。

1. 在项目中引入如下jar.

  mybatis.jar     mapper-4.1.2.jar

2. 在写 Dao 类时需要添加 如下注解。

import com.i7colors.bean.customer.CustomerBill;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 客户账户信息DAO
 * @author 
 *
 */
@Mapper
@Component
public interface CustomerBillDao extends tk.mybatis.mapper.common.Mapper<CustomerBill>, tk.mybatis.mapper.common.MySqlMapper<CustomerBill> {

    List<CustomerBill> queryList(@Param("customerBill") CustomerBill customerBill, @Param("pageNo") Integer pageNo, @Param("pageSize") Integer pageSize);

    int count(CustomerBill customerBill);
}

  

3. 编写xml 后注意在 mybatis 的配置文件中引入此xml。

 

posted on 2019-05-14 11:03  waytods  阅读(2243)  评论(0编辑  收藏  举报