This commit is contained in:
linfso 2024-12-20 11:18:04 +08:00
parent 59bbe6c66d
commit 940035cad3
2 changed files with 9 additions and 1 deletions

View File

@ -137,6 +137,11 @@ public class EmisExchangeRateController extends BaseController
@PutMapping
public AjaxResult edit(@RequestBody EmisExchangeRate emisExchangeRate)
{
int cnt=emisExchangeRateService.checkUnique(emisExchangeRate);
if(cnt>0){
return AjaxResult.error("配置重复,请检查时间范围");
}
return toAjax(emisExchangeRateService.updateEmisExchangeRate(emisExchangeRate));
}

View File

@ -43,7 +43,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkUnique" parameterType="EmisExchangeRate" resultType="int">
select count(1) from emis_exchange_rate
where del_flag='0'
where
del_flag='0'
<if test="id != null "> and id != #{id}</if>
and currency = #{currency}
and dest_currency = #{destCurrency}
and (
@ -51,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
or
(start_date <![CDATA[ <= ]]> #{endDate} and #{endDate} <![CDATA[ <= ]]> end_date )
)
limit 1
</select>