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

集团版第二次bug第一次

release_toaliyun_real
xhxu 5 лет назад
Родитель
Сommit
88b4a8d75e
2 измененных файлов: 161 добавлений и 90 удалений
  1. +136
    -80
      mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
  2. +25
    -10
      mallinkService/src/main/resources/mapper/WxCUserMapper.xml

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

@@ -26,10 +26,10 @@
</resultMap> </resultMap>


<sql id="allColumns"> <sql id="allColumns">
`id`,`phone`,`birthdate`,`education`,`sex`,`email`,`address`,`poins`,`tag_id`,
`create_date`,`update_date`,`tenant_id`,`name`,`nick_name`,`credit`,`active_time`,`act_record`
cub.`id`,cub.`phone`,cub.`birthdate`,cub.`education`,cub.`sex`,cub.`email`,cub.`address`,cub.`poins`,cub.`tag_id`,
cub.`create_date`,cub.`update_date`,cub.`tenant_id`,cub.`name`,cub.`nick_name`,cub.`credit`,cub.`active_time`,cub.`act_record`
,(select level from wx_level_config ,(select level from wx_level_config
where poins >= points and tenant_id=#{tenantId}
where poins >= points and tenant_id=cub.tenant_id
order by points desc limit 1 ) level,status order by points desc limit 1 ) level,status
</sql> </sql>


@@ -37,74 +37,77 @@
where 1 = 1 where 1 = 1


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


<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
<if test=" null != tenantId and '' != tenantId">
and cub.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and cu.`parent_tenant_id` = #{parentTenantId}
</if> </if>


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


<if test=" null != birthdate "> <if test=" null != birthdate ">
and `birthdate` = #{birthdate}
and cub.`birthdate` = #{birthdate}
</if> </if>


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


<if test=" null != sex "> <if test=" null != sex ">
and `sex` = #{sex}
and cub.`sex` = #{sex}
</if> </if>


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


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


<if test=" null != poins "> <if test=" null != poins ">
and `poins` = #{poins}
and cub.`poins` = #{poins}
</if> </if>


<if test=" null != credit "> <if test=" null != credit ">
and `credit` = #{credit}
and cub.`credit` = #{credit}
</if> </if>


<if test=" null != tagId "> <if test=" null != tagId ">
and `tag_id` = #{tagId}
and cub.`tag_id` = #{tagId}
</if> </if>


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


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


