Procházet zdrojové kódy

集团版 bug

release_toaliyun_real
xhxu před 5 roky
rodič
revize
6465920f02
4 změnil soubory, kde provedl 110 přidání a 43 odebrání
  1. +2
    -0
      mallinkAdmin/src/main/resources/db/migration/V2020070131031__GROUP__ADD_001.sql
  2. +69
    -30
      mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
  3. +34
    -11
      mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml
  4. +5
    -2
      mallinkService/src/main/resources/mapper/WxCUserMapper.xml

+ 2
- 0
mallinkAdmin/src/main/resources/db/migration/V2020070131031__GROUP__ADD_001.sql Zobrazit soubor

@@ -0,0 +1,2 @@
ALTER TABLE `wx_c_user_basic_info`
ADD COLUMN `parent_tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '父租户ID' AFTER `tenant_id`;

+ 69
- 30
mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml Zobrazit soubor

@@ -14,6 +14,7 @@
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
<result column="name" jdbcType="VARCHAR" property="name"/> <result column="name" jdbcType="VARCHAR" property="name"/>
<result column="level" jdbcType="VARCHAR" property="level"/> <result column="level" jdbcType="VARCHAR" property="level"/>
<result column="nick_name" jdbcType="VARCHAR" property="nickName"/> <result column="nick_name" jdbcType="VARCHAR" property="nickName"/>
@@ -27,9 +28,9 @@


<sql id="allColumns"> <sql id="allColumns">
`id`,`phone`,`birthdate`,`education`,`sex`,`email`,`address`,`poins`,`tag_id`, `id`,`phone`,`birthdate`,`education`,`sex`,`email`,`address`,`poins`,`tag_id`,
`create_date`,`update_date`,`tenant_id`,`name`,`nick_name`,`credit`,`active_time`,`act_record`
`create_date`,`update_date`,`tenant_id`,`parent_tenant_id`,`name`,`nick_name`,`credit`,`active_time`,`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=wcubi.tenant_id
order by points desc limit 1 ) level,status order by points desc limit 1 ) level,status
</sql> </sql>


@@ -40,9 +41,12 @@
and `id` = #{id} and `id` = #{id}
</if> </if>


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


<if test=" null != phone "> <if test=" null != phone ">
and `phone` like concat('%', #{phone},'%') and `phone` like concat('%', #{phone},'%')
@@ -116,7 +120,7 @@
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 wcubi
<include refid="dynamicWhereConditions"/> <include refid="dynamicWhereConditions"/>
) r where 1=1 ) r where 1=1


@@ -132,14 +136,13 @@


<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">
@@ -151,8 +154,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>


@@ -178,8 +184,11 @@
and birthdate is null and birthdate is null
</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>
@@ -205,8 +214,11 @@
and poins is null and poins is null
</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>
@@ -235,8 +247,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 cub.`parent_tenant_id` = #{parentTenantId}
</if> </if>


</select> </select>
@@ -248,8 +263,11 @@
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 cub.`parent_tenant_id` = #{parentTenantId}
</if> </if>
</select> </select>


@@ -261,8 +279,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>
<if test="1 == queryImport"> <if test="1 == queryImport">
and create_date like '%00:00:00' and create_date like '%00:00:00'
@@ -293,15 +314,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_basic_info where 1=1 from wx_c_user_basic_info 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}
@@ -348,9 +375,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 cu.`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},'%')
@@ -434,8 +464,11 @@


<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 cu.`parent_tenant_id` = #{parentTenantId}
</if> </if>


<if test=" null != startTime "> <if test=" null != startTime ">
@@ -521,15 +554,21 @@


<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 cubi.`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 cubi.`parent_tenant_id` = #{parentTenantId}
</if> </if>
</select> </select>




+ 34
- 11
mallinkService/src/main/resources/mapper/WxCUserCarMapper.xml Zobrazit soubor

