| | |
| | | private String beiZhu;// 备注
|
| | | @Column(name = "mo_read")
|
| | | private Boolean read;
|
| | | @Column(name = "mo_source_id") // 源主键ID
|
| | | private Long sourceId;
|
| | | @Column(name = "mo_create_time")
|
| | | private Date createTime;
|
| | | @Column(name = "mo_update_time")
|
| | |
| | | public void setBeiZhu(String beiZhu) {
|
| | | this.beiZhu = beiZhu;
|
| | | }
|
| | |
|
| | | public Long getSourceId() {
|
| | | return sourceId;
|
| | | }
|
| | |
|
| | | public void setSourceId(Long sourceId) {
|
| | | this.sourceId = sourceId;
|
| | | }
|
| | | }
|
| | |
| | | <result column="mo_content" property="content" jdbcType="VARCHAR" /> |
| | | <result column="mo_beizhu" property="beiZhu" jdbcType="VARCHAR" /> |
| | | <result column="mo_read" property="read" jdbcType="BOOLEAN" /> |
| | | <result column="mo_source_id" property="sourceId" jdbcType="BIGINT" /> |
| | | <result column="mo_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="mo_update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | <association property="user" column="mo_uid" |
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="mo_uid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | <sql id="Base_Column_List">mo_id,mo_uid,mo_type,mo_content,mo_beizhu,mo_read,mo_create_time,mo_update_time |
| | | <sql id="Base_Column_List">mo_id,mo_uid,mo_type,mo_content,mo_beizhu,mo_read,mo_create_time,mo_update_time,mo_source_id |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_msg_other where mo_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="listByUid" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_msg_other where mo_uid = #{uid,jdbcType=BIGINT} order by |
| | | mo_create_time desc limit #{start},#{count} |
| | | </select> |
| | | |
| | | |
| | | <select id="countByUid" resultType="java.lang.Long" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | count(mo_id) |
| | | from yeshi_ec_msg_other where mo_uid = |
| | | #{uid,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | |
| | | parameterType="java.lang.Long">select count(mo_id) from yeshi_ec_msg_other where mo_uid |
| | | = #{uid,jdbcType=BIGINT}</select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_msg_other where mo_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | yeshi_ec_msg_other where mo_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.msg.MsgOtherDetail" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_msg_other |
| | | (mo_id,mo_uid,mo_type,mo_content,mo_beizhu,mo_read,mo_create_time,mo_update_time) |
| | | (mo_id,mo_uid,mo_type,mo_content,mo_beizhu,mo_read,mo_create_time,mo_update_time,mo_source_id) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{read,jdbcType=BOOLEAN},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{read,jdbcType=BOOLEAN},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{sourceId,jdbcType=BIGINT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgOtherDetail" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="read != null">mo_read,</if> |
| | | <if test="createTime != null">mo_create_time,</if> |
| | | <if test="updateTime != null">mo_update_time,</if> |
| | | <if test="sourceId != null">mo_source_id,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="read != null">#{read,jdbcType=BOOLEAN},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="sourceId != null">#{sourceId,jdbcType=BIGINT}</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.msg.MsgOtherDetail">update |
| | |
| | | #{beiZhu,jdbcType=VARCHAR},mo_read = |
| | | #{read,jdbcType=BOOLEAN},mo_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},mo_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP} where mo_id = #{id,jdbcType=BIGINT} |
| | | #{updateTime,jdbcType=TIMESTAMP} ,mo_source_id |
| | | =#{sourceId,jdbcType=BIGINT} where mo_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgOtherDetail"> |
| | | update yeshi_ec_msg_other |
| | |
| | | <if test="read != null">mo_read=#{read,jdbcType=BOOLEAN},</if> |
| | | <if test="createTime != null">mo_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">mo_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="sourceId !=null">mo_source_id =#{sourceId,jdbcType=BIGINT},</if> |
| | | </set> |
| | | where mo_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <update id="setMsgReadByUid" parameterType="java.lang.Long"> |
| | | update |
| | | yeshi_ec_msg_other |
| | | set mo_read=1 |
| | | where mo_uid = #{uid,jdbcType=BIGINT} |
| | | <update id="setMsgReadByUid" parameterType="java.lang.Long">update |
| | | yeshi_ec_msg_other set mo_read=1 where mo_uid = #{uid,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createWelfareCouponGet(getLeftDay(coupon),
|
| | | coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
|
| | | MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createWelfareCouponActive(getLeftDay(coupon),
|
| | | coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
|
| | | MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createWelfareCouponUsing(coupon.getStartTime(),
|
| | | coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
|
| | | MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createWelfareCouponUsed(getLeftDay(coupon),
|
| | | coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
|
| | | MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory
|
| | | .createWelfareCouponWillOutOfDate(getLeftDay(coupon), coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
|
| | | MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory
|
| | | .createWelfareCouponAlreadyOutOfDate(coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
|
| | | MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createCouponGet(getLeftDay(coupon),
|
| | | coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
|
| | | MsgTypeOtherTypeEnum.couponMianDan, null));
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponMianDan, null));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createCouponActive(getLeftDay(coupon),
|
| | | coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
|
| | | MsgTypeOtherTypeEnum.couponMianDan, null));
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponMianDan, null));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createCouponUsing(coupon.getSource(),
|
| | | coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
|
| | | MsgTypeOtherTypeEnum.couponMianDan, null));
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponMianDan, null));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createCouponUsed(getLeftDay(coupon),
|
| | | coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
|
| | | MsgTypeOtherTypeEnum.couponMianDan, null));
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponMianDan, null));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createCouponWillOutOfDate(getLeftDay(coupon),
|
| | | coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
|
| | | MsgTypeOtherTypeEnum.couponMianDan, null));
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponMianDan, null));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createCouponAlreadyOutOfDate(coupon.getSource(),
|
| | | coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
|
| | | MsgTypeOtherTypeEnum.couponMianDan, null));
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponMianDan, null));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createRewardCouponGet(getLeftDay(coupon),
|
| | | coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
|
| | | MsgTypeOtherTypeEnum.couponReward, null));
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, null));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createRewardCouponActive(getLeftDay(coupon),
|
| | | coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
|
| | | MsgTypeOtherTypeEnum.couponReward, null));
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, null));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createRewardCouponUsed(getLeftDay(coupon),
|
| | | coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
|
| | | MsgTypeOtherTypeEnum.couponReward, null));
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, null));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createRewardCouponWillOutOfDate(
|
| | | getLeftDay(coupon), coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
|
| | | MsgTypeOtherTypeEnum.couponReward, null));
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, null));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory
|
| | | .createRewardCouponAlreadyOutOfDate(coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
|
| | | try {
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
|
| | | MsgTypeOtherTypeEnum.couponReward, null));
|
| | | msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
|
| | | coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, null));
|
| | | } catch (MsgOtherDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | * @param beiZhu
|
| | | * @return
|
| | | */
|
| | | public static MsgOtherDetail createCouponMsg(Long uid, MsgOtherCouponContentDTO content, MsgTypeOtherTypeEnum type,
|
| | | String beiZhu) {
|
| | | public static MsgOtherDetail createCouponMsg(Long uid, Long userCouponId, MsgOtherCouponContentDTO content,
|
| | | MsgTypeOtherTypeEnum type, String beiZhu) {
|
| | | if (uid == null)
|
| | | return null;
|
| | | MsgOtherDetail detail = new MsgOtherDetail();
|
| | |
| | | detail.setUser(new UserInfo(uid));
|
| | | detail.setCoupnContent(content);
|
| | | detail.setType(type);
|
| | | detail.setSourceId(userCouponId);
|
| | | return detail;
|
| | | }
|
| | |
|