会销组+会销
This commit is contained in:
@@ -12,10 +12,7 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -52,6 +49,15 @@ public class EnterpriseUserDAO {
|
||||
return feishuUserIdsByUserIds.stream().collect(Collectors.toMap(EnterpriseUserDO::getUserId, EnterpriseUserDO::getFeishuUserId));
|
||||
}
|
||||
|
||||
public List<String> getFeishuUserIdListByUserIds(List<String> userIdList){
|
||||
if(CollectionUtils.isEmpty(userIdList)){
|
||||
return new ArrayList<>(0);
|
||||
}
|
||||
List<EnterpriseUserDO> feishuUserIdsByUserIds = enterpriseUserMapper.getFeishuUserIdsByUserIds(userIdList);
|
||||
return feishuUserIdsByUserIds.stream().map(EnterpriseUserDO::getFeishuUserId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
public void batchInsertOrUpdate(List<EnterpriseUserDO> insertOrUpdateList) {
|
||||
if(CollectionUtils.isEmpty(insertOrUpdateList)){
|
||||
return;
|
||||
|
||||
@@ -1,10 +1,21 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.exhibition.ExhibitionDTO;
|
||||
import com.cool.store.dto.exhibition.ExhibitionStatisticsDTO;
|
||||
import com.cool.store.entity.HyExhibitionDO;
|
||||
import com.cool.store.mapper.HyExhibitionMapper;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -30,7 +41,7 @@ public class HyExhibitionDAO {
|
||||
*/
|
||||
public HyExhibitionDO selectByPrimaryKey(Integer id){
|
||||
if (id == null){
|
||||
return new HyExhibitionDO();
|
||||
return null;
|
||||
}
|
||||
return hyExhibitionMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
@@ -58,4 +69,43 @@ public class HyExhibitionDAO {
|
||||
}
|
||||
return hyExhibitionMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public int batchInsert(List<HyExhibitionDO> records){
|
||||
if (CollectionUtils.isEmpty(records)){
|
||||
return -1;
|
||||
}
|
||||
return hyExhibitionMapper.batchInsert(records);
|
||||
}
|
||||
|
||||
public int batchUpdate(List<HyExhibitionDO> records){
|
||||
if (CollectionUtils.isEmpty(records)){
|
||||
return -1;
|
||||
}
|
||||
return hyExhibitionMapper.batchUpdate(records);
|
||||
}
|
||||
|
||||
|
||||
public List<HyExhibitionDO> getExhibitionListByUserId(String userId, String startDate, Integer closedType){
|
||||
if (StringUtil.isEmpty(userId)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return hyExhibitionMapper.getExhibitionListByUserId(userId,startDate,closedType);
|
||||
}
|
||||
|
||||
|
||||
public Map<String,ExhibitionStatisticsDTO> exhibitionStatisticsMap(List<String> list) {
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return new HashMap<>(4);
|
||||
}
|
||||
List<ExhibitionStatisticsDTO> result = hyExhibitionMapper.exhibitionStatistic(list);
|
||||
return result.stream().collect(Collectors.toMap(ExhibitionStatisticsDTO::getExhibitionCode, date -> date));
|
||||
}
|
||||
|
||||
public List<ExhibitionDTO> listByExhibitionGroupIds(List<Integer> exhibitionGroupIdList){
|
||||
if (CollectionUtils.isEmpty(exhibitionGroupIdList)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return hyExhibitionMapper.listByExhibitionGroupIds(exhibitionGroupIdList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.exhibition.MyExhibitionGroupDTO;
|
||||
import com.cool.store.entity.HyExhibitionGroupDO;
|
||||
import com.cool.store.mapper.HyExhibitionGroupMapper;
|
||||
import com.cool.store.utils.StringUtil;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -18,7 +22,7 @@ public class HyExhibitionGroupDAO {
|
||||
HyExhibitionGroupMapper hyExhibitionGroupMapper;
|
||||
|
||||
public int insertSelective(HyExhibitionGroupDO record){
|
||||
if (record.getId() == null){
|
||||
if (record == null){
|
||||
return -1;
|
||||
}
|
||||
return hyExhibitionGroupMapper.insertSelective(record);
|
||||
@@ -31,7 +35,7 @@ public class HyExhibitionGroupDAO {
|
||||
*/
|
||||
public HyExhibitionGroupDO selectByPrimaryKey(Integer id){
|
||||
if (id == null){
|
||||
return new HyExhibitionGroupDO();
|
||||
return null;
|
||||
}
|
||||
return hyExhibitionGroupMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
@@ -59,4 +63,13 @@ public class HyExhibitionGroupDAO {
|
||||
}
|
||||
return hyExhibitionGroupMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public List<MyExhibitionGroupDTO> listByCreator(String userId){
|
||||
if (StringUtil.isEmpty(userId)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return hyExhibitionGroupMapper.listByCreator(userId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.cool.store.dao;
|
||||
|
||||
import com.cool.store.dto.exhibition.ExhibitionLineDTO;
|
||||
import com.cool.store.entity.HyPartnerExhibitionDO;
|
||||
import com.cool.store.mapper.HyPartnerExhibitionMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -58,4 +61,11 @@ public class HyPartnerExhibitionDAO {
|
||||
}
|
||||
return hyPartnerExhibitionMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
public List<ExhibitionLineDTO> getExhibitionLine(String exhibitionCode){
|
||||
if (exhibitionCode == null){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return hyPartnerExhibitionMapper.getExhibitionLine(exhibitionCode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.exhibition.MyExhibitionGroupDTO;
|
||||
import com.cool.store.entity.HyExhibitionGroupDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-11-30 11:55
|
||||
@@ -37,4 +40,6 @@ public interface HyExhibitionGroupMapper {
|
||||
* dateTime:2023-11-30 01:36
|
||||
*/
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
List<MyExhibitionGroupDTO> listByCreator(String userId);
|
||||
}
|
||||
@@ -1,9 +1,14 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.exhibition.ExhibitionDTO;
|
||||
import com.cool.store.dto.exhibition.ExhibitionStatisticsDTO;
|
||||
import com.cool.store.entity.HyExhibitionDO;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import tk.mybatis.mapper.common.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-11-30 11:47
|
||||
@@ -37,4 +42,17 @@ public interface HyExhibitionMapper {
|
||||
* dateTime:2023-11-30 01:38
|
||||
*/
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int batchInsert(@Param("records") List<HyExhibitionDO> records);
|
||||
|
||||
int batchUpdate(@Param("records") List<HyExhibitionDO> records);
|
||||
|
||||
List<HyExhibitionDO> getExhibitionListByUserId(@Param("userId") String userId,
|
||||
@Param("startDate") String startDate,
|
||||
@Param("closedType") Integer closedType);
|
||||
|
||||
|
||||
List<ExhibitionStatisticsDTO> exhibitionStatistic(@Param("list") List<String> exhibitionCodeList);
|
||||
|
||||
List<ExhibitionDTO> listByExhibitionGroupIds(@Param("list") List<Integer> exhibitionGroupIdList);
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.cool.store.mapper;
|
||||
|
||||
import com.cool.store.dto.exhibition.ExhibitionLineDTO;
|
||||
import com.cool.store.entity.HyPartnerExhibitionDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @date 2023-11-30 11:55
|
||||
@@ -37,4 +40,12 @@ public interface HyPartnerExhibitionMapper {
|
||||
* dateTime:2023-11-30 01:39
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 展会参与线索信息
|
||||
* @param exhibitionCode
|
||||
* @return
|
||||
*/
|
||||
List<ExhibitionLineDTO> getExhibitionLine(String exhibitionCode);
|
||||
}
|
||||
@@ -20,15 +20,33 @@
|
||||
<include refid="Base_Column_List" />
|
||||
from hy_exhibition_group
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
and deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="listByCreator" resultType="com.cool.store.dto.exhibition.MyExhibitionGroupDTO">
|
||||
select
|
||||
eg.id as id ,
|
||||
eg.exhibition_group_name as exhibitionGroupName,
|
||||
eg.closed as closed,
|
||||
eg.creator as createId,
|
||||
eu.name as createName,
|
||||
eu.mobile as mobile
|
||||
from hy_exhibition_group eg
|
||||
left join enterprise_user eu on eg.creator = eu.user_id
|
||||
where eg.deleted = 0
|
||||
<if test="userId!=null and userId!=''">
|
||||
and eg.creator = #{userId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
order by eg.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from hy_exhibition_group
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insertSelective" parameterType="com.cool.store.entity.HyExhibitionGroupDO">
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
<insert id="insertSelective" parameterType="com.cool.store.entity.HyExhibitionGroupDO" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
|
||||
insert into hy_exhibition_group
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="exhibitionGroupName != null">
|
||||
|
||||
@@ -125,6 +125,34 @@
|
||||
#{collaborators,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="batchInsert" keyColumn="id" keyProperty="records.id" useGeneratedKeys="true">
|
||||
insert into hy_exhibition
|
||||
(
|
||||
exhibition_group_id,
|
||||
exhibition_code,
|
||||
exhibition_name,
|
||||
start_date,
|
||||
location,
|
||||
collaborators,
|
||||
creator
|
||||
)
|
||||
values
|
||||
<foreach collection="records" item="record" separator=",">
|
||||
(
|
||||
#{record.exhibitionGroupId},
|
||||
#{record.exhibitionCode},
|
||||
#{record.exhibitionName},
|
||||
#{record.startDate},
|
||||
#{record.location},
|
||||
#{record.collaborators},
|
||||
#{record.creator}
|
||||
)
|
||||
</foreach>
|
||||
|
||||
|
||||
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.cool.store.entity.HyExhibitionDO">
|
||||
update hy_exhibition
|
||||
@@ -171,6 +199,102 @@
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="batchUpdate">
|
||||
update hy_exhibition
|
||||
set
|
||||
exhibition_name = CASE id
|
||||
<foreach collection="records" item="record">
|
||||
WHEN #{record.id} THEN #{record.exhibitionName}
|
||||
</foreach>
|
||||
END,
|
||||
location = CASE id
|
||||
<foreach collection="records" item="record">
|
||||
WHEN #{record.id} THEN #{record.location}
|
||||
</foreach>
|
||||
END,
|
||||
updater = CASE id
|
||||
<foreach collection="records" item="record">
|
||||
WHEN #{record.id} THEN #{record.updater}
|
||||
</foreach>
|
||||
END,
|
||||
collaborators = CASE id
|
||||
<foreach collection="records" item="record">
|
||||
WHEN #{record.id} THEN #{record.collaborators}
|
||||
</foreach>
|
||||
END
|
||||
where id in
|
||||
<foreach collection="records" item="record" open="(" separator="," close=")">
|
||||
#{record.id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
<select id="getExhibitionListByUserId" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
,
|
||||
TIMESTAMPDIFF(second,now(),start_date) AS tst
|
||||
from hy_exhibition
|
||||
<where>
|
||||
<if test="startDate != null and startDate!='' ">
|
||||
and start_date = #{startDate}
|
||||
</if>
|
||||
<if test="closedType != null and closedType==0 ">
|
||||
and closed_type = #{closedType}
|
||||
</if>
|
||||
<if test="closedType != null and closedType==1 ">
|
||||
and closed_type in (1,2)
|
||||
</if>
|
||||
<if test="userId != null and userId!='' ">
|
||||
and (creator = #{userId} or collaborators like CONCAT('%,', #{userId} ,',%'))
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
if(tst >= 0, 0, 1),
|
||||
if(tst <![CDATA[ < ]]> 0, abs(tst), tst ),id desc
|
||||
</select>
|
||||
|
||||
<select id="listByExhibitionGroupIds" resultType="com.cool.store.dto.exhibition.ExhibitionDTO">
|
||||
select
|
||||
id as id ,
|
||||
exhibition_group_id as exhibitionGroupId,
|
||||
start_date as startDate,
|
||||
close_time as closeTime,
|
||||
location as location,
|
||||
exhibition_name as exhibitionName,
|
||||
collaborators as collaboratorStr
|
||||
from hy_exhibition
|
||||
<where>
|
||||
<foreach collection="list" item="groupId" open="and exhibition_group_id in (" separator="," close=")">
|
||||
#{groupId}
|
||||
</foreach>
|
||||
</where>
|
||||
order by id asc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="exhibitionStatistic" resultType="com.cool.store.dto.exhibition.ExhibitionStatisticsDTO">
|
||||
select
|
||||
exhibition_code as exhibitionCode,
|
||||
COALESCE(count(1),0) as signUpCount,
|
||||
COALESCE(sum( CASE WHEN participation_status = 1 THEN 1 ELSE 0 END ),0) as checkInCount,
|
||||
COALESCE(sum( CASE WHEN participation_status = 2 THEN 1 ELSE 0 END ),0) as formFillCount,
|
||||
COALESCE(sum( CASE WHEN participation_status in (3,4,5,6) THEN 1 ELSE 0 END ),0) as interviewCount
|
||||
from hy_partner_exhibition
|
||||
<where>
|
||||
<foreach collection="list" item="code" open="and exhibition_code in (" separator="," close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</where>
|
||||
group by exhibition_code
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<sql id="dynamicQuery">
|
||||
<trim prefix="WHERE" prefixOverrides="AND | OR">
|
||||
<if test="null != id">
|
||||
|
||||
@@ -33,6 +33,20 @@
|
||||
delete from hy_partner_exhibition
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
|
||||
<select id="getExhibitionLine" resultType="com.cool.store.dto.exhibition.ExhibitionLineDTO">
|
||||
select
|
||||
hpe.partner_id as partnerId,
|
||||
hpe.exhibition_code as exhibitionCode,
|
||||
pu.username as partnerName,
|
||||
pu.mobile as mobile
|
||||
from hy_partner_exhibition hpe left join hy_partner_user_info pu on hpe.partner_id = pu.partner_id
|
||||
where hpe.participation_status != 7
|
||||
<if test="exhibitionCode != null and exhibitionCode!=''">
|
||||
and hpe.exhibition_code = #{exhibitionCode}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<insert id="insertSelective" parameterType="com.cool.store.entity.HyPartnerExhibitionDO">
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
||||
SELECT LAST_INSERT_ID()
|
||||
|
||||
Reference in New Issue
Block a user