|
@@ -156,10 +156,14 @@ public interface CompanyMapper
|
|
|
|
|
|
|
|
@Select({"<script> " +
|
|
@Select({"<script> " +
|
|
|
"select c.*,cu.user_name,qu.used_num," +
|
|
"select c.*,cu.user_name,qu.used_num," +
|
|
|
|
|
+ "MAX(CASE WHEN cm.type = 0 THEN sc.`name` END) AS masterAppName,"+
|
|
|
|
|
+ "MAX(CASE WHEN cm.type = 1 THEN sc.`name` END) AS backupAppName,"+
|
|
|
"CASE WHEN JSON_VALID(t1.config_value) THEN t1.config_value->>'$.mchId' ELSE NULL END as mchId" +
|
|
"CASE WHEN JSON_VALID(t1.config_value) THEN t1.config_value->>'$.mchId' ELSE NULL END as mchId" +
|
|
|
" FROM company c LEFT JOIN company_user cu ON c.user_id =cu.user_id " +
|
|
" FROM company c LEFT JOIN company_user cu ON c.user_id =cu.user_id " +
|
|
|
" left join company_config t1 on t1.config_key = 'redPacket:config' and t1.company_id = c.company_id " +
|
|
" left join company_config t1 on t1.config_key = 'redPacket:config' and t1.company_id = c.company_id " +
|
|
|
"LEFT JOIN (select company_id, count(id) as used_num from qw_user where server_id is not null and server_status = 1 group by company_id) qu ON qu.company_id = c.company_id " +
|
|
"LEFT JOIN (select company_id, count(id) as used_num from qw_user where server_id is not null and server_status = 1 group by company_id) qu ON qu.company_id = c.company_id " +
|
|
|
|
|
+ "LEFT JOIN company_miniapp cm ON c.company_id = cm.company_id\n" +
|
|
|
|
|
+ "LEFT JOIN fs_course_play_source_config sc ON sc.appid = cm.app_id "+
|
|
|
"where c.is_del=0 " +
|
|
"where c.is_del=0 " +
|
|
|
" <if test=\"companyName != null and companyName != ''\"> and c.company_name like concat('%', #{companyName}, '%')</if>\n" +
|
|
" <if test=\"companyName != null and companyName != ''\"> and c.company_name like concat('%', #{companyName}, '%')</if>\n" +
|
|
|
" <if test=\"companyMobile != null and companyMobile != ''\"> and c.company_mobile = #{companyMobile}</if>\n" +
|
|
" <if test=\"companyMobile != null and companyMobile != ''\"> and c.company_mobile = #{companyMobile}</if>\n" +
|
|
@@ -174,7 +178,15 @@ public interface CompanyMapper
|
|
|
" <if test=\"limitUserCount != null \"> and c.limit_user_count = #{limitUserCount}</if>\n" +
|
|
" <if test=\"limitUserCount != null \"> and c.limit_user_count = #{limitUserCount}</if>\n" +
|
|
|
" <if test=\"isDel != null \"> and c.is_del = #{isDel}</if>\n" +
|
|
" <if test=\"isDel != null \"> and c.is_del = #{isDel}</if>\n" +
|
|
|
" <if test=\"deptId != null \"> and c.dept_id = #{deptId}</if> " +
|
|
" <if test=\"deptId != null \"> and c.dept_id = #{deptId}</if> " +
|
|
|
- " " +
|
|
|
|
|
|
|
+ " <if test=\"queryAppName != null and queryAppName != ''\">\n" +
|
|
|
|
|
+ " AND EXISTS (\n" +
|
|
|
|
|
+ " SELECT 1 FROM company_miniapp cm2\n" +
|
|
|
|
|
+ " LEFT JOIN fs_course_play_source_config sc2 ON sc2.appid = cm2.app_id\n" +
|
|
|
|
|
+ " WHERE cm2.company_id = c.company_id\n" +
|
|
|
|
|
+ " AND sc2.`name` LIKE CONCAT('%', #{queryAppName}, '%')\n" +
|
|
|
|
|
+ " )\n" +
|
|
|
|
|
+ " </if> "+
|
|
|
|
|
+ " GROUP BY c.company_id " +
|
|
|
" order by company_id desc" +
|
|
" order by company_id desc" +
|
|
|
"</script>"})
|
|
"</script>"})
|
|
|
List<CompanyVO> selectCompanyListVO(Company param);
|
|
List<CompanyVO> selectCompanyListVO(Company param);
|