New file |
| | |
| | | package com.ks.daylucky.exception; |
| | | |
| | | import com.ks.lib.common.exception.BaseException; |
| | | |
| | | public class UserInfoExtraException extends BaseException { |
| | | |
| | | |
| | | public UserInfoExtraException(int code, String msg) { |
| | | super(code, msg); |
| | | } |
| | | } |
| | |
| | | import com.ks.daylucky.pojo.DO.ActivityScanRecord; |
| | | import com.ks.daylucky.query.ActivityScanQuery; |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ActivityScanRecordMapper extends BaseMapper<ActivityScanRecord> { |
| | | |
| | | List<ActivityScanRecord> list(ActivityScanQuery query); |
| | | List<ActivityScanRecord> list(@Param("query") ActivityScanQuery query); |
| | | |
| | | long count(ActivityScanQuery query); |
| | | long count(@Param("query")ActivityScanQuery query); |
| | | |
| | | } |
| | |
| | | import com.ks.daylucky.pojo.DO.Announcement; |
| | | import com.ks.daylucky.query.AnnouncementQuery; |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface AnnouncementMapper extends BaseMapper<Announcement> { |
| | | |
| | | List<Announcement> list(AnnouncementQuery query); |
| | | List<Announcement> list(@Param("query") AnnouncementQuery query); |
| | | |
| | | long count(@Param("query") AnnouncementQuery query); |
| | | |
| | | } |
| | |
| | | import com.ks.daylucky.pojo.DO.AppConfig; |
| | | import com.ks.daylucky.query.AppConfigQuery; |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface AppConfigMapper extends BaseMapper<AppConfig> { |
| | | |
| | | List<AppConfig> list(AppConfigQuery query); |
| | | List<AppConfig> list(@Param("query") AppConfigQuery query); |
| | | |
| | | long count(AppConfigQuery query); |
| | | long count(@Param("query") AppConfigQuery query); |
| | | } |
| | |
| | | import com.ks.daylucky.pojo.DO.MsgTypeConfig; |
| | | import com.ks.daylucky.query.MsgTypeConfigQuery; |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface MsgTypeConfigMapper extends BaseMapper<MsgTypeConfig> { |
| | | |
| | | List<MsgTypeConfig> list(MsgTypeConfigQuery query); |
| | | List<MsgTypeConfig> list(@Param("query") MsgTypeConfigQuery query); |
| | | |
| | | long count(@Param("query") MsgTypeConfigQuery query); |
| | | |
| | | } |
| | |
| | | |
| | | public interface UserInfoExtraMapper extends BaseMapper<UserInfoExtra> { |
| | | |
| | | UserInfoExtra selectByPrimaryKeyForUpdate(Long uid); |
| | | |
| | | } |
| | |
| | | package com.ks.daylucky.mapper; |
| | | |
| | | import com.ks.daylucky.pojo.DO.UserInfo; |
| | | import com.ks.daylucky.query.UserInfoQuery; |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface UserInfoMapper extends BaseMapper<UserInfo> { |
| | | |
| | | List<UserInfo> list(@Param("query") UserInfoQuery query); |
| | | |
| | | long count(@Param("query") UserInfoQuery query); |
| | | |
| | | } |
| | |
| | | import com.ks.daylucky.pojo.DO.UserMsg; |
| | | import com.ks.daylucky.query.UserMsgQuery; |
| | | import com.ks.lib.common.dao.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface UserMsgMapper extends BaseMapper<UserMsg> { |
| | | |
| | | List<UserMsg> list(UserMsgQuery query); |
| | | List<UserMsg> list(@Param("query") UserMsgQuery query); |
| | | |
| | | long count(UserMsgQuery query); |
| | | long count(@Param("query") UserMsgQuery query); |
| | | } |
| | |
| | | package com.ks.daylucky.pojo.DO; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | |
| | | public class UserInfo { |
| | | private Long id; |
| | | |
| | | @NotNull(message = "应用ID不能为空") |
| | | private Long appId; |
| | | |
| | | @NotNull(message = "应用唯一标识不能为空") |
| | | private String identifyCode; |
| | | |
| | | private String nickName; |
| | |
| | | |
| | | private Date updateTime; |
| | | |
| | | private UserInfoExtra userInfoExtra; |
| | | |
| | | |
| | | public UserInfoExtra getUserInfoExtra() { |
| | | return userInfoExtra; |
| | | } |
| | | |
| | | public void setUserInfoExtra(UserInfoExtra userInfoExtra) { |
| | | this.userInfoExtra = userInfoExtra; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | |
| | | package com.ks.daylucky.pojo.DTO; |
| | | |
| | | import com.google.gson.Gson; |
| | | import org.yeshi.utils.StringUtil; |
| | | |
| | | public class UserMsgSettings { |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new Gson().toJson(this); |
| | | } |
| | | |
| | | |
| | | public static UserMsgSettings parse(String settings) { |
| | | if (StringUtil.isNullOrEmpty(settings)) { |
| | | settings = "{}"; |
| | | } |
| | | return new Gson().fromJson(settings, UserMsgSettings.class); |
| | | } |
| | | } |
| | |
| | | package com.ks.daylucky.service; |
| | | |
| | | import com.ks.daylucky.exception.UserInfoExtraException; |
| | | import com.ks.daylucky.pojo.DO.UserInfoExtra; |
| | | import com.ks.daylucky.pojo.DTO.UserMsgSettings; |
| | | |
| | | public interface UserInfoExtraService { |
| | | |
| | | |
| | | /** |
| | | * 初始化 |
| | | * @param uid |
| | | */ |
| | | public void init(Long uid); |
| | | |
| | | /** |
| | | * 获取详情 |
| | |
| | | * |
| | | * @param uid |
| | | */ |
| | | public void setMsgRead(Long uid); |
| | | public void setMsgRead(Long uid) throws UserInfoExtraException; |
| | | |
| | | |
| | | /** |
| | | * 消息设置 |
| | | * |
| | | * @param uid |
| | | * @param setting |
| | | */ |
| | | public void setUserMsgSetting(UserMsgSettings setting); |
| | | public void setUserMsgSetting(Long uid, UserMsgSettings setting); |
| | | |
| | | /** |
| | | * 获取用户消息设置信息 |
| | |
| | | package com.ks.daylucky.service.impl.remote; |
| | | |
| | | import com.ks.daylucky.exception.UserInfoExtraException; |
| | | import com.ks.daylucky.mapper.UserInfoExtraMapper; |
| | | import com.ks.daylucky.pojo.DO.UserInfoExtra; |
| | | import com.ks.daylucky.pojo.DTO.UserMsgSettings; |
| | |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | @Service(version = "1.0.0") |
| | | public class UserInfoExtraServiceImpl implements UserInfoExtraService { |
| | |
| | | |
| | | |
| | | @Override |
| | | public void init(Long uid) { |
| | | UserInfoExtra extra = new UserInfoExtra(); |
| | | extra.setCreateTime(new Date()); |
| | | extra.setMsgSetting(new UserMsgSettings().toString()); |
| | | extra.setMsgUnreadCount(0); |
| | | userInfoExtraMapper.insertSelective(extra); |
| | | } |
| | | |
| | | @Override |
| | | public UserInfoExtra getUserInfoExtra(Long uid) { |
| | | return null; |
| | | return userInfoExtraMapper.selectByPrimaryKey(uid); |
| | | } |
| | | |
| | | @Override |
| | | public void setMsgRead(Long uid) { |
| | | |
| | | public void setMsgRead(Long uid) throws UserInfoExtraException { |
| | | UserInfoExtra extra = new UserInfoExtra(); |
| | | extra.setUid(uid); |
| | | extra.setMsgUnreadCount(0); |
| | | extra.setUpdateTime(new Date()); |
| | | userInfoExtraMapper.updateByPrimaryKeySelective(extra); |
| | | } |
| | | |
| | | @Override |
| | | public void setUserMsgSetting(UserMsgSettings setting) { |
| | | |
| | | public void setUserMsgSetting(Long uid, UserMsgSettings setting) { |
| | | UserInfoExtra extra = new UserInfoExtra(); |
| | | extra.setUid(uid); |
| | | extra.setMsgSetting(setting.toString()); |
| | | extra.setUpdateTime(new Date()); |
| | | userInfoExtraMapper.updateByPrimaryKeySelective(extra); |
| | | } |
| | | |
| | | @Override |
| | | public UserMsgSettings getUserMsgSettings(Long uid) { |
| | | return null; |
| | | UserInfoExtra userInfoExtra = userInfoExtraMapper.selectByPrimaryKeyForUpdate(uid); |
| | | String msg = userInfoExtra.getMsgSetting(); |
| | | return UserMsgSettings.parse(msg); |
| | | } |
| | | } |
| | |
| | | import com.ks.daylucky.mapper.UserInfoExtraMapper; |
| | | import com.ks.daylucky.mapper.UserInfoMapper; |
| | | import com.ks.daylucky.pojo.DO.UserInfo; |
| | | import com.ks.daylucky.pojo.DO.UserInfoExtra; |
| | | import com.ks.daylucky.query.UserInfoQuery; |
| | | import com.ks.daylucky.service.UserInfoExtraService; |
| | | import com.ks.daylucky.service.UserInfoService; |
| | | import org.apache.dubbo.config.annotation.Service; |
| | | import org.springframework.validation.annotation.Validated; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service(version = "1.0.0") |
| | |
| | | @Resource |
| | | private UserInfoExtraMapper userInfoExtraMapper; |
| | | |
| | | @Resource |
| | | private UserInfoExtraService userInfoExtraService; |
| | | |
| | | @Override |
| | | public UserInfo getUserInfo(Long appId, String identifyCode) { |
| | | UserInfoQuery query = new UserInfoQuery(); |
| | | query.appId = appId; |
| | | query.identifyCode = identifyCode; |
| | | query.count = 1; |
| | | List<UserInfo> list = userInfoMapper.list(query); |
| | | if (list != null && list.size() > 0) { |
| | | return list.get(0); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Validated |
| | | @Override |
| | | public Long addUserInfo(@Valid UserInfo userInfo) throws ParameterException, UserInfoException { |
| | | return null; |
| | | UserInfo old = getUserInfo(userInfo.getAppId(), userInfo.getIdentifyCode()); |
| | | if (old != null) { |
| | | throw new UserInfoException(UserInfoException.CODE_EXIST, "用户已存在"); |
| | | } |
| | | |
| | | if (userInfo.getCreateTime() != null) { |
| | | userInfo.setCreateTime(new Date()); |
| | | } |
| | | userInfoMapper.insertSelective(userInfo); |
| | | |
| | | //初始化附加信息 |
| | | userInfoExtraService.init(userInfo.getId()); |
| | | return userInfo.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public List<UserInfo> getUserList(UserInfoQuery query, int page, int pageSize) { |
| | | return null; |
| | | query.start = (page - 1) * pageSize; |
| | | query.count = pageSize; |
| | | return userInfoMapper.list(query); |
| | | } |
| | | |
| | | @Override |
| | | public long countUser(UserInfoQuery query) { |
| | | return 0; |
| | | return userInfoMapper.count(query); |
| | | } |
| | | |
| | | @Override |
| | | public UserInfo getUserDetail(Long appId, String identifyCode) { |
| | | UserInfo userInfo = getUserInfo(appId, identifyCode); |
| | | if (userInfo == null) { |
| | | return null; |
| | | } |
| | | |
| | | UserInfoExtra extra = userInfoExtraMapper.selectByPrimaryKey(userInfo.getId()); |
| | | userInfo.setUserInfoExtra(extra); |
| | | return userInfo; |
| | | } |
| | | |
| | | @Override |
| | | public UserInfo getUserDetail(Long id) { |
| | | UserInfo userInfo = userInfoMapper.selectByPrimaryKey(id); |
| | | if (userInfo == null) { |
| | | return null; |
| | | } |
| | | UserInfoExtra extra = userInfoExtraMapper.selectByPrimaryKey(userInfo.getId()); |
| | | userInfo.setUserInfoExtra(extra); |
| | | return userInfo; |
| | | } |
| | | |
| | | @Override |
| | | public void updateUserInfo(UserInfo userInfo) { |
| | | |
| | | if (userInfo == null || userInfo.getId() == null) { |
| | | return; |
| | | } |
| | | userInfo.setUpdateTime(new Date()); |
| | | userInfoMapper.updateByPrimaryKeySelective(userInfo); |
| | | } |
| | | } |
| | |
| | | from activity_scan_record |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <!-- 非模板 --> |
| | | |
| | | <sql id="listWhere"> |
| | | <if test="query.activityId!=null"> |
| | | and activity_id=#{query.activityId} |
| | | </if> |
| | | |
| | | <if test="query.uid!=null"> |
| | | and uid=#{query.uid} |
| | | </if> |
| | | |
| | | <if test="query.minCreateTime!=null"> |
| | | and create_time>=#{query.minCreateTime} |
| | | </if> |
| | | |
| | | <if test="query.maxCreateTime!=null"> |
| | | and #{query.maxCreateTime}>create_time |
| | | </if> |
| | | |
| | | </sql> |
| | | |
| | | |
| | | <select id="list" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from activity_scan_record |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | |
| | | |
| | | <if test="query.sortList!=null"> |
| | | <foreach collection="query.sortList" item="item" separator="," open=" order by "> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | limit #{query.start},#{query.count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from activity_scan_record |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > |
| | | delete from activity_scan_record |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.daylucky.pojo.DO.ActivityScanRecord" > |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id" |
| | | parameterType="com.ks.daylucky.pojo.DO.ActivityScanRecord"> |
| | | insert into activity_scan_record (id, uid, activity_id, |
| | | create_time, update_time) |
| | | values (#{id,jdbcType=BIGINT}, #{uid,jdbcType=BIGINT}, #{activityId,jdbcType=BIGINT}, |
| | | #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.daylucky.pojo.DO.ActivityScanRecord" > |
| | | <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" |
| | | parameterType="com.ks.daylucky.pojo.DO.ActivityScanRecord"> |
| | | insert into activity_scan_record |
| | | <trim prefix="(" suffix=")" suffixOverrides="," > |
| | | <if test="id != null" > |
| | |
| | | from activity_tag |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="listByActivityId" resultMap="BaseResultMap" parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from activity_tag |
| | | where activity_id = #{0} |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > |
| | | delete from activity_tag |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.daylucky.pojo.DO.ActivityTag" > |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.daylucky.pojo.DO.ActivityTag"> |
| | | insert into activity_tag (id, activity_id, tag_name, |
| | | tag_bg_color, tag_font_colr, create_time, |
| | | update_time, weight) |
| | |
| | | #{tagBgColor,jdbcType=VARCHAR}, #{tagFontColr,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, |
| | | #{updateTime,jdbcType=TIMESTAMP}, #{weight,jdbcType=INTEGER}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.daylucky.pojo.DO.ActivityTag" > |
| | | <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" |
| | | parameterType="com.ks.daylucky.pojo.DO.ActivityTag"> |
| | | insert into activity_tag |
| | | <trim prefix="(" suffix=")" suffixOverrides="," > |
| | | <if test="id != null" > |
| | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from announcement where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!-- 非模板 --> |
| | | |
| | | <sql id="listWhere"> |
| | | <if test="query.appId!=null"> |
| | | and app_id=#{query.appId} |
| | | </if> |
| | | |
| | | <if test="query.type!=null"> |
| | | and type=#{query.type} |
| | | </if> |
| | | |
| | | <if test="query.key!=null"> |
| | | and `name` like '${query.key}%' |
| | | </if> |
| | | |
| | | <if test="query.minCreateTime!=null"> |
| | | and create_time>=#{query.minCreateTime} |
| | | </if> |
| | | |
| | | <if test="query.maxCreateTime!=null"> |
| | | and #{query.maxCreateTime}>create_time |
| | | </if> |
| | | |
| | | </sql> |
| | | |
| | | |
| | | <select id="list" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from announcement |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | |
| | | |
| | | <if test="query.sortList!=null"> |
| | | <foreach collection="query.sortList" item="item" separator="," open=" order by "> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | limit #{query.start},#{query.count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from announcement |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" |
| | | parameterType="java.lang.Long">delete from announcement where id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.ks.daylucky.pojo.DO.Announcement" useGeneratedKeys="true" |
| | |
| | | from app_config |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!-- 非模板 --> |
| | | |
| | | <sql id="listWhere"> |
| | | <if test="query.appId!=null"> |
| | | and app_id=#{query.appId} |
| | | </if> |
| | | |
| | | <if test="query.key!=null"> |
| | | and key=#{query.key} |
| | | </if> |
| | | |
| | | <if test="query.minVersion!=null"> |
| | | and min_version=#{query.minVersion} |
| | | </if> |
| | | |
| | | <if test="query.nameKey!=null"> |
| | | and `name` like '${query.nameKey}%' |
| | | </if> |
| | | |
| | | <if test="query.version!=null"> |
| | | and #{query.version}>=min_version |
| | | </if> |
| | | |
| | | <if test="query.minCreateTime!=null"> |
| | | and create_time>=#{query.minCreateTime} |
| | | </if> |
| | | |
| | | <if test="query.maxCreateTime!=null"> |
| | | and #{query.maxCreateTime}>create_time |
| | | </if> |
| | | |
| | | </sql> |
| | | |
| | | |
| | | <select id="list" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from app_config |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | |
| | | |
| | | <if test="query.sortList!=null"> |
| | | <foreach collection="query.sortList" item="item" separator="," open=" order by "> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | limit #{query.start},#{query.count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from app_config |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > |
| | | delete from app_config |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.daylucky.pojo.DO.AppConfig" > |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.daylucky.pojo.DO.AppConfig"> |
| | | insert into app_config (id, app_id, name, |
| | | key, value, min_version, |
| | | remarks, create_time, update_time |
| | |
| | | #{remarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.daylucky.pojo.DO.AppConfig" > |
| | | <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" |
| | | parameterType="com.ks.daylucky.pojo.DO.AppConfig"> |
| | | insert into app_config |
| | | <trim prefix="(" suffix=")" suffixOverrides="," > |
| | | <if test="id != null" > |
| | |
| | | from msg_type_config |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <!-- 非模板 --> |
| | | |
| | | <sql id="listWhere"> |
| | | <if test="query.appId!=null"> |
| | | and app_id=#{query.appId} |
| | | </if> |
| | | |
| | | <if test="query.msgType!=null"> |
| | | and msg_type=#{query.msgType} |
| | | </if> |
| | | |
| | | <if test="query.minCreateTime!=null"> |
| | | and create_time>=#{query.minCreateTime} |
| | | </if> |
| | | |
| | | <if test="query.maxCreateTime!=null"> |
| | | and #{query.maxCreateTime}>create_time |
| | | </if> |
| | | |
| | | </sql> |
| | | |
| | | |
| | | <select id="list" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from msg_type_config |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | |
| | | |
| | | <if test="query.sortList!=null"> |
| | | <foreach collection="query.sortList" item="item" separator="," open=" order by "> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | limit #{query.start},#{query.count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from msg_type_config |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > |
| | | delete from msg_type_config |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.daylucky.pojo.DO.MsgTypeConfig" > |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.daylucky.pojo.DO.MsgTypeConfig"> |
| | | insert into msg_type_config (id, app_id, msg_type, |
| | | msg_name, msg_icon, create_time, |
| | | update_time) |
| | |
| | | #{msgName,jdbcType=VARCHAR}, #{msgIcon,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, |
| | | #{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.daylucky.pojo.DO.MsgTypeConfig" > |
| | | <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" |
| | | parameterType="com.ks.daylucky.pojo.DO.MsgTypeConfig"> |
| | | insert into msg_type_config |
| | | <trim prefix="(" suffix=")" suffixOverrides="," > |
| | | <if test="id != null" > |
| | |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from user_info_extra |
| | | where uid = #{uid,jdbcType=BIGINT} |
| | | where uid = #{0} |
| | | </select> |
| | | |
| | | <select id="selectByPrimaryKeyForUpdate" resultMap="BaseResultMap" parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from user_info_extra |
| | | where uid = #{0} for update |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > |
| | | delete from user_info_extra |
| | | where uid = #{uid,jdbcType=BIGINT} |
| | | where uid = #{0} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.daylucky.pojo.DO.UserInfoExtra" > |
| | | insert into user_info_extra (uid, msg_setting, msg_unread_count, |
| | |
| | | values (#{uid,jdbcType=BIGINT}, #{msgSetting,jdbcType=VARCHAR}, #{msgUnreadCount,jdbcType=INTEGER}, |
| | | #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.daylucky.pojo.DO.UserInfoExtra" > |
| | | <insert id="insertSelective" |
| | | parameterType="com.ks.daylucky.pojo.DO.UserInfoExtra"> |
| | | insert into user_info_extra |
| | | <trim prefix="(" suffix=")" suffixOverrides="," > |
| | | <if test="uid != null" > |
| | |
| | | from user_info |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <!-- 非模板 --> |
| | | |
| | | <sql id="listWhere"> |
| | | <if test="query.appId!=null"> |
| | | and app_id=#{query.appId} |
| | | </if> |
| | | |
| | | <if test="query.identifyCode!=null"> |
| | | and identify_code=#{query.identifyCode} |
| | | </if> |
| | | |
| | | <if test="query.key!=null"> |
| | | and nick_name like '${query.key}%' |
| | | </if> |
| | | |
| | | <if test="query.mobile!=null"> |
| | | and mobile=#{query.mobile} |
| | | </if> |
| | | |
| | | <if test="query.alipayUid!=null"> |
| | | and alipay_uid=#{query.alipayUid} |
| | | </if> |
| | | |
| | | <if test="query.wxOpenId!=null"> |
| | | and wx_open_id=#{query.wxOpenId} |
| | | </if> |
| | | |
| | | <if test="query.wxUnionId!=null"> |
| | | and wx_union_id=#{query.wxUnionId} |
| | | </if> |
| | | |
| | | |
| | | <if test="query.minCreateTime!=null"> |
| | | and create_time>=#{query.minCreateTime} |
| | | </if> |
| | | |
| | | <if test="query.maxCreateTime!=null"> |
| | | and #{query.maxCreateTime}>create_time |
| | | </if> |
| | | |
| | | </sql> |
| | | |
| | | |
| | | <select id="list" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from user_info |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | |
| | | |
| | | <if test="query.sortList!=null"> |
| | | <foreach collection="query.sortList" item="item" separator="," open=" order by "> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | limit #{query.start},#{query.count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from user_info |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > |
| | | delete from user_info |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.daylucky.pojo.DO.UserInfo" > |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.daylucky.pojo.DO.UserInfo"> |
| | | insert into user_info (id, app_id, identify_code, |
| | | nick_name, portrait, mobile, |
| | | alipay_uid, alipay_portrait, wx_open_id, |
| | |
| | | #{wxUnionId,jdbcType=VARCHAR}, #{wxPortrait,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, |
| | | #{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.daylucky.pojo.DO.UserInfo" > |
| | | <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" |
| | | parameterType="com.ks.daylucky.pojo.DO.UserInfo"> |
| | | insert into user_info |
| | | <trim prefix="(" suffix=")" suffixOverrides="," > |
| | | <if test="id != null" > |
| | |
| | | from user_msg |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <!-- 非模板 --> |
| | | |
| | | <sql id="listWhere"> |
| | | <if test="query.uid!=null"> |
| | | and uid=#{query.uid} |
| | | </if> |
| | | |
| | | <if test="query.msgType!=null"> |
| | | and msg_type=#{query.msgType} |
| | | </if> |
| | | |
| | | <if test="query.minCreateTime!=null"> |
| | | and create_time>=#{query.minCreateTime} |
| | | </if> |
| | | |
| | | <if test="query.maxCreateTime!=null"> |
| | | and #{query.maxCreateTime}>create_time |
| | | </if> |
| | | |
| | | </sql> |
| | | |
| | | |
| | | <select id="list" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from user_msg |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | |
| | | |
| | | <if test="query.sortList!=null"> |
| | | <foreach collection="query.sortList" item="item" separator="," open=" order by "> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | limit #{query.start},#{query.count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from user_msg |
| | | where 1=1 |
| | | <include refid="listWhere"> |
| | | |
| | | </include> |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > |
| | | delete from user_msg |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.ks.daylucky.pojo.DO.UserMsg" > |
| | | |
| | | <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.daylucky.pojo.DO.UserMsg" > |
| | | insert into user_msg (id, uid, msg_type, |
| | | msg_content, create_time, update_time |
| | | ) |
| | |
| | | #{msgContent,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.ks.daylucky.pojo.DO.UserMsg" > |
| | | <insert id="insertSelective" useGeneratedKeys="true" keyProperty="id" parameterType="com.ks.daylucky.pojo.DO.UserMsg" > |
| | | insert into user_msg |
| | | <trim prefix="(" suffix=")" suffixOverrides="," > |
| | | <if test="id != null" > |