feat 改更新

This commit is contained in:
lqy 2024-11-24 11:44:12 +08:00
parent 2e2bae3e1f
commit 6256c863f7
3 changed files with 13 additions and 19 deletions

View file

@ -17,6 +17,5 @@ import java.util.Map;
* 注意本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
*/
public interface SchoolDao extends SkyeyeBaseMapper<School> {
int coverBackground(Map<String, Object> params);
}

View file

@ -4,10 +4,13 @@
package com.skyeye.eve.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.skyeye.annotation.service.SkyeyeService;
import com.skyeye.base.business.service.impl.SkyeyeBusinessServiceImpl;
import com.skyeye.common.constans.CommonConstants;
import com.skyeye.common.object.InputObject;
import com.skyeye.common.object.OutputObject;
import com.skyeye.common.util.mybatisplus.MybatisPlusUtil;
import com.skyeye.eve.dao.SchoolDao;
import com.skyeye.eve.entity.School;
import com.skyeye.eve.service.SchoolService;
@ -29,9 +32,6 @@ import java.util.Map;
@SkyeyeService(name = "学校管理", groupName = "学校管理")
public class SchoolServiceImpl extends SkyeyeBusinessServiceImpl<SchoolDao, School> implements SchoolService {
@Autowired
private SchoolDao schoolDao;
/**
* 获取所有学校列表展示为下拉选择框
*
@ -47,8 +47,16 @@ public class SchoolServiceImpl extends SkyeyeBusinessServiceImpl<SchoolDao, Scho
@Override
public void coverBackground(InputObject inputObject, OutputObject outputObject) {
Map<String, Object> params = inputObject.getParams();
schoolDao.coverBackground(params);
Map<String, Object> map = inputObject.getParams();
UpdateWrapper<School> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq(CommonConstants.ID, map.get("id").toString());
updateWrapper.set(MybatisPlusUtil.toColumns(School::getBackground), map.get("background").toString());
updateWrapper.set(MybatisPlusUtil.toColumns(School::getNeLongitude),map.get("neLongitude").toString());
updateWrapper.set(MybatisPlusUtil.toColumns(School::getNeLatitude), map.get("neLatitude").toString());
updateWrapper.set(MybatisPlusUtil.toColumns(School::getSwLongitude), map.get("swLongitude").toString());
updateWrapper.set(MybatisPlusUtil.toColumns(School::getSwLatitude), map.get("swLatitude").toString());
update(updateWrapper);
refreshCache(map.get("id").toString());
}
}

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.skyeye.eve.dao.SchoolDao">
<update id="coverBackground" parameterType="java.util.Map">
UPDATE school_mation as s SET
s.background = #{background},
s.ne_longitude = #{neLongitude},
s.ne_latitude = #{neLatitude},
s.sw_longitude = #{swLongitude},
s.sw_latitude = #{swLatitude}
WHERE s.id = #{id}
</update>
</mapper>