| | |
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SuperSpecial;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory;
|
| | | import com.yeshi.fanli.entity.bus.recommend.Honest;
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendBanner;
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendBannerV2;
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendSpecial;
|
| | | import com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendBanner;
|
| | | import com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendBannerV2;
|
| | | import com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendSpecial;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.bus.user.ShamUser;
|
| | |
| | | if (!"1".equals(version) && "android".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | | jumpDetail = jumpDetailService.getlastJumpDetailCache();
|
| | | }
|
| | | List<SuperRecommendSpecial> superRecommendSpecialList = superRecommendSpecialService
|
| | | .getSuperRecommendSpecialBySystemId(system.getId());
|
| | |
|
| | | List<RecommendSpecial> recommendSpecialList = null;
|
| | | for (SuperRecommendSpecial superRecommendSpecial : superRecommendSpecialList) {
|
| | | if (recommendSpecialList == null) {
|
| | | recommendSpecialList = new ArrayList<RecommendSpecial>();
|
| | | |
| | | List<SuperRecommendSpecial> superRecommendSpecialList = superRecommendSpecialService.getSuperRecommendSpecialBySystemId(system.getId());
|
| | | if (superRecommendSpecialList != null && superRecommendSpecialList.size() > 0) {
|
| | | |
| | | recommendSpecialList = new ArrayList<RecommendSpecial>();
|
| | | |
| | | for (SuperRecommendSpecial superRecommendSpecial : superRecommendSpecialList) {
|
| | | RecommendSpecial recommendSpecial = superRecommendSpecial.getRecommendSpecial();
|
| | | if (jumpDetail != null) {
|
| | | recommendSpecial.setJumpDetail(jumpDetail);
|
| | | }
|
| | | recommendSpecialList.add(recommendSpecial);
|
| | | }
|
| | | RecommendSpecial recommendSpecial = superRecommendSpecial.getRecommendSpecial();
|
| | | if (jumpDetail != null) {
|
| | | recommendSpecial.setJumpDetail(jumpDetail);
|
| | | }
|
| | | recommendSpecialList.add(recommendSpecial);
|
| | | }
|
| | |
|
| | | |
| | | if (recommendSpecialList == null || recommendSpecialList.size() == 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "暂无数据"));
|
| | | return;
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", recommendSpecialList.size());
|
| | | Gson gson = new Gson();
|
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.goods; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendSpecial; |
| | | |
| | | public interface RecommendSpecialMapper extends BaseMapper<RecommendSpecial>{ |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.goods; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendSpecial; |
| | | |
| | | public interface SuperRecommendSpecialMapper extends BaseMapper<SuperRecommendSpecial> { |
| | | |
| | | List<SuperRecommendSpecial> listBySystemId(@Param("systemId") Long systemId); |
| | | } |
| | |
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | import javax.persistence.Column;
|
| | | import javax.persistence.Entity;
|
| | | import javax.persistence.GeneratedValue;
|
| | | import javax.persistence.GenerationType;
|
| | | import javax.persistence.Id;
|
| | | import javax.persistence.Table;
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.yeshi.fanli.entity.common.JumpDetail;
|
| | |
|
| | |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Entity
|
| | | @Table(name = "yeshi_ec_recommend_special")
|
| | | @Table("yeshi_ec_recommend_special")
|
| | | public class RecommendSpecial implements Serializable{
|
| | | /**
|
| | | *
|
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Id
|
| | | @GeneratedValue(strategy = GenerationType.AUTO)
|
| | | @Column(name = "id")
|
| | | private long id;
|
| | | @Column(length = 256)
|
| | | private Long id;
|
| | | |
| | | @Column(name = "picture")
|
| | | private String picture;
|
| | | @Column(name = "`name`", length = 50)
|
| | | |
| | | @Column(name = "name")
|
| | | private String name;
|
| | | @Column(name = "`tag`", length = 50)
|
| | | |
| | | @Column(name = "tag")
|
| | | private String tag;
|
| | | private int orderby;
|
| | | // @ManyToOne(fetch = FetchType.EAGER)
|
| | | // @JoinColumn(name = "jumpid")
|
| | | |
| | | @Column(name = "orderby")
|
| | | private Integer orderby;
|
| | | |
| | | @Column(name = "jumpid")// "`params`
|
| | | private JumpDetail jumpDetail;// 跳转详情
|
| | | @Column(name = "`params`", length = 128)
|
| | | |
| | | @Column(name = "params")
|
| | | private String params;
|
| | | @Column(name = "`show`")
|
| | | |
| | | @Column(name = "show")
|
| | | private boolean show;
|
| | | private long createtime;
|
| | | |
| | | @Column(name = "createtime")
|
| | | private Long createtime;
|
| | |
|
| | | public RecommendSpecial() {
|
| | | // TODO Auto-generated constructor stub
|
| | | }
|
| | |
|
| | | public RecommendSpecial(long id) {
|
| | | public RecommendSpecial(Long id) {
|
| | | super();
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public RecommendSpecial(String picture, String name, String tag,
|
| | | int orderby, JumpDetail jumpDetail, String params, boolean show,
|
| | | long createtime) {
|
| | | super();
|
| | | this.picture = picture;
|
| | | this.name = name;
|
| | | this.tag = tag;
|
| | | this.orderby = orderby;
|
| | | this.jumpDetail = jumpDetail;
|
| | | this.params = params;
|
| | | this.show = show;
|
| | | this.createtime = createtime;
|
| | | }
|
| | |
|
| | | public long getId() {
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(long id) {
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | |
| | | this.tag = tag;
|
| | | }
|
| | |
|
| | | public int getOrderby() {
|
| | | public Integer getOrderby() {
|
| | | return orderby;
|
| | | }
|
| | |
|
| | | public void setOrderby(int orderby) {
|
| | | public void setOrderby(Integer orderby) {
|
| | | this.orderby = orderby;
|
| | | }
|
| | |
|
| | |
| | | this.show = show;
|
| | | }
|
| | |
|
| | | public long getCreatetime() {
|
| | | public Long getCreatetime() {
|
| | | return createtime;
|
| | | }
|
| | |
|
| | | public void setCreatetime(long createtime) {
|
| | | public void setCreatetime(Long createtime) {
|
| | | this.createtime = createtime;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | import javax.persistence.Column;
|
| | | import javax.persistence.Entity;
|
| | | import javax.persistence.FetchType;
|
| | | import javax.persistence.GeneratedValue;
|
| | | import javax.persistence.GenerationType;
|
| | | import javax.persistence.Id;
|
| | | import javax.persistence.JoinColumn;
|
| | | import javax.persistence.ManyToOne;
|
| | | import javax.persistence.Table;
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendSpecial;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | |
|
| | | @Entity
|
| | | @Table(name = "yeshi_ec_super_recommendspecial")
|
| | | @Table("yeshi_ec_super_recommendspecial")
|
| | | public class SuperRecommendSpecial implements Serializable{
|
| | | /**
|
| | | *
|
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | @Id
|
| | | @GeneratedValue(strategy = GenerationType.AUTO)
|
| | | @Column(name = "id")
|
| | | private long id;
|
| | | @ManyToOne(fetch = FetchType.EAGER)
|
| | | @JoinColumn(name = "recommendspecial_id")
|
| | | private Long id;
|
| | | |
| | | @Column(name = "recommendspecial_id")
|
| | | private RecommendSpecial recommendSpecial;
|
| | | @ManyToOne(fetch = FetchType.EAGER)
|
| | | @JoinColumn(name = "system_id")
|
| | | |
| | | @Column(name = "system_id")
|
| | | private BusinessSystem system;
|
| | |
|
| | | public SuperRecommendSpecial() {
|
| | | // TODO Auto-generated constructor stub
|
| | | }
|
| | |
|
| | | public SuperRecommendSpecial(RecommendSpecial recommendSpecial, BusinessSystem system) {
|
| | |
| | | this.system = system;
|
| | | }
|
| | |
|
| | | public long getId() {
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(long id) {
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
New file |
| | |
| | | <?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.yeshi.fanli.dao.mybatis.goods.RecommendSpecialMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.recommend.RecommendSpecial"> |
| | | <id column="id" property="id" jdbcType="BIGINT"/> |
| | | <result column="picture" property="picture" jdbcType="VARCHAR"/> |
| | | <result column="name" property="name" jdbcType="VARCHAR"/> |
| | | <result column="tag" property="tag" jdbcType="VARCHAR"/> |
| | | <result column="orderby" property="orderby" jdbcType="INTEGER"/> |
| | | <result column="params" property="params" jdbcType="VARCHAR"/> |
| | | <result column="show" property="show" jdbcType="VARCHAR"/> |
| | | <result column="createtime" property="createtime" jdbcType="BIGINT"/> |
| | | |
| | | <association property="jumpDetail" column="jumpid" javaType="com.yeshi.fanli.entity.common.JumpDetail"> |
| | | <id column="jumpid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | <sql id="Base_Column_List">id,picture,`name`,`tag`,`orderby`,`jumpid`,`params`,`show`,createtime</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_recommend_special where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_recommend_special where id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.recommend.RecommendSpecial" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_recommend_special (id,picture,`name`,`tag`,`orderby`,`jumpid`,`params`,`show`,createtime) values (#{id,jdbcType=BIGINT},#{picture,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{tag,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{show,jdbcType=VARCHAR},#{createtime,jdbcType=BIGINT})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.recommend.RecommendSpecial" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_recommend_special |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="picture != null">picture,</if> |
| | | <if test="name != null">`name`,</if> |
| | | <if test="tag != null">`tag`,</if> |
| | | <if test="orderby != null">`orderby`,</if> |
| | | <if test="jumpDetail != null">`jumpid`,</if> |
| | | <if test="params != null">`params`,</if> |
| | | <if test="show != null">`show`,</if> |
| | | <if test="createtime != null">createtime,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="picture != null">#{picture,jdbcType=VARCHAR},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="tag != null">#{tag,jdbcType=VARCHAR},</if> |
| | | <if test="orderby != null">#{orderby,jdbcType=INTEGER},</if> |
| | | <if test="jumpDetail != null">#{jumpDetail.id,jdbcType=BIGINT},</if> |
| | | <if test="params != null">#{params,jdbcType=VARCHAR},</if> |
| | | <if test="show != null">#{show,jdbcType=VARCHAR},</if> |
| | | <if test="createtime != null">#{createtime,jdbcType=BIGINT},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.recommend.RecommendSpecial">update yeshi_ec_recommend_special set picture = #{picture,jdbcType=VARCHAR},`name` = #{name,jdbcType=VARCHAR},`tag`= #{tag,jdbcType=VARCHAR},`orderby` = #{orderby,jdbcType=INTEGER},`jumpid` = #{jumpDetail.id,jdbcType=BIGINT},`params` = #{params,jdbcType=VARCHAR},`show` = #{show,jdbcType=VARCHAR},createtime = #{createtime,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.recommend.RecommendSpecial">update yeshi_ec_recommend_special |
| | | <set> |
| | | <if test="picture != null">picture=#{picture,jdbcType=VARCHAR},</if> |
| | | <if test="name != null">`name`=#{name,jdbcType=VARCHAR},</if> |
| | | <if test="tag != null">`tag`=#{tag,jdbcType=VARCHAR},</if> |
| | | <if test="orderby != null">`orderby`=#{orderby,jdbcType=INTEGER},</if> |
| | | <if test="jumpDetail != null">jumpid=#{jumpDetail.id,jdbcType=BIGINT},</if> |
| | | <if test="params != null">`params`=#{params,jdbcType=VARCHAR},</if> |
| | | <if test="show != null">`show`=#{show,jdbcType=VARCHAR},</if> |
| | | <if test="createtime != null">createtime=#{createtime,jdbcType=BIGINT},</if> |
| | | </set> where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
New file |
| | |
| | | <?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.yeshi.fanli.dao.mybatis.goods.SuperRecommendSpecialMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendSpecial"> |
| | | <id column="id" property="id" jdbcType="BIGINT"/> |
| | | |
| | | <association property="recommendSpecial" column="recommendspecial_id" |
| | | select="com.yeshi.fanli.dao.mybatis.goods.RecommendSpecialMapper.selectByPrimaryKey"/> |
| | | |
| | | <association property="system" column="system_id" javaType="com.yeshi.fanli.entity.system.BusinessSystem"> |
| | | <id column="system_id" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | <sql id="Base_Column_List">id,recommendspecial_id,system_id</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_super_recommendspecial where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_super_recommendspecial where id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendSpecial" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_super_recommendspecial (id,recommendspecial_id,system_id) values (#{id,jdbcType=BIGINT},#{recommendSpecia.id,jdbcType=BIGINT},#{system.id,jdbcType=BIGINT})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendSpecial" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_super_recommendspecial |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="recommendSpecial != null">recommendspecial_id,</if> |
| | | <if test="system != null">system_id,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="recommendSpecial != null">#{recommendSpecia.id,jdbcType=BIGINT},</if> |
| | | <if test="system != null">#{system.id,jdbcType=BIGINT},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendSpecial">update yeshi_ec_super_recommendspecial set recommendspecial_id = #{recommendSpecia.id,jdbcType=BIGINT},system_id = #{system.id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendSpecial">update yeshi_ec_super_recommendspecial |
| | | <set> |
| | | <if test="recommendSpecial != null">recommendspecial_id=#{recommendSpecia.id,jdbcType=BIGINT},</if> |
| | | <if test="system != null">system_id=#{system.id,jdbcType=BIGINT},</if> |
| | | </set> where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="listBySystemId" resultMap="BaseResultMap"> |
| | | SELECT sp.* FROM yeshi_ec_super_recommendspecial sp |
| | | LEFT JOIN yeshi_ec_recommend_special ds ON sp.`recommendspecial_id` = ds.`id` |
| | | WHERE sp.`system_id` = #{systemId} |
| | | ORDER BY ds.`orderby` |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | package com.yeshi.fanli.service.impl.goods;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.hibernate.HibernateException;
|
| | | import org.hibernate.Query;
|
| | | import org.hibernate.Session;
|
| | | import org.hibernate.Transaction;
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.orm.hibernate4.HibernateCallback;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.goods.SuperRecommendSpecialDao;
|
| | | import com.yeshi.fanli.entity.bus.recommend.RecommendSpecial;
|
| | | import com.yeshi.fanli.dao.mybatis.goods.SuperRecommendSpecialMapper;
|
| | | import com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendSpecial;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.goods.SuperRecommendSpecialService;
|
| | |
|
| | | @Service
|
| | | public class SuperRecommendSpecialServiceImpl implements
|
| | | SuperRecommendSpecialService {
|
| | | public class SuperRecommendSpecialServiceImpl implements SuperRecommendSpecialService {
|
| | |
|
| | | @Resource
|
| | | private SuperRecommendSpecialDao superRecommendSpecialDao;
|
| | | |
| | | @Resource
|
| | | private BusinessSystemService businessSystemService;
|
| | | private SuperRecommendSpecialMapper superRecommendSpecialMapper;
|
| | |
|
| | | @Cacheable(value="specialCache",key="#root.methodName+#id")
|
| | | public List<SuperRecommendSpecial> getSuperRecommendSpecialBySystemId(
|
| | | long id) {
|
| | | |
| | | return superRecommendSpecialDao.list("from SuperRecommendSpecial srs where srs.system.id=? order by srs.recommendSpecial.orderby ", new Serializable[]{id});
|
| | | }
|
| | |
|
| | | public List<SuperRecommendSpecial> getSuperRecommendSpecials(
|
| | | List<Long> rsIdList) {
|
| | |
|
| | | if (rsIdList.size() == 0) {
|
| | | return new ArrayList<SuperRecommendSpecial>();
|
| | | }
|
| | | StringBuffer sb = new StringBuffer(" from SuperRecommendSpecial srs ");
|
| | | Serializable[] serArr = new Serializable[rsIdList.size()];
|
| | | for (int i = 0; i < rsIdList.size(); i++) {
|
| | | if (i == 0) {
|
| | | sb.append(" where srs.recommendSpecial.id=? ");
|
| | | } else {
|
| | | sb.append(" or srs.recommendSpecial.id=? ");
|
| | | }
|
| | | serArr[i] = rsIdList.get(i);
|
| | | }
|
| | | sb.append(" order by srs.recommendSpecial.orderby ");
|
| | | String hql = sb.toString();
|
| | |
|
| | | return superRecommendSpecialDao.list(hql, serArr);
|
| | |
|
| | | |
| | | }
|
| | |
|
| | | public Integer deleteSuperRecommendSpecial(final long rsid, final String platform,
|
| | | final String packageName) {
|
| | | return (Integer) superRecommendSpecialDao.excute(new HibernateCallback<Integer>() {
|
| | |
|
| | | public Integer doInHibernate(Session session)
|
| | | throws HibernateException {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystem(platform, packageName);
|
| | | Transaction transaction = session.beginTransaction();
|
| | | Query query = session.createQuery("delete SuperRecommendSpecial srb "
|
| | | + " where srb.recommendSpecial.id=? and srb.system.id=?");
|
| | | query.setLong(0, rsid);
|
| | | query.setLong(1, system.getId());
|
| | | int i = query.executeUpdate();
|
| | | transaction.commit();
|
| | | return i ;
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | public void addSuperRecommendSpecial(long rsid, String platform,
|
| | | String packageName) {
|
| | |
|
| | | BusinessSystem system = businessSystemService.getBusinessSystem(platform,packageName);
|
| | | SuperRecommendSpecial superRecommendSpecial = new SuperRecommendSpecial();
|
| | | RecommendSpecial recommendSpecial = new RecommendSpecial();
|
| | | recommendSpecial.setId(rsid);
|
| | | superRecommendSpecial.setRecommendSpecial(recommendSpecial);
|
| | | superRecommendSpecial.setSystem(system);
|
| | | superRecommendSpecialDao.create(superRecommendSpecial);
|
| | | |
| | | }
|
| | |
|
| | | public void deleteSuperRecommendSpecials(final long[] rsids) {
|
| | | superRecommendSpecialDao.excute(new HibernateCallback() {
|
| | |
|
| | | public Object doInHibernate(Session session) throws HibernateException {
|
| | | |
| | | StringBuffer sb = new StringBuffer("delete from SuperRecommendSpecial s ");
|
| | | for (int i = 0; i < rsids.length; i++) {
|
| | | if(i==0){
|
| | | sb.append(" where s.recommendSpecial.id=? ");
|
| | | }else{
|
| | | sb.append(" or s.recommendSpecial.id=?");
|
| | | }
|
| | | }
|
| | | Query query = session.createQuery(sb.toString());
|
| | | for (int i = 0; i < rsids.length; i++) {
|
| | | query.setLong(i, rsids[i]);
|
| | | }
|
| | | int ii = query.executeUpdate();
|
| | | java.lang.System.out.println(ii);
|
| | | return null;
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | public List<SuperRecommendSpecial> getSuperRecommendSpecialBySystemId(
|
| | | long id, int start, int count) {
|
| | | |
| | | return superRecommendSpecialDao.list("from SuperRecommendSpecial srs where srs.system.id=? order by srs.recommendSpecial.orderby ",start,count,new Serializable[]{id});
|
| | | |
| | | }
|
| | |
|
| | | public List<SuperRecommendSpecial> getSuperRecommendSpecialBySystemId(
|
| | | long id, int start, int count, String key) {
|
| | | return superRecommendSpecialDao.list("from SuperRecommendSpecial srs where srs.system.id=? and srs.recommendSpecial.name like ? order by srs.recommendSpecial.orderby ",start,count,new Serializable[]{id, key});
|
| | | |
| | | public List<SuperRecommendSpecial> getSuperRecommendSpecialBySystemId(long systemId) {
|
| | | return superRecommendSpecialMapper.listBySystemId(systemId);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import org.springframework.cache.annotation.CacheEvict;
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.su.recommend.SuperRecommendSpecial;
|
| | |
|
| | | public interface SuperRecommendSpecialService {
|
| | |
|
| | | public List<SuperRecommendSpecial> getSuperRecommendSpecialBySystemId(long id);
|
| | |
|
| | | public List<SuperRecommendSpecial> getSuperRecommendSpecials(
|
| | | List<Long> rsIdList);
|
| | | @CacheEvict(value="specialCache",allEntries=true)
|
| | | public Integer deleteSuperRecommendSpecial(long rbid, String platform,
|
| | | String packageName);
|
| | | @CacheEvict(value="specialCache",allEntries=true)
|
| | | public void addSuperRecommendSpecial(long rbid, String platform,
|
| | | String packageName);
|
| | | @CacheEvict(value="specialCache",allEntries=true)
|
| | | public void deleteSuperRecommendSpecials(long[] rbids); |
| | |
|
| | | public List<SuperRecommendSpecial> getSuperRecommendSpecialBySystemId(
|
| | | long id, int strat, int count);
|
| | |
|
| | | public List<SuperRecommendSpecial> getSuperRecommendSpecialBySystemId(
|
| | | long id, int strat, int pAGE_SIZE, String likekey);
|
| | |
|
| | | }
|