Mybatis传值语法

来源:互联网 发布:梦三国2网络延迟 编辑:程序博客网 时间:2024/05/16 04:46


传一个参数简单:



@Select("SELECT * FROM loan_investor,loan WHERE loan_investor.investorUserId=#{investorUserId}"
+ " AND loan_investor.loanId=loan.loanId AND loan.status >=500 AND loan.status <700;")
public List<LoanInvestor> getRepayingLoanInvestorByUserId(
Integer investorUserId);



传多个参数时要使用@Param定义:


@Select("SELECT * FROM loan_investor WHERE  leftTermCount > 0 AND status =200  LIMIT #{offset}, #{pagesize} ")


public List<LoanInvestor> getAllSellingCreditRightsListByPage(


@Param("offset") int offset, @Param("pagesize") int pageSize);
0 0