|
|
|
|
@ -38,6 +38,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<result property="remark" column="remark" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<resultMap type="WxUserMemberRet" id="WxUserMemberRetResult">
|
|
|
|
|
<result property="id" column="id" />
|
|
|
|
|
<result property="nickname" column="nickname" />
|
|
|
|
|
<result property="headimg" column="headimg" />
|
|
|
|
|
<result property="username" column="username" />
|
|
|
|
|
<result property="credit" column="credit" />
|
|
|
|
|
<result property="expireCredit" column="expire_credit" />
|
|
|
|
|
<result property="openid" column="openid" />
|
|
|
|
|
<result property="unionid" column="unionid" />
|
|
|
|
|
<result property="userType" column="user_type" />
|
|
|
|
|
<result property="level" column="level" />
|
|
|
|
|
<result property="mobile" column="mobile" />
|
|
|
|
|
<result property="provinceId" column="province_id" />
|
|
|
|
|
<result property="cityId" column="city_id" />
|
|
|
|
|
<result property="areaId" column="area_id" />
|
|
|
|
|
<result property="province" column="province" />
|
|
|
|
|
<result property="city" column="city" />
|
|
|
|
|
<result property="area" column="area" />
|
|
|
|
|
<result property="birthday" column="birthday" />
|
|
|
|
|
<result property="clock" column="clock" />
|
|
|
|
|
<result property="activity" column="activity" />
|
|
|
|
|
<result property="wechat" column="wechat" />
|
|
|
|
|
<result property="isAbutment" column="is_abutment" />
|
|
|
|
|
<result property="isCompleteInformation" column="is_complete_information" />
|
|
|
|
|
<result property="devicesNum" column="devices_num" />
|
|
|
|
|
<result property="loginTime" column="login_time" />
|
|
|
|
|
<result property="status" column="status" />
|
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
|
<result property="remark" column="remark" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectWxUserMemberVo">
|
|
|
|
|
select id, nickname, headimg, username, credit, expire_credit, openid, unionid, user_type, level, mobile, province_id, city_id, area_id, province, city, area, birthday, clock, activity, wechat, is_abutment, login_time, is_complete_information, devices_num, status, create_by, create_time, update_by, update_time, remark from wx_user_member
|
|
|
|
|
</sql>
|
|
|
|
|
@ -127,14 +161,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="wecomTags != null and wecomTags.size > 0" >
|
|
|
|
|
and id in (
|
|
|
|
|
SELECT
|
|
|
|
|
DISTINCT user_id
|
|
|
|
|
user_id
|
|
|
|
|
FROM
|
|
|
|
|
wx_user_tag
|
|
|
|
|
WHERE
|
|
|
|
|
tag_id IN
|
|
|
|
|
type = 2
|
|
|
|
|
AND tag_id IN
|
|
|
|
|
<foreach item="wecomTag" collection="wecomTags" open="(" separator="," close=")">
|
|
|
|
|
#{wecomTag}
|
|
|
|
|
</foreach>
|
|
|
|
|
GROUP BY
|
|
|
|
|
user_id
|
|
|
|
|
HAVING
|
|
|
|
|
COUNT( DISTINCT tag_id ) = #{wecomTagNum}
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="miniProgramTags != null and miniProgramTags.size > 0" >
|
|
|
|
|
@ -144,10 +183,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
FROM
|
|
|
|
|
wx_user_tag
|
|
|
|
|
WHERE
|
|
|
|
|
tag_id IN
|
|
|
|
|
type = 1
|
|
|
|
|
AND tag_id IN
|
|
|
|
|
<foreach item="miniProgramTag" collection="miniProgramTags" open="(" separator="," close=")">
|
|
|
|
|
#{miniProgramTag}
|
|
|
|
|
</foreach>
|
|
|
|
|
GROUP BY
|
|
|
|
|
user_id
|
|
|
|
|
HAVING
|
|
|
|
|
COUNT( DISTINCT tag_id ) = #{miniProgramTagNum}
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
and member.status = 0
|
|
|
|
|
@ -311,5 +355,78 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
</foreach>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectWxUserMemberRetListByVm" resultMap="WxUserMemberRetResult">
|
|
|
|
|
SELECT <include refid="fieldList" />
|
|
|
|
|
<where>
|
|
|
|
|
<if test="nickname != null and nickname != ''"> and member.nickname like concat('%', #{nickname}, '%')</if>
|
|
|
|
|
<if test="creditStart != null"> and member.credit >= #{creditStart} </if>
|
|
|
|
|
<if test="creditEnd != null"> and member.credit <= #{creditEnd}</if>
|
|
|
|
|
<if test="userType != null "> and member.user_type = #{userType}</if>
|
|
|
|
|
<if test="provinceId != null and provinceId != ''"> and member.province_id = #{provinceId}</if>
|
|
|
|
|
<if test="cityId != null and cityId != ''"> and member.city_id = #{cityId}</if>
|
|
|
|
|
<if test="areaId != null and areaId != ''"> and member.area_id = #{areaId}</if>
|
|
|
|
|
<if test="birthday != null "> and member.birthday = #{birthday}</if>
|
|
|
|
|
<if test="id!=null and id !=''">
|
|
|
|
|
and
|
|
|
|
|
<foreach collection="id.split(',')" index="index" item="item" open="(" separator="OR"
|
|
|
|
|
close=")">
|
|
|
|
|
member.id LIKE concat('%', #{item}, '%')
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="mobile!=null and mobile !=''">
|
|
|
|
|
OR
|
|
|
|
|
<foreach collection="mobile.split(',')" index="index" item="item" open="(" separator="OR"
|
|
|
|
|
close=")">
|
|
|
|
|
member.mobile like concat('%', #{item}, '%')
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params != null and params.beginTime != null">
|
|
|
|
|
and member.create_time >= #{params.beginTime}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="params != null and params.endTime != null">
|
|
|
|
|
and member.create_time <= #{params.endTime}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="deviceNumStart != null"> and member.devices_num >= #{deviceNumStart}</if>
|
|
|
|
|
<if test="deviceNumEnd != null"> and member.devices_num <= #{deviceNumEnd}</if>
|
|
|
|
|
<if test="wecomTags != null and wecomTags.size > 0" >
|
|
|
|
|
and id in (
|
|
|
|
|
SELECT
|
|
|
|
|
user_id
|
|
|
|
|
FROM
|
|
|
|
|
wx_user_tag
|
|
|
|
|
WHERE
|
|
|
|
|
type = 2
|
|
|
|
|
AND tag_id IN
|
|
|
|
|
<foreach item="wecomTag" collection="wecomTags" open="(" separator="," close=")">
|
|
|
|
|
#{wecomTag}
|
|
|
|
|
</foreach>
|
|
|
|
|
GROUP BY
|
|
|
|
|
user_id
|
|
|
|
|
HAVING
|
|
|
|
|
COUNT( DISTINCT tag_id ) = #{wecomTagNum}
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
<if test="miniProgramTags != null and miniProgramTags.size > 0" >
|
|
|
|
|
and id in (
|
|
|
|
|
SELECT
|
|
|
|
|
DISTINCT user_id
|
|
|
|
|
FROM
|
|
|
|
|
wx_user_tag
|
|
|
|
|
WHERE
|
|
|
|
|
type = 1
|
|
|
|
|
AND tag_id IN
|
|
|
|
|
<foreach item="miniProgramTag" collection="miniProgramTags" open="(" separator="," close=")">
|
|
|
|
|
#{miniProgramTag}
|
|
|
|
|
</foreach>
|
|
|
|
|
GROUP BY
|
|
|
|
|
user_id
|
|
|
|
|
HAVING
|
|
|
|
|
COUNT( DISTINCT tag_id ) = #{miniProgramTagNum}
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
and member.status = 0
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|