@@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCUserCar"> <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCUserCar">
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/>
<result column="c_user_id" jdbcType="BIGINT" property="cUserId" /> <result column="c_user_id" jdbcType="BIGINT" property="cUserId" />
<result column="car_number" jdbcType="VARCHAR" property="carNumber" /> <result column="car_number" jdbcType="VARCHAR" property="carNumber" />
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
@@ -13,7 +14,7 @@
</resultMap> </resultMap>
<sql id="allColumns"> <sql id="allColumns">
`id`,`tenant_id`,`c_user_id`,`car_number`,`create_date`,`update_date`,`vendor_type`,`vendor_params`
`id`,`tenant_id`,`parent_tenant_id`,`c_user_id`,`car_number`,`create_date`,`update_date`,`vendor_type`,`vendor_params`
</sql> </sql>


<sql id="dynamicWhereConditions"> <sql id="dynamicWhereConditions">
@@ -22,12 +23,14 @@
<if test=" null != id "> <if test=" null != id ">
and `id` = #{id} and `id` = #{id}
</if>
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
</if>

<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
<if test=" null != cUserId "> <if test=" null != cUserId ">
and `c_user_id` = #{cUserId} and `c_user_id` = #{cUserId}
@@ -82,10 +85,14 @@
<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 ">
<if test=" null != tenantId and '' != tenantId">
and uc.tenant_id = #{tenantId} and uc.tenant_id = #{tenantId}
and ubi.tenant_id = #{tenantId} and ubi.tenant_id = #{tenantId}
</if> </if>
<if test=" null != parentTenantId and '' != parentTenantId">
and uc.parent_tenant_id = #{parentTenantId}
and ubi.parent_tenant_id = #{parentTenantId}
</if>
<if test=" null != startTime "> <if test=" null != startTime ">
and ubi.create_date &gt;= #{startTime} and ubi.create_date &gt;= #{startTime}
</if> </if>
@@ -96,13 +103,29 @@
</select> </select>
<select id="queryCarCount" parameterType="hashmap" resultType="long"> <select id="queryCarCount" parameterType="hashmap" resultType="long">
select count(id) from wx_c_user_car where tenant_id=#{tenantId} and create_date between #{startdate} and #{enddate}
select count(id) from wx_c_user_car where 1=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
and create_date between #{startdate} and #{enddate}
</select> </select>


<select id="queryCarCountHistory" resultType="hashmap" parameterType="hashmap"> <select id="queryCarCountHistory" resultType="hashmap" parameterType="hashmap">
SELECT count(DISTINCT c.id) count, c.create_time FROM SELECT count(DISTINCT c.id) count, c.create_time FROM
(SELECT ubi.id as id, DATE_FORMAT(uc.create_date, '%m/%d') create_time FROM wx_c_user_car uc, wx_c_user_basic_info ubi WHERE uc.c_user_id = ubi.id
AND uc.tenant_id = #{tenantId} AND ubi.tenant_id = #{tenantId} AND ubi.create_date BETWEEN #{startdate} AND #{enddate}) c
(SELECT ubi.id as id, DATE_FORMAT(uc.create_date, '%m/%d') create_time FROM wx_c_user_car uc, wx_c_user_basic_info ubi
WHERE uc.c_user_id = ubi.id
<if test=" null != tenantId and '' != tenantId">
and uc.tenant_id = #{tenantId}
and ubi.tenant_id = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and uc.parent_tenant_id = #{parentTenantId}
and ubi.parent_tenant_id = #{parentTenantId}
</if>
AND ubi.create_date BETWEEN #{startdate} AND #{enddate}) c
GROUP BY c.create_time ORDER BY c.create_time GROUP BY c.create_time ORDER BY c.create_time
</select> </select>
</mapper> </mapper>

+ 5
- 2
mallinkService/src/main/resources/mapper/WxCUserMapper.xml Zobrazit soubor

@@ -66,8 +66,11 @@
and `id` = #{id} and `id` = #{id}
</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>


<if test=" null != openId "> <if test=" null != openId ">


Načítá se…
Zrušit
Uložit