xuekang
2024-05-13 15a0280ae9e7db96fdf0744c722d214d2cb5a0e5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package com.nuvole.four.mapper;
 
import com.nuvole.four.domain.StoreIndustryManage;
import com.nuvole.four.domain.query.StoreIndustryManageQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
import java.util.List;
import java.util.Map;
 
/**
 * @Description 行业管理Mapper
 * @Author dqh
 * @Date 2024-04-12 17:41:29
 */
@Mapper
public interface StoreIndustryManageMapper {
    int deleteByPrimaryKey(Long id);
 
    int insert(StoreIndustryManage record);
 
    int insertSelective(StoreIndustryManage record);
 
    StoreIndustryManage selectByPrimaryKey(Long id);
 
    int updateByPrimaryKeySelective(StoreIndustryManage record);
 
    int updateByPrimaryKey(StoreIndustryManage record);
 
    /**
     * 查询列表
     *
     * @param query
     * @return 查询结果
     */
    List<StoreIndustryManage> selectList(StoreIndustryManageQuery query);
 
    /**
     * 方法描述: 查询max(sortNo)的序号信息
     * 返回 = max(sortNo) + 10
     *
     * @date  2024-04-12 18:17
     **/
    @Select("select (max(sort_no) + 10) sortNo from store_industry_manage")
    Integer getSort();
 
    /**
     * 方法描述:根据ID查询对应层级level;并自动+1得出下级level
     *
     * @date  2024-04-12 18:40
     **/
    @Select("select (`level` + 1) from store_industry_manage where id = #{id} ")
    Integer getLevel(Long id);
 
    /**
     * 方法描述:查询列表默认方法
     **/
    List<StoreIndustryManage> selectAll(Map map);
 
    /**
     * 方法描述:查询当前节点是否包含子节点
     *
     **/
    @Select("select count(1) from store_industry_manage where p_id = #{id} and deleted=0")
    int selectByPid(Long id);
 
    /**
     * 方法描述: 查询同级最大的code
     *
     * @date  2024-04-13 21:51
     **/
    @Select("select max(industry_code) from store_industry_manage where p_id = #{pid} and industry_code = #{industryCode}")
    String getMaxCode(@Param("pid") Long pid, @Param("industryCode") String industryCode);
}