| @@ -0,0 +1,32 @@ | |||||
| package com.iformall.domain.po; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.iformall.domain.po.base.BaseEntity; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import java.util.Date; | |||||
| import java.util.List; | |||||
| @TableName(value = "tt_mall_goods_category") | |||||
| @Data | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class TtMallGoodsCategory extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="goodsCategoryId") | |||||
| private Integer goodsCategoryId; | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="softwareFee") | |||||
| private Integer softwareFee; | |||||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||||
| private Date createDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||||
| private Date updateDate; | |||||
| @io.swagger.annotations.ApiModelProperty(value="",name="isDel") | |||||
| private Integer isDel; | |||||
| } | |||||
| @@ -14,5 +14,5 @@ public interface TtGoodsCategoryMapper extends CommonMapper<TtGoodsCategory, Str | |||||
| int updDelByIds(TtGoodsCategory record); | int updDelByIds(TtGoodsCategory record); | ||||
| int updateByFreeIds(TtGoodsCategory updgc); | |||||
| int updateFeeByIds(TtGoodsCategory updgc); | |||||
| } | } | ||||
| @@ -0,0 +1,19 @@ | |||||
| package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | |||||
| import com.iformall.domain.po.TtGoodsCategory; | |||||
| import com.iformall.domain.po.TtMallGoodsCategory; | |||||
| import java.util.List; | |||||
| public interface TtMallGoodsCategoryMapper extends CommonMapper<TtMallGoodsCategory, String> { | |||||
| List<TtMallGoodsCategory> findList(TtMallGoodsCategory record); | |||||
| List<Integer> findIdAll(TtMallGoodsCategory record); | |||||
| int updDelByIds(TtMallGoodsCategory record); | |||||
| int updateFeeByIds(TtMallGoodsCategory record); | |||||
| } | |||||
| @@ -0,0 +1,6 @@ | |||||
| package com.iformall.service; | |||||
| public interface TtMallGoodsCategoryService { | |||||
| } | |||||
| @@ -601,7 +601,7 @@ public class TtGoodsCategoryServiceImpl implements TtGoodsCategoryService { | |||||
| updgc.setServiceFee(serviceFee); | updgc.setServiceFee(serviceFee); | ||||
| updgc.setSoftwareFee(softwareFee); | updgc.setSoftwareFee(softwareFee); | ||||
| updgc.setUpdateDate(now); | updgc.setUpdateDate(now); | ||||
| int i = ttGoodsCategoryMapper.updateByFreeIds(updgc); | |||||
| int i = ttGoodsCategoryMapper.updateFeeByIds(updgc); | |||||
| if(i > 0){ | if(i > 0){ | ||||
| TtGoodsCategory gcq = new TtGoodsCategory(); | TtGoodsCategory gcq = new TtGoodsCategory(); | ||||
| gcq.setParentIds(ids); | gcq.setParentIds(ids); | ||||
| @@ -0,0 +1,31 @@ | |||||
| package com.iformall.service.impl; | |||||
| import com.iformall.mapper.TtGoodsCategoryMapper; | |||||
| import com.iformall.mapper.TtMallGoodsCategoryMapper; | |||||
| import com.iformall.service.TtMallGoodsCategoryService; | |||||
| import com.iformall.service.TtMerchantPoiService; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.beans.factory.annotation.Qualifier; | |||||
| import org.springframework.data.redis.core.RedisTemplate; | |||||
| import org.springframework.stereotype.Service; | |||||
| @Service | |||||
| public class TtMallGoodsCategoryServiceImpl implements TtMallGoodsCategoryService { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| TtMallGoodsCategoryMapper ttMallGoodsCategoryMapper; | |||||
| @Autowired | |||||
| private TtMerchantPoiService ttMerchantPoiService; | |||||
| @Autowired | |||||
| @Qualifier("objectCommonRedisTemplate") | |||||
| RedisTemplate<String, Object> categoryRedisTemplate; | |||||
| } | |||||
| @@ -81,7 +81,7 @@ | |||||
| </foreach> | </foreach> | ||||
| </update> | </update> | ||||
| <update id="updateByFreeIds" parameterType="com.iformall.domain.po.TtGoodsCategory"> | |||||
| <update id="updateFeeByIds" parameterType="com.iformall.domain.po.TtGoodsCategory"> | |||||
| update tt_goods_category set update_date = #{updateDate} | update tt_goods_category set update_date = #{updateDate} | ||||
| <if test=" null != serviceFee ">,`service_fee` = #{serviceFee}</if> | <if test=" null != serviceFee ">,`service_fee` = #{serviceFee}</if> | ||||
| <if test=" null != softwareFee ">,`software_fee` = #{softwareFee}</if> | <if test=" null != softwareFee ">,`software_fee` = #{softwareFee}</if> | ||||
| @@ -0,0 +1,68 @@ | |||||
| <?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.iformall.mapper.TtMallGoodsCategoryMapper"> | |||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.TtMallGoodsCategory"> | |||||
| <result column="goods_category_id" jdbcType="INTEGER" property="goodsCategoryId" /> | |||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/> | |||||
| <result column="software_fee" jdbcType="INTEGER" property="softwareFee" /> | |||||
| </resultMap> | |||||
| <sql id="allColumns"> | |||||
| `goods_category_id`,`tenant_id`,`parent_tenant_id`,`software_fee` | |||||
| </sql> | |||||
| <sql id="dynamicWhereConditions"> | |||||
| where 1=1 | |||||
| <if test=" null != goodsCategoryId "> | |||||
| and `goods_category_id` = #{goodsCategoryId} | |||||
| </if> | |||||
| <if test=" null != tenantId and '' != tenantId"> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||||
| and `parent_tenant_id` = #{parentTenantId} | |||||
| </if> | |||||
| <if test=" null != isDel "> | |||||
| and `is_del` = #{isDel} | |||||
| </if> | |||||
| <if test=" null != categoryIds "> | |||||
| and goods_category_id in | |||||
| <foreach collection="categoryIds" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||||
| </sql> | |||||
| <select id="findList" parameterType="com.iformall.domain.po.TtMallGoodsCategory" resultMap="BaseResultMap"> | |||||
| select <include refid="allColumns" /> from tt_mall_goods_category | |||||
| <include refid="dynamicWhereConditions" /> | |||||
| </select> | |||||
| <select id="findIdAll" parameterType="com.iformall.domain.po.TtMallGoodsCategory" resultType="Integer"> | |||||
| select id from tt_mall_goods_category | |||||
| <include refid="dynamicWhereConditions" /> | |||||
| </select> | |||||
| <update id="updDelByIds" parameterType="com.iformall.domain.po.TtMallGoodsCategory"> | |||||
| update tt_mall_goods_category set is_del = #{isDel}, update_date = #{updateDate} | |||||
| where goods_category_id in | |||||
| <foreach collection="categoryIds" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </update> | |||||
| <update id="updateFeeByIds" parameterType="com.iformall.domain.po.TtMallGoodsCategory"> | |||||
| update tt_mall_goods_category set `software_fee` = #{softwareFee}, update_date = #{updateDate} | |||||
| where goods_category_id in | |||||
| <foreach collection="categoryIds" index="index" item="idItem" open="(" separator="," close=")"> | |||||
| #{idItem} | |||||
| </foreach> | |||||
| </update> | |||||
| </mapper> | |||||