mybatis 中between and用法


今天遇到一個問題,半天沒看出來問題,特意記錄一下

Dao

ConfigEvaluation findConfigEvaluationByEvalpecent(BigDecimal evalPercent);

Mapper.xml

<select id="findConfigEvaluationByEvalpecent"  resultType="com.pacific.rspBonus.model.po.twBonus.mbg.ConfigEvaluation" parameterType="java.math.BigDecimal">
select * from Config_Evaluation
where #{evalPercent} between evalStart and evalEnd
</select>

Service
ConfigEvaluation configEvaluationByEvalpecent = configEvaluationMapperQuery.findConfigEvaluationByEvalpecent(new BigDecimal(8888));

我之前錯把sql寫成如下,導致半天沒找到原因。所以以后遇到問題還是得仔細排查。
<select id="findConfigEvaluationByEvalpecent"  resultType="com.pacific.rspBonus.model.po.twBonus.mbg.ConfigEvaluation" parameterType="java.math.BigDecimal">
select * from Config_Evaluation
where evalPercent=#{evalPercent} between evalStart and evalEnd
</select>
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM