| | |
| | | entity.setUpdateUser(ue.getId()); |
| | | } |
| | | |
| | | int count = argsService.update(entity); |
| | | ArgsEntity ae = argsService.selectById(entity.getId()); |
| | | if (entity.getCvalue() > ae.getMaxValue() || entity.getCvalue() < ae.getMinValue()) { |
| | | return fail("待更新的值不在有效范围内", -1); |
| | | } |
| | | |
| | | int count = argsService.updateForValue(entity); |
| | | |
| | | return success(count); |
| | | } catch (Exception ex) { |
| | |
| | | public Integer update(ArgsEntity entity); |
| | | |
| | | /** |
| | | * 更新数值 |
| | | * |
| | | * @param entity |
| | | * @return |
| | | */ |
| | | public Integer updateForValue(ArgsEntity entity); |
| | | |
| | | /** |
| | | * 更新多条 |
| | | * |
| | | * @param list |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer updateForValue(ArgsEntity entity) { |
| | | return argsMapper.updateForValue(entity); |
| | | } |
| | | |
| | | @Override |
| | | public Integer updates(List<ArgsEntity> list) { |
| | | return argsMapper.updates(list); |
| | | } |
| | |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updateForValue"> |
| | | update lf.sys_args |
| | | set cvalue=#{cvalue},update_user=#{updateUser},update_time=now() |
| | | where id=#{id} |
| | | </update> |
| | | |
| | | <update id="updates"> |
| | | <foreach collection="list" item="item" index="index" separator=";"> |
| | | update lf.sys_args |