Commit e4c4c1c3 by huluobin

首页标题

parent a194b4c0
......@@ -16,4 +16,11 @@ public interface MallProductMapper extends BaseMapper<MallProduct> {
* @return
*/
IPage<MallProduct> queryPageProduct(@Param("page") IPage<MallProduct> productIPage, @Param("param") ProductQuery param);
/**
* 同步色胶标题
*
* @param id
*/
void syncMallProductIndexTitle(Long id);
}
......@@ -12,6 +12,7 @@ import com.gogirl.domain.order.mall.MallOrder;
import com.gogirl.domain.order.serve.OrderManage;
import com.gogirl.domain.order.serve.ScheduleManage;
import com.gogirl.domain.order.serve.ScheduleServe;
import com.gogirl.domain.product.mall.MallCategory;
import com.gogirl.domain.product.serve.BaseFeatures;
import com.gogirl.domain.product.serve.FeaturesMapping;
import com.gogirl.domain.product.serve.ProduceSales;
......@@ -34,6 +35,8 @@ import com.gogirl.infrastructure.mapper.order.mall.MallOrderMapper;
import com.gogirl.infrastructure.mapper.order.serve.OrderManageMapper;
import com.gogirl.infrastructure.mapper.order.serve.OrderServeMapper;
import com.gogirl.infrastructure.mapper.order.serve.ScheduleManageMapper;
import com.gogirl.infrastructure.mapper.product.mall.MallCategoryMapper;
import com.gogirl.infrastructure.mapper.product.mall.MallProductMapper;
import com.gogirl.infrastructure.mapper.product.serve.BaseFeaturesMapper;
import com.gogirl.infrastructure.mapper.product.serve.FeaturesMappingMapper;
import com.gogirl.infrastructure.mapper.product.serve.ProduceSalesMapper;
......@@ -640,4 +643,19 @@ public class Schedule {
public void syncBalanceLevel() {
balanceRecordDao.syncBalanceLevel();
}
private final MallProductMapper mallProductMapper;
private final MallCategoryMapper mallCategoryMapper;
/**
* 每天三点处理色胶的首页标题
*/
@Scheduled(cron = "0 0 3 * * ?")
public void syncMallProductIndexTitle() {
MallCategory mallCategory = mallCategoryMapper.selectOne(new LambdaQueryWrapper<MallCategory>().eq(MallCategory::getCategoryName, "日式基础色胶"));
mallProductMapper.syncMallProductIndexTitle(mallCategory.getId());
}
}
......@@ -2,6 +2,14 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.gogirl.infrastructure.mapper.product.mall.MallProductMapper">
<update id="syncMallProductIndexTitle">
update mall_product t1
LEFT JOIN mall_category_product_ref t2 on t1.id = t2.mall_product_id
LEFT JOIN mall_category t3 on t2.mall_category_id = t3.id
set t1.index_title =t1.color
where t3.parent_id = #{id}
</update>
<select id="queryPageProduct" resultType="com.gogirl.domain.product.mall.MallProduct">
select * from mall_product t1
left join mall_category_product_ref mcpr on t1.id = mcpr.mall_product_id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment