混合调用tk.mybatis.mapper 与 自编xml文件 的配置


本项目采用的是 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。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM