今天遇到一個問題,半天沒看出來問題,特意記錄一下
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>