<if test=" null != actRecord "> <if test=" null != actRecord ">
and `act_record` = #{actRecord}
and cub.`act_record` = #{actRecord}
</if> </if>
<if test=" null != name "> <if test=" null != name ">
and `name` like concat('%', #{name},'%')
and cub.`name` like concat('%', #{name},'%')
</if> </if>
<if test=" null != startTime and null!=endTime"> <if test=" null != startTime and null!=endTime">
and `create_date` between #{startTime} and #{endTime}
and cub.`create_date` between #{startTime} and #{endTime}
</if> </if>
<if test=" null != status "> <if test=" null != status ">
and `status` = #{status}
and cub.`status` = #{status}
</if> </if>
<if test=" null != ids "> <if test=" null != ids ">
and id in
and cub.id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem} #{idItem}
</foreach> </foreach>
@@ -116,7 +119,8 @@
select r.* from ( select r.* from (
select select
<include refid="allColumns"/> <include refid="allColumns"/>
from wx_c_user_basic_info
from wx_c_user_basic_info cub
inner join wx_c_user cu on cu.id = cub.id
<include refid="dynamicWhereConditions"/> <include refid="dynamicWhereConditions"/>
) r where 1=1 ) r where 1=1


@@ -132,81 +136,95 @@


<update id="updateScore" parameterType="com.iformall.domain.po.WxCUserBasicInfo"> <update id="updateScore" parameterType="com.iformall.domain.po.WxCUserBasicInfo">
update wx_c_user_basic_info set poins=#{poins} update wx_c_user_basic_info set poins=#{poins}
where phone=#{phone} and tenant_id=#{tenantId}
where phone=#{phone}
and id=#{id} and id=#{id}
</update> </update>


<update id="updateNewId" parameterType="com.iformall.domain.vo.CUserBaseVo"> <update id="updateNewId" parameterType="com.iformall.domain.vo.CUserBaseVo">
update wx_c_user_basic_info set id=#{newId} , credit=#{credit} , poins=#{poins} update wx_c_user_basic_info set id=#{newId} , credit=#{credit} , poins=#{poins}
where tenant_id=#{tenantId}
and id = #{id}
where id = #{id}
</update> </update>


<select id="findCountBySex" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long"> <select id="findCountBySex" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
select count(id) from wx_c_user_basic_info
where sex =#{sex}
select count(cub.id) from wx_c_user_basic_info cub
inner join wx_c_user cu on cu.id = cub.id
where cub.sex =#{sex}
<if test=" null != startTime "> <if test=" null != startTime ">
and create_date &gt;= #{startTime}
and cub.create_date &gt;= #{startTime}
</if> </if>
<if test=" null != endTime"> <if test=" null != endTime">
and create_date &lt;= #{endTime}
and cub.create_date &lt;= #{endTime}
</if>
<if test=" null != tenantId and '' != tenantId">
and cub.`tenant_id` = #{tenantId}
</if> </if>
<if test="null != tenantId">
and tenant_id =#{tenantId}
<if test=" null != parentTenantId and '' != parentTenantId">
and cu.`parent_tenant_id` = #{parentTenantId}
</if> </if>

</select> </select>




<select id="findCountByAge" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long"> <select id="findCountByAge" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
select count(id) from wx_c_user_basic_info where 1=1
select count(cub.id) from wx_c_user_basic_info cub
inner join wx_c_user cu on cu.id = cub.id
where 1=1
<if test=" null != startTime "> <if test=" null != startTime ">
and create_date &gt;= #{startTime}
and cub.create_date &gt;= #{startTime}
</if> </if>
<if test=" null != endTime"> <if test=" null != endTime">
and create_date &lt;= #{endTime}
and cub.create_date &lt;= #{endTime}
</if> </if>


<if test=" null != birthStartTime "> <if test=" null != birthStartTime ">
and birthdate &gt;= #{birthStartTime}
and cub.birthdate &gt;= #{birthStartTime}
</if> </if>


<if test=" null != birthEndTime"> <if test=" null != birthEndTime">
and birthdate &lt;= #{birthEndTime}
and cub.birthdate &lt;= #{birthEndTime}
</if> </if>


<if test=" null == birthStartTime and null == birthEndTime"> <if test=" null == birthStartTime and null == birthEndTime">
and birthdate is null
and cub.birthdate is null
</if> </if>


<if test="null != tenantId">
and tenant_id =#{tenantId}
<if test=" null != tenantId and '' != tenantId">
and cub.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and cu.`parent_tenant_id` = #{parentTenantId}
</if> </if>


</select> </select>


<select id="findCountByScore" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long"> <select id="findCountByScore" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
select count(id) from wx_c_user_basic_info where 1=1
select count(cub.id) from wx_c_user_basic_info cub
inner join wx_c_user cu on cu.id = cub.id
where 1=1
<if test=" null != startTime "> <if test=" null != startTime ">
and create_date &gt;= #{startTime}
and cub.create_date &gt;= #{startTime}
</if> </if>
<if test=" null != endTime"> <if test=" null != endTime">
and create_date &lt;= #{endTime}
and cub.create_date &lt;= #{endTime}
</if> </if>


<if test=" null != levelStartScore "> <if test=" null != levelStartScore ">
and poins &gt;= #{levelStartScore}
and cub.poins &gt;= #{levelStartScore}
</if> </if>


<if test=" null != levelEndScore"> <if test=" null != levelEndScore">
and poins &lt; #{levelEndScore}
and cub.poins &lt; #{levelEndScore}
</if> </if>


<if test=" null == levelStartScore and null == levelEndScore"> <if test=" null == levelStartScore and null == levelEndScore">
and poins is null
and cub.poins is null
</if> </if>


<if test="null != tenantId">
and tenant_id =#{tenantId}
<if test=" null != tenantId and '' != tenantId">
and cub.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and cu.`parent_tenant_id` = #{parentTenantId}
</if> </if>


</select> </select>
@@ -235,8 +253,11 @@
and cub.poins is null and cub.poins is null
</if> </if>


<if test="null != tenantId">
and cub.tenant_id =#{tenantId}
<if test=" null != tenantId and '' != tenantId">
and cub.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and cu.`parent_tenant_id` = #{parentTenantId}
</if> </if>


</select> </select>
@@ -248,29 +269,37 @@
where cub.status = 0 and cu.phone is not null where cub.status = 0 and cu.phone is not null
AND DATE_FORMAT(cub.birthdate,'%m-%d') &gt;= #{begin} AND DATE_FORMAT(cub.birthdate,'%m-%d') &gt;= #{begin}
AND DATE_FORMAT(cub.birthdate,'%m-%d') &lt;= #{end} AND DATE_FORMAT(cub.birthdate,'%m-%d') &lt;= #{end}
<if test="null != tenantId">
and cub.tenant_id = #{tenantId}
<if test=" null != tenantId and '' != tenantId">
and cub.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and cu.`parent_tenant_id` = #{parentTenantId}
</if> </if>
</select> </select>


<select id="findCount" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long"> <select id="findCount" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
select count(id) from wx_c_user_basic_info where 1=1
select count(cub.id) from wx_c_user_basic_info cub
inner join wx_c_user cu on cu.id = cub.id
where 1=1
<if test=" null != startTime "> <if test=" null != startTime ">
and create_date &gt;= #{startTime}
and cub.create_date &gt;= #{startTime}
</if> </if>
<if test=" null != endTime"> <if test=" null != endTime">
and create_date &lt; #{endTime}
</if>
<if test="null != tenantId">
and tenant_id =#{tenantId}
and cub.create_date &lt; #{endTime}
</if> </if>
<if test="1 == queryImport"> <if test="1 == queryImport">
and create_date like '%00:00:00'
and cub.create_date like '%00:00:00'
</if>
<if test=" null != tenantId and '' != tenantId">
and cub.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and cu.`parent_tenant_id` = #{parentTenantId}
</if> </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">
select count(id) as incCount,
select count(cub.id) as incCount,
<if test="1 == reportType "> <if test="1 == reportType ">
date_format(create_date, '%Y-%m-%d') as reportTime, date_format(create_date, '%Y-%m-%d') as reportTime,
</if> </if>
@@ -282,35 +311,44 @@
</if> </if>


<if test="1 == reportType or 2 == reportType or 3 == reportType"> <if test="1 == reportType or 2 == reportType or 3 == reportType">
(select count(id) from wx_c_user_basic_info
where
(select count(cubi.id) from wx_c_user_basic_info cubi
inner join wx_c_user cu1 on cu1.id = cubi.id
where 1=1
<if test="1 == reportType "> <if test="1 == reportType ">
date_format(create_date, '%Y-%m-%d') &lt;= reportTime
and cubi.date_format(create_date, '%Y-%m-%d') &lt;= reportTime
</if> </if>
<if test="2 == reportType "> <if test="2 == reportType ">
date_format(create_date, '%Y-%m') &lt;= reportTime
and cubi.date_format(create_date, '%Y-%m') &lt;= reportTime
</if> </if>
<if test="3 == reportType "> <if test="3 == reportType ">
date_format(create_date, '%Y') &lt;= reportTime
and cubi.date_format(create_date, '%Y') &lt;= reportTime
</if> </if>
<if test="null != tenantId">
and tenant_id =#{tenantId}
<if test=" null != tenantId and '' != tenantId">
and cubi.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and cu1.`parent_tenant_id` = #{parentTenantId}
</if> </if>
) as totalCount ) as totalCount
</if> </if>


from wx_c_user_basic_info where 1=1
<if test="null != tenantId">
and tenant_id =#{tenantId}
from wx_c_user_basic_info cub
inner join wx_c_user cu on cu.id = cub.id
where 1=1
<if test=" null != tenantId and '' != tenantId">
and cub.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and cu.`parent_tenant_id` = #{parentTenantId}
</if> </if>
<if test=" null != startTime "> <if test=" null != startTime ">
and create_date &gt;= #{startTime}
and cub.create_date &gt;= #{startTime}
</if> </if>
<if test=" null != endTime"> <if test=" null != endTime">
and create_date &lt; #{endTime}
and cub.create_date &lt; #{endTime}
</if> </if>
<if test="1 == reportType or 2 == reportType or 3 == reportType"> <if test="1 == reportType or 2 == reportType or 3 == reportType">
group by reportTime
group by cub.reportTime
</if> </if>
</select> </select>


@@ -348,9 +386,12 @@
and cu.`id` = #{id} and cu.`id` = #{id}
</if> </if>


<if test=" null != tenantId ">
<if test=" null != tenantId and '' != tenantId">
and cu.`tenant_id` = #{tenantId} and cu.`tenant_id` = #{tenantId}
</if> </if>
<if test=" null != parentTenantId and '' != parentTenantId">
and c.`parent_tenant_id` = #{parentTenantId}
</if>


<if test=" null != phone "> <if test=" null != phone ">
and cu.`phone` like concat('%', #{phone},'%') and cu.`phone` like concat('%', #{phone},'%')
@@ -415,6 +456,7 @@
select select
<include refid="allVoColumns"/> <include refid="allVoColumns"/>
from wx_c_user_basic_info cu from wx_c_user_basic_info cu
inner join wx_c_user c on c.id = cu.id
left join wx_c_user_tags cut on cut.`id` = cu.`tag_id` left join wx_c_user_tags cut on cut.`id` = cu.`tag_id`
<include refid="dynamicVoWhereConditions"/> <include refid="dynamicVoWhereConditions"/>
</select> </select>
@@ -423,6 +465,7 @@
select select
count(*) count(*)
from wx_c_user_basic_info cu from wx_c_user_basic_info cu
inner join wx_c_user c on c.id = cu.id
left join wx_c_user_tags cut on cut.`id` = cu.`tag_id` left join wx_c_user_tags cut on cut.`id` = cu.`tag_id`
<include refid="dynamicVoWhereConditions"/> <include refid="dynamicVoWhereConditions"/>
</select> </select>
@@ -434,8 +477,12 @@


<sql id="filterWhereConditions"> <sql id="filterWhereConditions">
where 1=1 where 1=1
<if test="null != tenantId">
and cu.tenant_id =#{tenantId}

<if test=" null != tenantId and '' != tenantId">
and cu.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and c.`parent_tenant_id` = #{parentTenantId}
</if> </if>


<if test=" null != startTime "> <if test=" null != startTime ">
@@ -503,6 +550,7 @@


<select id="findCountByFilter" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long"> <select id="findCountByFilter" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
select count(*) from wx_c_user_basic_info cu select count(*) from wx_c_user_basic_info cu
inner join wx_c_user c on c.id = cu.id
<if test=" null != tagIds "> <if test=" null != tagIds ">
join wx_c_user_tags cut on cut.`id` = cu.`tag_id` join wx_c_user_tags cut on cut.`id` = cu.`tag_id`
</if> </if>
@@ -512,6 +560,7 @@
<select id="findListByFilter" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultMap="BaseResultMap"> <select id="findListByFilter" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultMap="BaseResultMap">
select <include refid="msgColumns"/> select <include refid="msgColumns"/>
from wx_c_user_basic_info cu from wx_c_user_basic_info cu
inner join wx_c_user c on c.id = cu.id
<if test=" null != tagIds "> <if test=" null != tagIds ">
join wx_c_user_tags cut on cut.`id` = cu.`tag_id` join wx_c_user_tags cut on cut.`id` = cu.`tag_id`
</if> </if>
@@ -521,15 +570,22 @@


<select id="findImportUserCount" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long"> <select id="findImportUserCount" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
SELECT count(*) FROM wx_c_user_basic_info cubi left join wx_c_user cu on cubi.id=cu.id where cu.id is null SELECT count(*) FROM wx_c_user_basic_info cubi left join wx_c_user cu on cubi.id=cu.id where cu.id is null
<if test="null != tenantId">
and cubi.tenant_id =#{tenantId}

<if test=" null != tenantId and '' != tenantId">
and cubi.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and cu.`parent_tenant_id` = #{parentTenantId}
</if> </if>
</select> </select>


<select id="findGrowUserCount" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long"> <select id="findGrowUserCount" parameterType="com.iformall.domain.dto.WxCUserBasicInfoDto" resultType="java.lang.Long">
SELECT count(*) FROM wx_c_user_basic_info cubi left join wx_c_user cu on cubi.id=cu.id where cu.id is not null SELECT count(*) FROM wx_c_user_basic_info cubi left join wx_c_user cu on cubi.id=cu.id where cu.id is not null
<if test="null != tenantId">
and cubi.tenant_id =#{tenantId}
<if test=" null != tenantId and '' != tenantId">
and cubi.`tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and cu.`parent_tenant_id` = #{parentTenantId}
</if> </if>
</select> </select>




+ 25
- 10
mallinkService/src/main/resources/mapper/WxCUserMapper.xml Просмотреть файл

@@ -249,8 +249,11 @@
<if test=" null != endTime"> <if test=" null != endTime">
and create_date &lt; #{endTime} and create_date &lt; #{endTime}
</if> </if>
<if test="null != tenantId">
and tenant_id =#{tenantId}
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if> </if>
</select> </select>


@@ -277,15 +280,21 @@
<if test="3 == reportType "> <if test="3 == reportType ">
date_format(create_date, '%Y') &lt;= reportTime date_format(create_date, '%Y') &lt;= reportTime
</if> </if>
<if test="null != tenantId">
and tenant_id =#{tenantId}
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if> </if>
) as totalCount ) as totalCount
</if> </if>


from wx_c_user where 1=1 from wx_c_user where 1=1
<if test="null != tenantId">
and tenant_id =#{tenantId}
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if> </if>
<if test=" null != startTime "> <if test=" null != startTime ">
and create_date &gt;= #{startTime} and create_date &gt;= #{startTime}
@@ -300,8 +309,11 @@


<select id="listByChannel" resultMap="BaseResultMap" > <select id="listByChannel" resultMap="BaseResultMap" >
select id,nick_name,phone,create_date,scene_address from wx_c_user where 1=1 select id,nick_name,phone,create_date,scene_address from wx_c_user where 1=1
<if test="null != tenantId">
and tenant_id =#{tenantId}
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if> </if>
<if test=" null != startDate "> <if test=" null != startDate ">
and create_date &gt;= #{startDate} and create_date &gt;= #{startDate}
@@ -321,8 +333,11 @@


<select id="countByChannel" resultType="java.lang.Long" > <select id="countByChannel" resultType="java.lang.Long" >
select count(id) from wx_c_user where 1=1 select count(id) from wx_c_user where 1=1
<if test="null != tenantId">
and tenant_id =#{tenantId}
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if> </if>
<if test=" null != startDate "> <if test=" null != startDate ">
and create_date &gt;= #{startDate} and create_date &gt;= #{startDate}


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