|
|
@@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Param;
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Mapper
|
|
|
public interface PlaceBaseInfoMapper extends BaseMapper<PlaceBaseInfo> {
|
|
|
@@ -34,19 +35,41 @@ public interface PlaceBaseInfoMapper extends BaseMapper<PlaceBaseInfo> {
|
|
|
@Select("select * from (select DATE_FORMAT(hmc.create_date,'%Y-%m-%d') as `label`,SUM(hmc.person) AS `value` from liucheng_smart.xc_monitor hmc where hmc.is_deleted = 0 and hmc.mechanism_type = #{type} group by DATE_FORMAT(hmc.create_date,'%Y-%m-%d')) h where h.label >= #{start} and h.label <= #{end}")
|
|
|
List<EchartsModel> visitsByDay(@Param("start") String start, @Param("end") String end, @Param("type") Integer type);
|
|
|
|
|
|
- @Select("SELECT f.* FROM (SELECT " +
|
|
|
- " sr.id," +
|
|
|
- " sr.name, " +
|
|
|
- " sr.pic AS litpic, " +
|
|
|
- " sr.address, " +
|
|
|
- " sr.phone AS contactNumber, " +
|
|
|
- " SUBSTRING_INDEX(sfv.field_value,',',1) AS lat, " +
|
|
|
- " SUBSTRING_INDEX(sfv.field_value,',',-1) AS lng, " +
|
|
|
- " sr.supplier_type AS categoryId " +
|
|
|
+ @Select("SELECT " +
|
|
|
+ " f.* " +
|
|
|
"FROM " +
|
|
|
- " liucheng_smart.supplier sr " +
|
|
|
- " LEFT JOIN liucheng_smart.sys_field_value sfv ON sfv.bind_id = sr.id AND sfv.type = 2 and sfv.field_type = 8 " +
|
|
|
- "WHERE " +
|
|
|
- " sr.is_deleted = 0 AND sr.app_id IS NULL) f ${ew.customSqlSegment}")
|
|
|
+ " ( " +
|
|
|
+ " SELECT sr.id,sr.`name`,sr.pic AS litpic,sr.address,sr.phone AS contactNumber,SUBSTRING_INDEX( sfv.field_value, ',', 1 ) AS lat,SUBSTRING_INDEX( sfv.field_value, ',',- 1 ) AS lng,sr.supplier_type AS categoryId " +
|
|
|
+ " FROM " +
|
|
|
+ " liucheng_smart.supplier sr " +
|
|
|
+ " LEFT JOIN liucheng_smart.sys_field_value sfv ON sfv.bind_id = sr.id AND sfv.type = 2 AND sfv.field_type = 8 " +
|
|
|
+ " WHERE sr.is_deleted = 0 AND sr.app_id IS NULL UNION ALL " +
|
|
|
+ " SELECT ii.id,ii.`name`,ii.pic AS litpic,ii.address,ii.phone AS contactNumber,SUBSTRING_INDEX( sfv.field_value, ',', 1 ) AS lat,SUBSTRING_INDEX( sfv.field_value, ',',- 1 ) AS lng,ii.type AS categoryId " +
|
|
|
+ " FROM " +
|
|
|
+ " liucheng_smart.industry_institution_manage ii " +
|
|
|
+ " LEFT JOIN liucheng_smart.sys_field_value sfv ON sfv.bind_id = ii.id AND sfv.type = 3 AND sfv.field_type = 8 " +
|
|
|
+ " WHERE " +
|
|
|
+ " ii.org_id NOT IN ( SELECT sr.org_id FROM liucheng_smart.supplier sr WHERE sr.is_deleted = 0 AND sr.org_id IS NOT NULL ) UNION ALL " +
|
|
|
+ " SELECT " +
|
|
|
+ " ct.id,ct.title AS `name`,ct.pic AS litpic,( SELECT sv.field_value FROM liucheng_smart.cms_content_field_value sv WHERE sv.content_id = ct.id AND sv.field_key = 'detailAddress' ) AS address,'' AS contactNumber,SUBSTRING_INDEX( fv.field_value, ',', 1 ) AS lat,SUBSTRING_INDEX( fv.field_value, ',',- 1 ) AS lng,22040713148455 AS categoryId " +
|
|
|
+ " FROM " +
|
|
|
+ " liucheng_smart.cms_content ct " +
|
|
|
+ " LEFT JOIN liucheng_smart.cms_content_field_value fv ON fv.content_id = ct.id AND fv.field_type = 8, " +
|
|
|
+ " liucheng_smart.cms_category cc " +
|
|
|
+ " WHERE " +
|
|
|
+ " cc.id = ct.cid AND ct.is_deleted = 0 AND cc.`code` = 'daoyoudaolan' AND ct.type = 7 " +
|
|
|
+ " ) f ${ew.customSqlSegment}")
|
|
|
List<PlaceBaseInfo> findByMapBounds(@Param("ew") QueryWrapper<PlaceBaseInfo> queryWrapper);
|
|
|
+
|
|
|
+ @Select("SELECT f.label,COUNT(f.id) AS `value` FROM ( " +
|
|
|
+ " SELECT sr.id,sr.supplier_type AS label FROM liucheng_smart.supplier sr " +
|
|
|
+ " WHERE sr.is_deleted = 0 AND sr.app_id IS NULL " +
|
|
|
+ " UNION ALL " +
|
|
|
+ " SELECT ii.id,ii.`type` AS label FROM liucheng_smart.industry_institution_manage ii " +
|
|
|
+ " WHERE ii.is_deleted = 0 AND ii.org_id NOT IN ( SELECT sr.org_id FROM liucheng_smart.supplier sr WHERE sr.is_deleted = 0 AND sr.org_id IS NOT NULL ) " +
|
|
|
+ " UNION ALL " +
|
|
|
+ " SELECT ct.id,22040713148455 as label FROM liucheng_smart.cms_content ct,liucheng_smart.cms_category cc " +
|
|
|
+ " WHERE cc.id = ct.cid AND ct.is_deleted = 0 AND cc.`code` = 'daoyoudaolan' AND ct.type = 7 " +
|
|
|
+ ") f GROUP BY f.label")
|
|
|
+ List<EchartsModel> findByGroupByDataType();
|
|
|
}
|