|
|
@@ -15,7 +15,7 @@ public interface MenuMapper {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- @Select("select * from t_menu where parent_id is null")
|
|
|
+ @Select("select * from t_menu where parent_id is null order by sort_value")
|
|
|
List<Menu> selectAllParentMenu();
|
|
|
|
|
|
/**
|
|
|
@@ -28,6 +28,7 @@ public interface MenuMapper {
|
|
|
"<when test='name!=null'>",
|
|
|
"where name like #{name,jdbcType=VARCHAR}",
|
|
|
"</when>",
|
|
|
+ " order by sort_value",
|
|
|
"</script>"})
|
|
|
List<Menu> selectAllMenu(@Param("name") String name);
|
|
|
|
|
|
@@ -52,6 +53,7 @@ public interface MenuMapper {
|
|
|
"<foreach item='item' index='index' collection='ids' open='(' separator=',' close=')'>" +
|
|
|
"#{item}" +
|
|
|
"</foreach>" +
|
|
|
+ " order by sort_value"+
|
|
|
"</script>"})
|
|
|
List<Menu> selectByIds(@Param("ids") List<Long> ids);
|
|
|
|
|
|
@@ -61,8 +63,8 @@ public interface MenuMapper {
|
|
|
* @param menu
|
|
|
* @return
|
|
|
*/
|
|
|
- @Insert("INSERT INTO t_menu(name,parent_id,class_code,menu_url,create_time,create_id) values(#{name,jdbcType=VARCHAR},#{parentId,jdbcType=BIGINT}," +
|
|
|
- "#{classCode,jdbcType=VARCHAR},#{menuUrl,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{createId,jdbcType=BIGINT})")
|
|
|
+ @Insert("INSERT INTO t_menu(name,parent_id,class_code,menu_url,sort_value,create_time,create_id) values(#{name,jdbcType=VARCHAR},#{parentId,jdbcType=BIGINT}," +
|
|
|
+ "#{classCode,jdbcType=VARCHAR},#{menuUrl,jdbcType=VARCHAR},#{sortValue,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{createId,jdbcType=BIGINT})")
|
|
|
int insertMenu(Menu menu);
|
|
|
|
|
|
/**
|
|
|
@@ -98,6 +100,9 @@ public interface MenuMapper {
|
|
|
"<when test='menuUrl!=null'>",
|
|
|
",menu_url =#{menuUrl,jdbcType=VARCHAR}",
|
|
|
"</when>",
|
|
|
+ "<when test='sortValue!=null'>",
|
|
|
+ ",sort_value =#{sortValue,jdbcType=INTEGER}",
|
|
|
+ "</when>",
|
|
|
"</trim>",
|
|
|
"</script>"})
|
|
|
int updateMenu(Menu menu);
|