mybatis 中 映射文件 不写 resultType和parameterType,直接在 dao层 方法中写上参数和返回值 就可以?
这个dao层,publicinterfaceBankInfoMapper{intgetBankInfobByFuzzyQueryCount(BankInfobankInf...
这个dao层,
public interface BankInfoMapper {
int getBankInfobByFuzzyQueryCount(BankInfo bankInfo);
}
对应的mapper.xml
<select id="getBankInfobByFuzzyQueryCount">
select count(*) from QYPT_BANK_INFO b where b.bank_code like '%${bankCode}%' and b.bank_name like '%${bankName}%'
</select>
public class BankInfo {
private String bankCode;
private String bankName;
//对应的setter,getter方法
} 展开
public interface BankInfoMapper {
int getBankInfobByFuzzyQueryCount(BankInfo bankInfo);
}
对应的mapper.xml
<select id="getBankInfobByFuzzyQueryCount">
select count(*) from QYPT_BANK_INFO b where b.bank_code like '%${bankCode}%' and b.bank_name like '%${bankName}%'
</select>
public class BankInfo {
private String bankCode;
private String bankName;
//对应的setter,getter方法
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询