添加查询公司类型列表 接口
This commit is contained in:
@@ -21,4 +21,12 @@ public interface CompanyMapper extends CommonMapper<Company> {
|
||||
*/
|
||||
@Select("SELECT * FROM bg_company WHERE status = 0 LIMIT #{limit} FOR UPDATE")
|
||||
List<Company> selectForUpdate(@Param("limit") int limit);
|
||||
|
||||
/**
|
||||
* 查询已完善公司(status=1)去重后的公司类型
|
||||
* <p>依赖复合索引 idx_status_type(status, company_type) 走松散索引扫描 + 覆盖索引,不回表</p>
|
||||
* <p>NULL/空值的清洗交由 Service 层处理,SQL 只做分组去重</p>
|
||||
*/
|
||||
@Select("SELECT company_type FROM bg_company WHERE status = 1 GROUP BY company_type")
|
||||
List<String> selectDistinctCompanyTypes();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user