zoukankan      html  css  js  c++  java
  • 混合调用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。

  • 相关阅读:
    c++笔记3
    c++笔记2
    c++笔记1
    零点追踪(零点及量程补偿)
    优秀软件:
    Hart协议
    RL_RTX函数
    keil-rtx
    电源模块选型
    RTX51 Tiny
  • 原文地址:https://www.cnblogs.com/mobaids/p/10861100.html
Copyright © 2011-2022 走看看