|
|
@@ -0,0 +1,323 @@ |
|
|
|
<?xml version="1.0" encoding="UTF-8"?> |
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|
|
|
<mapper namespace="com.iformall.mapper.WxCLiveUserBasicInfoMapper"> |
|
|
|
<resultMap id="BaseResultMap" type="com.iformall.domain.po.WxCUserBasicInfo"> |
|
|
|
<id column="id" jdbcType="BIGINT" property="id"/> |
|
|
|
<result column="phone" jdbcType="VARCHAR" property="phone"/> |
|
|
|
<result column="birthdate" jdbcType="TIMESTAMP" property="birthdate"/> |
|
|
|
<result column="education" jdbcType="VARCHAR" property="education"/> |
|
|
|
<result column="sex" jdbcType="INTEGER" property="sex"/> |
|
|
|
<result column="height" jdbcType="VARCHAR" property="height"/> |
|
|
|
<result column="weight" jdbcType="VARCHAR" property="weight"/> |
|
|
|
<result column="id_card" jdbcType="VARCHAR" property="idCard"/> |
|
|
|
<result column="email" jdbcType="VARCHAR" property="email"/> |
|
|
|
<result column="address" jdbcType="VARCHAR" property="address"/> |
|
|
|
<result column="poins" jdbcType="INTEGER" property="poins"/> |
|
|
|
<result column="tag_id" jdbcType="BIGINT" property="tagId"/> |
|
|
|
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> |
|
|
|
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> |
|
|
|
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> |
|
|
|
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/> |
|
|
|
<result column="final_tenant_id" jdbcType="VARCHAR" property="finalTenantId"/> |
|
|
|
<result column="name" jdbcType="VARCHAR" property="name"/> |
|
|
|
<result column="level" jdbcType="VARCHAR" property="level"/> |
|
|
|
<result column="nick_name" jdbcType="VARCHAR" property="nickName"/> |
|
|
|
<result column="avatar_url" jdbcType="VARCHAR" property="avatarUrl"/> |
|
|
|
<result column="credit" jdbcType="INTEGER" property="credit"/> |
|
|
|
<result column="active_time" jdbcType="TIMESTAMP" property="activeTime"/> |
|
|
|
<result column="login_count" jdbcType="INTEGER" property="loginCount"/> |
|
|
|
<result column="act_record" jdbcType="INTEGER" property="actRecord"/> |
|
|
|
<result column="score_date" jdbcType="TIMESTAMP" property="scoreDate"/> |
|
|
|
<result column="code" jdbcType="VARCHAR" property="code"/> |
|
|
|
<result column="version" jdbcType="INTEGER" property="version"/> |
|
|
|
<result column="expire_time" jdbcType="VARCHAR" property="expireTime"/> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
|
|
<sql id="allColumns"> |
|
|
|
wcubi.`id`,wcubi.`phone`,wcubi.`birthdate`,wcubi.`education`,wcubi.`sex`,wcubi.`height`,wcubi.`weight`,wcubi.`id_card`,wcubi.`email`, |
|
|
|
wcubi.`address`,wcubi.`poins`,wcubi.`tag_id`,wcubi.`create_date`,wcubi.`update_date`, |
|
|
|
wcubi.`final_tenant_id`,wcubi.`tenant_id`,wcubi.`parent_tenant_id`,wcubi.`name`,wcubi.`nick_name`, |
|
|
|
wcubi.`avatar_url`,wcubi.`credit`,wcubi.`active_time`,wcubi.`login_count`,wcubi.`act_record`, |
|
|
|
wcubi.score_date,wcubi.status,wcubi1.code,wcubi1.version,wcubi1.expire_time |
|
|
|
</sql> |
|
|
|
|
|
|
|
<sql id="dynamicWhereConditions"> |
|
|
|
where 1=1 |
|
|
|
|
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and wcubi.`tenant_id` like concat('%,', #{tenantId},',%') |
|
|
|
</if> |
|
|
|
<if test=" null != id "> |
|
|
|
and wcubi.`id` = #{id} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != phone "> |
|
|
|
and wcubi.`phone` like concat('%', #{phone},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != birthdate "> |
|
|
|
and wcubi.`birthdate` = #{birthdate} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != education "> |
|
|
|
and wcubi.`education` like concat('%', #{education},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != sex "> |
|
|
|
and wcubi.`sex` = #{sex} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != email "> |
|
|
|
and wcubi.`email` like concat('%', #{email},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != address "> |
|
|
|
and wcubi.`address` like concat('%', #{address},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != levelStartScore "> |
|
|
|
and wcubi.poins >= #{levelStartScore} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != levelEndScore"> |
|
|
|
and wcubi.poins < #{levelEndScore} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != tagId "> |
|
|
|
and wcubi.`tag_id` = #{tagId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != createDate "> |
|
|
|
and wcubi.`create_date` = #{createDate} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != updateDate "> |
|
|
|
and wcubi.`update_date` = #{updateDate} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != actRecord "> |
|
|
|
and wcubi.`act_record` = #{actRecord} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != name "> |
|
|
|
and wcubi.`name` like concat('%', #{name},'%') |
|
|
|
</if> |
|
|
|
<if test=" null != startTime and null != endTime"> |
|
|
|
and wcubi.`create_date` between #{startTime} and #{endTime} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != activeStartTime and null != activeEndTime"> |
|
|
|
and wcubi.`active_time` between #{activeStartTime} and #{activeEndTime} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != status "> |
|
|
|
and wcubi.`status` = #{status} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != ids "> |
|
|
|
and wcubi.id in |
|
|
|
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> |
|
|
|
#{idItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != sortColumns">order by ${sortColumns}</if> |
|
|
|
|
|
|
|
</sql> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectById" parameterType="java.util.HashMap" resultMap="BaseResultMap"> |
|
|
|
select * |
|
|
|
from wx_c_user_live_basic_info wcubi1 |
|
|
|
where wcubi1.id =#{id} |
|
|
|
</select> |
|
|
|
|
|
|
|
<update id="updateCode"> |
|
|
|
update wx_c_user_live_basic_info set code = #{mcode} where id = #{id} |
|
|
|
</update> |
|
|
|
|
|
|
|
|
|
|
|
<sql id="allColumnsOfScoreList"> |
|
|
|
wcubi.id,wcubi.phone,wcubi.birthdate,wcubi.education,wcubi.sex,wcubi.`height`,wcubi.`weight`,wcubi.`id_card`,wcubi.email,wcubi.address,wcubi.poins,wcubi.tag_id, |
|
|
|
wcubi.create_date,wcubi.update_date,wcubi.name,wcubi.level,wcubi.nick_name,wcubi.score_date,wcubi.final_tenant_id |
|
|
|
</sql> |
|
|
|
|
|
|
|
|
|
|
|
<resultMap id="VoBaseResultMap" type="com.iformall.domain.vo.WxCUserBasicInfoVo"> |
|
|
|
<id column="id" jdbcType="BIGINT" property="id"/> |
|
|
|
<result column="phone" jdbcType="VARCHAR" property="phone"/> |
|
|
|
<result column="birthdate" jdbcType="TIMESTAMP" property="birthdate"/> |
|
|
|
<result column="education" jdbcType="VARCHAR" property="education"/> |
|
|
|
<result column="sex" jdbcType="INTEGER" property="sex"/> |
|
|
|
<result column="height" jdbcType="VARCHAR" property="height"/> |
|
|
|
<result column="weight" jdbcType="VARCHAR" property="weight"/> |
|
|
|
<result column="id_card" jdbcType="VARCHAR" property="idCard"/> |
|
|
|
<result column="email" jdbcType="VARCHAR" property="email"/> |
|
|
|
<result column="address" jdbcType="VARCHAR" property="address"/> |
|
|
|
<result column="poins" jdbcType="INTEGER" property="poins"/> |
|
|
|
<result column="tag_id" jdbcType="BIGINT" property="tagId"/> |
|
|
|
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> |
|
|
|
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> |
|
|
|
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> |
|
|
|
<result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/> |
|
|
|
<result column="final_tenant_id" jdbcType="VARCHAR" property="finalTenantId"/> |
|
|
|
<result column="name" jdbcType="VARCHAR" property="name"/> |
|
|
|
<result column="level" jdbcType="VARCHAR" property="level"/> |
|
|
|
<result column="nick_name" jdbcType="VARCHAR" property="nickName"/> |
|
|
|
<result column="credit" jdbcType="INTEGER" property="credit"/> |
|
|
|
<result column="tags" jdbcType="VARCHAR" property="tags"/> |
|
|
|
<result column="active_time" jdbcType="TIMESTAMP" property="activeTime"/> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="dynamicVoWhereConditions"> |
|
|
|
where 1=1 |
|
|
|
|
|
|
|
<if test=" null != id "> |
|
|
|
and wcubi.`id` = #{id} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and wcubi.`tenant_id` like concat('%,', #{tenantId},',%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != phone and '' != phone"> |
|
|
|
and wcubi.`phone` like concat('%', #{phone},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != birthdate "> |
|
|
|
and wcubi.`birthdate` = #{birthdate} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != education and '' != education"> |
|
|
|
and wcubi.`education` like concat('%', #{education},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != sex "> |
|
|
|
and wcubi.`sex` = #{sex} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != email and '' != email"> |
|
|
|
and wcubi.`email` like concat('%', #{email},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != address and '' != address"> |
|
|
|
and wcubi.`address` like concat('%', #{address},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != poins "> |
|
|
|
and wcubi.`poins` = #{poins} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != tagId "> |
|
|
|
and wcubi.`tag_id` = #{tagId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != createDate "> |
|
|
|
and wcubi.`create_date` = #{createDate} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != updateDate "> |
|
|
|
and wcubi.`update_date` = #{updateDate} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != actRecord "> |
|
|
|
and wcubi.`act_record` = #{actRecord} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != name and '' != name"> |
|
|
|
and wcubi.`name` like concat('%', #{name},'%') |
|
|
|
</if> |
|
|
|
<if test=" null != startTime and null!=endTime"> |
|
|
|
and wcubi.`create_date` between #{startTime} and #{endTime} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != activeStartTime and null!=activeEndTime"> |
|
|
|
and wcubi.`active_time` between #{activeStartTime} and #{activeEndTime} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != ids "> |
|
|
|
and wcubi.id in |
|
|
|
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> |
|
|
|
#{idItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
order by wcubi.`active_time` DESC |
|
|
|
<!--<if test=" null != sortColumns">order by ${sortColumns}</if>--> |
|
|
|
</sql> |
|
|
|
|
|
|
|
<sql id="filterWhereConditions"> |
|
|
|
where 1=1 |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and wcubi.`tenant_id` like concat('%,', #{tenantId},',%') |
|
|
|
</if> |
|
|
|
<if test=" null != startTime "> |
|
|
|
and wcubi.create_date >= #{startTime} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != endTime"> |
|
|
|
and wcubi.create_date <= #{endTime} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != birthStartTime "> |
|
|
|
and wcubi.birthdate >= #{birthStartTime} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != birthEndTime"> |
|
|
|
and wcubi.birthdate < #{birthEndTime} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != loginStartTime "> |
|
|
|
and wcubi.active_time >= #{loginStartTime} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != loginEndTime"> |
|
|
|
and wcubi.active_time <= #{loginEndTime} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != phones"> |
|
|
|
and wcubi.phone in (${phones}) |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != levelStartScore and (0 != levelStartScore and '' != levelStartScore)"> |
|
|
|
and wcubi.poins >= #{levelStartScore} |
|
|
|
<if test=" null != levelEndScore"> |
|
|
|
and wcubi.poins < #{levelEndScore} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != levelStartScore and (0 == levelStartScore or '' == levelStartScore)"> |
|
|
|
and (wcubi.poins is null or |
|
|
|
(wcubi.poins >= #{levelStartScore} |
|
|
|
<if test=" null != levelEndScore"> |
|
|
|
and wcubi.poins < #{levelEndScore} |
|
|
|
</if> |
|
|
|
)) |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != ids "> |
|
|
|
and wcubi.id in |
|
|
|
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> |
|
|
|
#{idItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != tagIds "> |
|
|
|
and wcubi.`tag_id` in |
|
|
|
<foreach collection="tagIds" index="index" item="tagIdItem" open="(" separator="," close=")"> |
|
|
|
#{tagIdItem} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test=" null != sortColumns">order by ${sortColumns}</if> |
|
|
|
</sql> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</mapper> |