混合調用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