Просмотр исходного кода

/、user

release_toaliyun_real
xhxu 4 лет назад
Родитель
Сommit
bb0c4d506e
8 измененных файлов: 48 добавлений и 38 удалений
  1. +1
    -2
      mallinkService/src/main/java/com/iformall/mapper/WxCUserTagsMapper.java
  2. +11
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxCUserTagsServiceImpl.java
  3. +3
    -3
      mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java
  4. +6
    -0
      mallinkService/src/main/resources/mapper/TtCUserMapper.xml
  5. +7
    -1
      mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
  6. +2
    -1
      mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml
  7. +2
    -1
      mallinkService/src/main/resources/mapper/WxCUserFromMapper.xml
  8. +16
    -29
      mallinkService/src/main/resources/mapper/WxCUserTagsMapper.xml

+ 1
- 2
mallinkService/src/main/java/com/iformall/mapper/WxCUserTagsMapper.java Просмотреть файл

@@ -16,8 +16,7 @@ public interface WxCUserTagsMapper extends CommonMapper<WxCUserTags, String> {
List<WxCUserTags> findList(WxCUserTags wxCUserTags); List<WxCUserTags> findList(WxCUserTags wxCUserTags);
List<Long> findIdList(@Param("tenantId")String tenantId, @Param("tagIdList")List<Long> tagIdList); List<Long> findIdList(@Param("tenantId")String tenantId, @Param("tagIdList")List<Long> tagIdList);


long countUser(@Param("tagIds")String tagIds,@Param("tenantId")String tenantId,@Param("finalTenantId")String finalTenantId,
@Param("startTime")Date startTime,@Param("endTime")Date endTime);
List<Long> findUserIdList(@Param("tagIds")String tagIds,@Param("tenantId")String tenantId);


void updateNewId(CUserTagNewIdVo record); void updateNewId(CUserTagNewIdVo record);


+ 11
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxCUserTagsServiceImpl.java Просмотреть файл

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.iformall.common.IdWorker; import com.iformall.common.IdWorker;
import com.iformall.domain.dto.WxCUserBasicInfoDto;
import com.iformall.domain.po.*; import com.iformall.domain.po.*;
import com.iformall.domain.po.base.TenantEntity; import com.iformall.domain.po.base.TenantEntity;
import com.iformall.domain.vo.WxCUserBasicTagVo; import com.iformall.domain.vo.WxCUserBasicTagVo;
@@ -78,7 +79,16 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService {
@Override @Override
public long countUser(TenantEntity tenantEntity, Long tagId, Date startTime, Date endTime ) { public long countUser(TenantEntity tenantEntity, Long tagId, Date startTime, Date endTime ) {
String str = JSON.toJSONString(tagId); String str = JSON.toJSONString(tagId);
return wxCUserTagsMapper.countUser(str, tenantEntity.getFinalTenantId(),tenantEntity.getFinalTenantId(), startTime, endTime);
List<Long> userIds = wxCUserTagsMapper.findUserIdList(str, tenantEntity.getFinalTenantId());
if(startTime == null && endTime == null){
return (long)userIds.size();
}else{
WxCUserBasicInfoDto dto = new WxCUserBasicInfoDto();
dto.updateTenantInfo(tenantEntity);
dto.setStartTime(startTime);
dto.setEndTime(endTime);
return wxCUserBasicInfoMapper.findCount(dto);
}
} }






+ 3
- 3
mallinkService/src/main/java/com/iformall/service/impl/WxChartServiceImpl.java Просмотреть файл

@@ -76,7 +76,7 @@ public class WxChartServiceImpl implements WxChartDataService {
@Autowired @Autowired
WxLevelConfigMapper wxLevelConfigMapper; WxLevelConfigMapper wxLevelConfigMapper;
@Autowired @Autowired
WxCUserTagsMapper wxCUserTagsMapper;
WxCUserTagsService wxCUserTagsService;
@Lazy @Lazy
@Autowired @Autowired
@@ -2308,7 +2308,7 @@ public class WxChartServiceImpl implements WxChartDataService {
for (int i = 0; i < tags.length; i++) { for (int i = 0; i < tags.length; i++) {
WxTags tag = new WxTags(); WxTags tag = new WxTags();
tag.setName(tags[i].getMessage()); tag.setName(tags[i].getMessage());
tag.setCount(wxCUserTagsMapper.countUser(JSON.toJSONString(tags[i].getCode()), tenantEntity.getFinalTenantId(),tenantEntity.getFinalTenantId(), startTime, endTime));
tag.setCount(wxCUserTagsService.countUser(tenantEntity,tags[i].getCode(), startTime, endTime));
tagList.add(tag); tagList.add(tag);
total -= tag.getCount(); total -= tag.getCount();
} }
@@ -2344,7 +2344,7 @@ public class WxChartServiceImpl implements WxChartDataService {
for (int i = 0; i < tags.length; i++) { for (int i = 0; i < tags.length; i++) {
WxTags tag = new WxTags(); WxTags tag = new WxTags();
tag.setName(tags[i].getMessage()); tag.setName(tags[i].getMessage());
tag.setCount(wxCUserTagsMapper.countUser(JSON.toJSONString(tags[i].getCode()), tenantEntity.getFinalTenantId(),tenantEntity.getFinalTenantId(), startTime, endTime));
tag.setCount(wxCUserTagsService.countUser(tenantEntity,tags[i].getCode(), startTime, endTime));
tagList.add(tag); tagList.add(tag);
total -= tag.getCount(); total -= tag.getCount();
} }


+ 6
- 0
mallinkService/src/main/resources/mapper/TtCUserMapper.xml Просмотреть файл

@@ -242,6 +242,12 @@
<if test=" null != parentTenantId and '' != parentTenantId"> <if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId} and `parent_tenant_id` = #{parentTenantId}
</if> </if>
<if test=" null != userIds ">
and user_id in
<foreach collection="userIds" index="index" item="userIdItem" open="(" separator="," close=")">
#{userIdItem}
</foreach>
</if>
</select> </select>


<update id="updateMsgCount" parameterType="com.iformall.domain.po.tt.TtCUser"> <update id="updateMsgCount" parameterType="com.iformall.domain.po.tt.TtCUser">


+ 7
- 1
mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml Просмотреть файл

@@ -147,7 +147,7 @@
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem} #{idItem}
</foreach> </foreach>
</if>
</if>
</select> </select>
<select id="findIdList" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultType="Long"> <select id="findIdList" parameterType="com.iformall.domain.po.WxCUserBasicInfo" resultType="Long">
@@ -306,6 +306,12 @@
<if test="1 == queryImport"> <if test="1 == queryImport">
and wcubi.create_date like '%00:00:00' and wcubi.create_date like '%00:00:00'
</if> </if>
<if test=" null != ids ">
and wcubi.id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
</foreach>
</if>
</select> </select>


<select id="findCountHistory" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="com.iformall.domain.vo.UserCountVo"> <select id="findCountHistory" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="com.iformall.domain.vo.UserCountVo">


+ 2
- 1
mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml Просмотреть файл

@@ -99,7 +99,8 @@
</select> </select>


<select id="countUser" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Integer"> <select id="countUser" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Integer">
select count(DISTINCT ubi.id) from wx_c_user_car uc, wx_c_user_basic_info ubi
select count(DISTINCT ubi.id)
from wx_c_user_car uc, wx_c_user_basic_info ubi
where uc.c_user_id = ubi.id where uc.c_user_id = ubi.id
<if test=" null != tenantId and '' != tenantId"> <if test=" null != tenantId and '' != tenantId">
and uc.tenant_id = #{tenantId} and uc.tenant_id = #{tenantId}


+ 2
- 1
mallinkService/src/main/resources/mapper/WxCUserFromMapper.xml Просмотреть файл

@@ -133,7 +133,8 @@
</select> </select>


<select id="visits" parameterType="com.iformall.domain.vo.WxCUserFromVo" resultType="com.iformall.domain.vo.WxCUserFromVo"> <select id="visits" parameterType="com.iformall.domain.vo.WxCUserFromVo" resultType="com.iformall.domain.vo.WxCUserFromVo">
select a.from_id fromId,a.from_type fromType,a.from_name fromName,a.from_phone fromPhone,IFNULL(a.visits,0) visits,IFNULL(b.reach_user,0) reachUser,IFNULL(c.new_user,0) newUser from (
select a.from_id fromId,a.from_type fromType,a.from_name fromName,a.from_phone fromPhone,IFNULL(a.visits,0) visits,IFNULL(b.reach_user,0) reachUser,IFNULL(c.new_user,0) newUser
from (
select wcuf.from_id,wcuf.from_type, select wcuf.from_id,wcuf.from_type,
<if test=" fromType == 2 ">wcubi.nick_name from_name,wcubi.phone from_phone,</if> <if test=" fromType == 2 ">wcubi.nick_name from_name,wcubi.phone from_phone,</if>
<if test=" fromType == 5 ">wm.name from_name,wm.link_phone from_phone,</if> <if test=" fromType == 5 ">wm.name from_name,wm.link_phone from_phone,</if>


+ 16
- 29
mallinkService/src/main/resources/mapper/WxCUserTagsMapper.xml Просмотреть файл

@@ -16,30 +16,24 @@


<sql id="dynamicWhereConditions"> <sql id="dynamicWhereConditions">
where `tenant_id` = #{tenantId} where `tenant_id` = #{tenantId}

<if test=" null != id "> <if test=" null != id ">
and `id` = #{id} and `id` = #{id}

</if> </if>


<if test=" null != userId "> <if test=" null != userId ">
and `user_id` = #{userId} and `user_id` = #{userId}

</if> </if>


<if test=" null != tags "> <if test=" null != tags ">
and `tags` like concat('%', #{tags},'%') and `tags` like concat('%', #{tags},'%')

</if> </if>


<if test=" null != createDate "> <if test=" null != createDate ">
and `create_date` = #{createDate} and `create_date` = #{createDate}

</if> </if>


<if test=" null != updateDate "> <if test=" null != updateDate ">
and `update_date` = #{updateDate} and `update_date` = #{updateDate}

</if> </if>
<if test=" null != userIdList "> <if test=" null != userIdList ">
@@ -64,14 +58,6 @@
</if> </if>
<if test=" null != sortColumns">order by ${sortColumns}</if> <if test=" null != sortColumns">order by ${sortColumns}</if>
</sql> </sql>
<select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
select <include refid="allColumns"/> from wx_c_user_tags where id = #{id} and tenant_id = #{tenantId}
</select>
<delete id="deleteById" parameterType="java.util.HashMap">
delete from wx_c_user_tags where id = #{id} and tenant_id = #{tenantId}
</delete>


<select id="findList" parameterType="com.iformall.domain.po.WxCUserTags" resultMap="BaseResultMap"> <select id="findList" parameterType="com.iformall.domain.po.WxCUserTags" resultMap="BaseResultMap">
select select
@@ -79,6 +65,17 @@
from wx_c_user_tags from wx_c_user_tags
<include refid="dynamicWhereConditions"/> <include refid="dynamicWhereConditions"/>
</select> </select>
<select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap">
select <include refid="allColumns"/>
from wx_c_user_tags
where id = #{id} and tenant_id = #{tenantId}
</select>
<delete id="deleteById" parameterType="java.util.HashMap">
delete from wx_c_user_tags
where id = #{id} and tenant_id = #{tenantId}
</delete>


<select id="findIdList" parameterType="java.util.HashMap" resultType="java.lang.Long"> <select id="findIdList" parameterType="java.util.HashMap" resultType="java.lang.Long">
select id select id
@@ -93,25 +90,15 @@
and user_id = #{userId} and user_id = #{userId}
</update> </update>


<select id="countUser" resultType="java.lang.Long">
select count(cut.user_id) from wx_c_user_tags cut, wx_c_user_basic_info cubi
where cut.user_id = cubi.id
and cubi.final_tenant_id = #{finalTenantId}
<if test="null != tenantId">
and cut.tenant_id = #{tenantId}
</if>
<if test=" null != startTime ">
and cubi.create_date &gt;= #{startTime}
</if>
<if test=" null != endTime">
and cubi.create_date &lt; #{endTime}
</if>
<select id="findUserIdList" resultType="java.lang.Long">
select distinct user_id
from wx_c_user_tags
where tenant_id = #{tenantId}
<if test=" null != tagIds"> <if test=" null != tagIds">
and JSON_CONTAINS(cut.tags,#{tagIds}) and JSON_CONTAINS(cut.tags,#{tagIds})
</if> </if>


</select> </select>



</mapper> </mapper>

Загрузка…
Отмена
Сохранить