Nav修改

This commit is contained in:
Zhang Liguo 2023-12-26 18:15:04 +08:00
parent ac6e84bb06
commit 5fdda5bdb6
5 changed files with 9 additions and 6 deletions

View File

@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
@RestController @RestController
public class NavController { public class NavController {
@ -36,7 +37,7 @@ public class NavController {
} }
@RequestMapping("/selectAllNav") @RequestMapping("/selectAllNav")
public HashMap<Integer, Object> selectAllNav(){ public List<Nav> selectAllNav(){
return navService.selectAllNav(); return navService.selectAllNav();
} }

View File

@ -24,6 +24,6 @@ public interface NavDao {
int updateByPrimaryKey(Nav record); int updateByPrimaryKey(Nav record);
Nav selectAlreadyExist(Nav nav); Nav selectAlreadyExist(Nav nav);
@MapKey("id")
HashMap<Integer,Object> selectAllNav(); List<Nav> selectAllNav();
} }

View File

@ -3,6 +3,7 @@ package com.lovenav.service;
import com.lovenav.entity.Nav; import com.lovenav.entity.Nav;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
public interface NavService { public interface NavService {
public String deleteNav(Nav nav); public String deleteNav(Nav nav);
@ -10,5 +11,5 @@ public interface NavService {
public String selectNav(Nav nav); public String selectNav(Nav nav);
public String addNav(Nav nav); public String addNav(Nav nav);
HashMap<Integer,Object> selectAllNav(); List<Nav> selectAllNav();
} }

View File

@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
@Service @Service
public class NavServiceImpl implements NavService { public class NavServiceImpl implements NavService {
@ -62,7 +63,7 @@ public class NavServiceImpl implements NavService {
} }
@Override @Override
public HashMap<Integer,Object> selectAllNav() { public List<Nav> selectAllNav() {
return navDao.selectAllNav(); return navDao.selectAllNav();
} }
} }

View File

@ -22,7 +22,7 @@
from ln_nav from ln_nav
where nav_name = #{navName,jdbcType=VARCHAR} where nav_name = #{navName,jdbcType=VARCHAR}
</select> </select>
<select id="selectAllNav" resultMap="BaseResultMap"> <select id="selectAllNav" resultType="com.lovenav.entity.Nav" resultMap="BaseResultMap">
select * from ln_nav; select * from ln_nav;
</select> </select>
<delete id="deleteByNavName" parameterType="java.lang.String"> <delete id="deleteByNavName" parameterType="java.lang.String">