Authored by wangnan

删除ProducPoolMapper java和xml

package com.yoho.search.dal;
import com.yoho.search.dal.model.ProductPool;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ProductPoolMapper {
int insert(ProductPool record);
int insertSelective(ProductPool record);
List<ProductPool> getPageLists(@Param(value = "offset") Integer offset, @Param(value = "pageSize") Integer pageSize);
int count();
ProductPool selectByPrimaryKey(Integer id);
List<ProductPool> selectListByIds(List<Integer> ids);
}
\ No newline at end of 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.yoho.search.dal.ProductPoolMapper">
<resultMap id="BaseResultMap" type="com.yoho.search.dal.model.ProductPool">
<result column="id" property="id" jdbcType="INTEGER"/>
<result column="pool_id" property="poolId" jdbcType="INTEGER"/>
<result column="product_skn" property="productSkn" jdbcType="INTEGER"/>
<result column="product_id" property="productId" jdbcType="INTEGER"/>
<result column="sales" property="sales" jdbcType="CHAR"/>
<result column="brand_id" property="brandId" jdbcType="SMALLINT"/>
<result column="status" property="status" jdbcType="TINYINT"/>
<result column="attribute" property="attribute" jdbcType="TINYINT"/>
<result column="small_sort_id" property="smallSortId" jdbcType="SMALLINT"/>
<result column="middle_sort_id" property="middleSortId" jdbcType="SMALLINT"/>
<result column="max_sort_id" property="maxSortId" jdbcType="SMALLINT"/>
<result column="gender" property="gender" jdbcType="CHAR"/>
<result column="storage_num" property="storageNum" jdbcType="DECIMAL"/>
<result column="market_price" property="marketPrice" jdbcType="DECIMAL"/>
<result column="sales_price" property="salesPrice" jdbcType="DECIMAL"/>
<result column="vip_discount_type" property="vipDiscountType" jdbcType="TINYINT"/>
<result column="is_discount" property="isDiscount" jdbcType="VARCHAR"/>
<result column="is_outlets" property="isOutlets" jdbcType="INTEGER"/>
<result column="size_ids" jdbcType="VARCHAR" property="sizeIds"/>
<result column="age_level" property="ageLevel" jdbcType="CHAR"/>
<result column="color_ids" property="colorIds" jdbcType="CHAR"/>
<result column="promotion_discount_int" property="promotionDiscountInt" jdbcType="DECIMAL"/>
<result column="promotion_discount" property="promotionDiscount" jdbcType="DECIMAL"/>
<result column="sales_num" property="salesNum" jdbcType="INTEGER"/>
</resultMap>
<sql id="Base_Column_List">
id, pool_id, product_skn,
product_id, sales, brand_id,
status, attribute, small_sort_id,
middle_sort_id, max_sort_id, gender,
storage_num, market_price,
sales_price, vip_discount_type, is_discount,
is_outlets, size_ids,age_level,color_ids,promotion_discount_int,promotion_discount,sales_num
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" timeout="20000">
select
<include refid="Base_Column_List"/>
from product_pool
where id = #{id,jdbcType=INTEGER}
</select>
<select id="getPageLists" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List"/>
from product_pool limit #{offset},#{pageSize}
</select>
<select id="count" resultType="java.lang.Integer" timeout="20000">
SELECT count(*) FROM product_pool
</select>
<select id="selectListByIds" resultMap="BaseResultMap" timeout="20000">
select
<include refid="Base_Column_List"/>
from product_pool
where id in
<foreach item="item" index="index" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>
\ No newline at end of file
... ... @@ -6,13 +6,11 @@ import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.base.utils.ISearchConstans;
import com.yoho.search.consumer.common.CostStatistics;
import com.yoho.search.consumer.index.common.IYohoIndexService;
import com.yoho.search.consumer.service.base.ProductPoolService;
import com.yoho.search.consumer.service.logic.ProductPoolLogicService;
import com.yoho.search.consumer.service.logic.SpecialDealLogicService;
import com.yoho.search.core.es.model.ESBluk;
import com.yoho.search.core.es.utils.IgnoreSomeException;
import com.yoho.search.dal.model.ProductPool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -21,7 +19,6 @@ import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
... ... @@ -44,9 +41,6 @@ public class ProductPoolIndexToolsService implements ApplicationEventPublisherAw
private static final long THREAD_SLEEP_WORK = 50;
@Autowired
private ProductPoolService productPoolService;
@Autowired
private ProductPoolLogicService productPoolBuildService;
@Autowired
... ...
package com.yoho.search.consumer.service.base;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.yoho.search.dal.ProductPoolMapper;
import com.yoho.search.dal.model.ProductPool;
/**
* Created by wangnan on 2016/9/12.
*/
@Component
public class ProductPoolService {
@Autowired
private ProductPoolMapper productPoolMapper;
public ProductPool getById(Integer id) {
return productPoolMapper.selectByPrimaryKey(id);
}
public List<ProductPool> getPageLists(int start, int size) {
return productPoolMapper.getPageLists(start, size);
}
public int count() {
return productPoolMapper.count();
}
public List<ProductPool> selectListByIds(List<Integer> ids) {
if (ids == null || ids.isEmpty()) {
return new ArrayList<ProductPool>();
}
return productPoolMapper.selectListByIds(ids);
}
}