Parcourir la source

新增:定价管理模块。

lym il y a 4 ans
Parent
commit
24dfe4e1ae

+ 116 - 0
carbon-back/carbon-back-common/src/main/java/com/hcloud/microserver/system/facade/carbon/entity/ProductTypePrice.java

@@ -0,0 +1,116 @@
+package com.hcloud.microserver.system.facade.carbon.entity;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class ProductTypePrice {
+    private String guid;
+
+    private BigDecimal price;
+
+    private String remark;
+
+    private Integer checkState;
+
+    private Date checkTime;
+
+    private String checkRemark;
+
+    private Integer state;
+
+    private String createUser;
+
+    private Date createTime;
+
+    private String modifiedUser;
+
+    private Date modifiedTime;
+
+    public String getGuid() {
+        return guid;
+    }
+
+    public void setGuid(String guid) {
+        this.guid = guid == null ? null : guid.trim();
+    }
+
+    public BigDecimal getPrice() {
+        return price;
+    }
+
+    public void setPrice(BigDecimal price) {
+        this.price = price;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark == null ? null : remark.trim();
+    }
+
+    public Integer getCheckState() {
+        return checkState;
+    }
+
+    public void setCheckState(Integer checkState) {
+        this.checkState = checkState;
+    }
+
+    public Date getCheckTime() {
+        return checkTime;
+    }
+
+    public void setCheckTime(Date checkTime) {
+        this.checkTime = checkTime;
+    }
+
+    public String getCheckRemark() {
+        return checkRemark;
+    }
+
+    public void setCheckRemark(String checkRemark) {
+        this.checkRemark = checkRemark == null ? null : checkRemark.trim();
+    }
+
+    public Integer getState() {
+        return state;
+    }
+
+    public void setState(Integer state) {
+        this.state = state;
+    }
+
+    public String getCreateUser() {
+        return createUser;
+    }
+
+    public void setCreateUser(String createUser) {
+        this.createUser = createUser == null ? null : createUser.trim();
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getModifiedUser() {
+        return modifiedUser;
+    }
+
+    public void setModifiedUser(String modifiedUser) {
+        this.modifiedUser = modifiedUser == null ? null : modifiedUser.trim();
+    }
+
+    public Date getModifiedTime() {
+        return modifiedTime;
+    }
+
+    public void setModifiedTime(Date modifiedTime) {
+        this.modifiedTime = modifiedTime;
+    }
+}

+ 23 - 0
carbon-back/carbon-back-common/src/main/java/com/hcloud/microserver/system/facade/carbon/entity/ProductTypePriceWithBLOBs.java

@@ -0,0 +1,23 @@
+package com.hcloud.microserver.system.facade.carbon.entity;
+
+public class ProductTypePriceWithBLOBs extends ProductTypePrice {
+    private String fkProductType;
+
+    private String typeName;
+
+    public String getFkProductType() {
+        return fkProductType;
+    }
+
+    public void setFkProductType(String fkProductType) {
+        this.fkProductType = fkProductType == null ? null : fkProductType.trim();
+    }
+
+    public String getTypeName() {
+        return typeName;
+    }
+
+    public void setTypeName(String typeName) {
+        this.typeName = typeName == null ? null : typeName.trim();
+    }
+}

+ 36 - 0
carbon-back/carbon-back-common/src/main/java/com/hcloud/microserver/system/facade/carbon/forms/ProductTypePriceForm.java

@@ -0,0 +1,36 @@
+package com.hcloud.microserver.system.facade.carbon.forms;
+
+import com.hcloud.microserver.commoncore.base.BaseForm;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+public class ProductTypePriceForm extends BaseForm {
+    private String guid;
+
+    private BigDecimal price;
+
+    private String remark;
+
+    private Integer checkState;
+
+    private Date checkTime;
+
+    private String checkRemark;
+
+    private Integer state;
+
+    private String createUser;
+
+    private Date createTime;
+
+    private String modifiedUser;
+
+    private Date modifiedTime;
+
+    private String fkProductType;
+
+    private String typeName;
+}

+ 80 - 0
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/controller/ProductTypePriceController.java

@@ -0,0 +1,80 @@
+package com.hcloud.microserver.system.bank.controller;
+
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.base.BaseController;
+import com.hcloud.microserver.commoncore.base.ResponseBase;
+import com.hcloud.microserver.commoncore.enums.ResultEnum;
+import com.hcloud.microserver.commoncore.exception.GlobalException;
+import com.hcloud.microserver.system.bank.service.ProductTypePriceService;
+import com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs;
+import com.hcloud.microserver.system.facade.carbon.forms.ProductTypePriceForm;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("/web/price")
+public class ProductTypePriceController extends BaseController {
+
+    @Autowired
+    private ProductTypePriceService productTypePriceService;
+
+    @ApiOperation(value = "类型定价添加")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "productTypePriceWithBLOBs",value = "类型定价信息",dataType = "ProductTypePriceWithBLOBs")
+    })
+    @ApiResponse(code = 0, message = "操作成功")
+    @PostMapping("/save")
+    private ResponseBase save(@RequestBody ProductTypePriceWithBLOBs productTypePriceWithBLOBs){
+        int i = productTypePriceService.saveSelective(productTypePriceWithBLOBs);
+        if (i < 1){
+            return responseResultFailure();
+        }
+        return responseResultSuccess();
+    }
+
+    @ApiOperation(value = "类型定价列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "productTypePriceForm",value = "类型定价信息",dataType = "ProductTypePriceForm")
+    })
+    @ApiResponse(code = 0, message = "操作成功")
+    @PostMapping("/list")
+    private ResponseBase list(@RequestBody ProductTypePriceForm form){
+        PageInfo pageInfo = productTypePriceService.selectList(form);
+        return responseSuccess(pageInfo);
+    }
+
+    @ApiOperation(value = "类型定价删除")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "guid",value = "主键",dataType = "String")
+    })
+    @ApiResponse(code = 0, message = "操作成功")
+    @GetMapping("/delete")
+    private ResponseBase delete(@RequestParam("guid") String guid){
+        int i = productTypePriceService.delByPrimaryKey(guid);
+        if (i < 1){
+            return responseResultFailure();
+        }
+        return responseResultSuccess();
+    }
+
+    @ApiOperation(value = "类型定价审核")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "productTypePriceWithBLOBs",value = "类型定价信息",dataType = "ProductTypePriceWithBLOBs")
+    })
+    @ApiResponse(code = 0, message = "操作成功")
+    @PostMapping("/check")
+    private ResponseBase check(@RequestBody ProductTypePriceWithBLOBs productTypePriceWithBLOBs){
+        if (productTypePriceWithBLOBs.getCheckState() < 1){
+            throw new GlobalException(ResultEnum.FAILURE.getCode(),"审核状态错误!");
+        }
+        int i = productTypePriceService.check(productTypePriceWithBLOBs);
+        if (i < 1){
+            return responseResultFailure();
+        }
+        return responseResultSuccess();
+    }
+}

+ 26 - 0
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/dao/ProductTypePriceMapper.java

@@ -0,0 +1,26 @@
+package com.hcloud.microserver.system.bank.dao;
+
+import com.hcloud.microserver.commoncore.base.BaseMapper;
+import com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs;
+import com.hcloud.microserver.system.facade.carbon.forms.ProductTypePriceForm;
+
+import java.util.List;
+
+public interface ProductTypePriceMapper extends BaseMapper<ProductTypePriceWithBLOBs,String> {
+
+    /**
+     * 查询列表
+     * lym
+     * @param productTypePriceForm
+     * @return
+     */
+    List<ProductTypePriceWithBLOBs> selectList(ProductTypePriceForm productTypePriceForm);
+
+    /**
+     * 根据定价修改商品价格
+     * lym
+     * @param productTypePriceWithBLOBs
+     * @return
+     */
+    int updateGoodsInfoPrice(ProductTypePriceWithBLOBs productTypePriceWithBLOBs);
+}

+ 42 - 0
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/events/ProductTypePriceEvent.java

@@ -0,0 +1,42 @@
+package com.hcloud.microserver.system.bank.events;
+
+import com.hcloud.microserver.commoncore.util.string.StringUtils;
+import com.hcloud.microserver.system.bank.dao.ProductTypePriceMapper;
+import com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
+
+@Component
+public class ProductTypePriceEvent {
+
+    private Logger log = LoggerFactory.getLogger(ProductTypePriceEvent.class);
+
+    @Resource
+    private ProductTypePriceMapper productTypePriceMapper;
+
+    /**
+     * 根据定价修改商品价格
+     * lym
+     * @param productTypePriceGuid 类型定价ID
+     */
+    @Async
+    public void updateGoodsInfoPrice(String productTypePriceGuid){
+        ProductTypePriceWithBLOBs productTypePrice = productTypePriceMapper.selectByPrimaryKey(productTypePriceGuid);
+        if (productTypePrice.getCheckState() != 1) return; //审核不通过
+
+        //修改类别商品定价
+        String types = productTypePrice.getFkProductType();
+        if (StringUtils.isEmpty(types)){
+            log.info("定价类别为空{}" + types);
+            return;
+        }
+
+        int i = productTypePriceMapper.updateGoodsInfoPrice(productTypePrice);
+        log.info("修改:"+productTypePrice.getTypeName()+"类别,id:{"+productTypePrice.getFkProductType()+"}共"
+                + i +"商品定价为"+productTypePrice.getPrice());
+    }
+}

+ 25 - 0
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/service/ProductTypePriceService.java

@@ -0,0 +1,25 @@
+package com.hcloud.microserver.system.bank.service;
+
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.base.BaseServie;
+import com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs;
+import com.hcloud.microserver.system.facade.carbon.forms.ProductTypePriceForm;
+
+public interface ProductTypePriceService extends BaseServie<ProductTypePriceWithBLOBs,String> {
+
+    /**
+     * 查询列表
+     * lym
+     * @param productTypePriceForm
+     * @return
+     */
+    PageInfo selectList(ProductTypePriceForm productTypePriceForm);
+
+    /**
+     * 定价审核
+     * lym
+     * @param productTypePrice
+     * @return
+     */
+    int check(ProductTypePriceWithBLOBs productTypePrice);
+}

+ 97 - 0
carbon-back/carbon-back-service/src/main/java/com/hcloud/microserver/system/bank/service/impl/ProductTypePriceServiceImpl.java

@@ -0,0 +1,97 @@
+package com.hcloud.microserver.system.bank.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.hcloud.microserver.commoncore.enums.ResultEnum;
+import com.hcloud.microserver.commoncore.exception.GlobalException;
+import com.hcloud.microserver.commoncore.util.GetUUID;
+import com.hcloud.microserver.system.bank.dao.ProductTypePriceMapper;
+import com.hcloud.microserver.system.bank.events.ProductTypePriceEvent;
+import com.hcloud.microserver.system.bank.service.ProductTypePriceService;
+import com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs;
+import com.hcloud.microserver.system.facade.carbon.forms.ProductTypePriceForm;
+import com.hcloud.microserver.system.util.CurrUserUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.Date;
+import java.util.List;
+
+@Service
+public class ProductTypePriceServiceImpl implements ProductTypePriceService {
+
+    @Resource
+    private ProductTypePriceMapper productTypePriceMapper;
+    @Autowired
+    private ProductTypePriceEvent productTypePriceEvent;
+
+    @Override
+    public int delByPrimaryKey(String guid) {
+        ProductTypePriceWithBLOBs productTypePrice = productTypePriceMapper.selectByPrimaryKey(guid);
+        if (productTypePrice.getCheckState() == 1){
+            throw new GlobalException(ResultEnum.FAILURE.getCode(),"审核通过的定价不能删除!");
+        }
+        productTypePrice.setGuid(guid);
+        productTypePrice.setState(0);
+        return productTypePriceMapper.updateByPrimaryKeySelective(productTypePrice);
+    }
+
+    @Override
+    public int save(ProductTypePriceWithBLOBs record) {
+        return 0;
+    }
+
+    @Override
+    public int saveSelective(ProductTypePriceWithBLOBs record) {
+        record.setGuid(GetUUID.getUUID());
+        record.setState(1);
+        record.setCreateUser(CurrUserUtil.getUserId());
+        record.setCreateTime(new Date());
+        return productTypePriceMapper.insertSelective(record);
+    }
+
+    @Override
+    public ProductTypePriceWithBLOBs queryByPrimaryKey(String guid) {
+        return null;
+    }
+
+    @Override
+    public int modifyByPrimaryKeySelective(ProductTypePriceWithBLOBs record) {
+        record.setModifiedUser(CurrUserUtil.getUserId());
+        record.setModifiedTime(new Date());
+        return productTypePriceMapper.updateByPrimaryKeySelective(record);
+    }
+
+    @Override
+    public int modifyByPrimaryKeyWithBLOBs(ProductTypePriceWithBLOBs record) {
+        return 0;
+    }
+
+    @Override
+    public int modifyByPrimaryKey(ProductTypePriceWithBLOBs record) {
+        return 0;
+    }
+
+    @Override
+    public PageInfo selectList(ProductTypePriceForm productTypePriceForm) {
+        PageHelper.startPage(productTypePriceForm.getPageNo(),productTypePriceForm.getPageSize());
+        List<ProductTypePriceWithBLOBs> list = productTypePriceMapper.selectList(productTypePriceForm);
+        return new PageInfo(list);
+    }
+
+    @Override
+    public int check(ProductTypePriceWithBLOBs productTypePrice) {
+        productTypePrice.setModifiedUser(CurrUserUtil.getUserId());
+        productTypePrice.setModifiedTime(new Date());
+        if (productTypePrice.getCheckState() == 1){ //审核通过
+            productTypePrice.setCheckTime(new Date());
+        }
+
+        int i = productTypePriceMapper.updateByPrimaryKeySelective(productTypePrice);
+        if (i > 0 && productTypePrice.getCheckState() == 1){ //审核通过,异步修改商品价格
+            productTypePriceEvent.updateGoodsInfoPrice(productTypePrice.getGuid());
+        }
+        return i;
+    }
+}

+ 239 - 0
carbon-back/carbon-back-service/src/main/resources/carbon/ProductTypePriceMapper.xml

@@ -0,0 +1,239 @@
+<?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.hcloud.microserver.system.bank.dao.ProductTypePriceMapper">
+  <resultMap id="BaseResultMap" type="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePrice">
+    <id column="guid" jdbcType="CHAR" property="guid" />
+    <result column="price" jdbcType="DECIMAL" property="price" />
+    <result column="remark" jdbcType="VARCHAR" property="remark" />
+    <result column="check_state" jdbcType="INTEGER" property="checkState" />
+    <result column="check_time" jdbcType="TIMESTAMP" property="checkTime" />
+    <result column="check_remark" jdbcType="VARCHAR" property="checkRemark" />
+    <result column="state" jdbcType="INTEGER" property="state" />
+    <result column="create_user" jdbcType="CHAR" property="createUser" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="modified_user" jdbcType="CHAR" property="modifiedUser" />
+    <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
+  </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
+    <result column="fk_product_type" jdbcType="LONGVARCHAR" property="fkProductType" />
+    <result column="type_name" jdbcType="LONGVARCHAR" property="typeName" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    guid, price, remark, check_state, check_time, check_remark, state, create_user, create_time, 
+    modified_user, modified_time
+  </sql>
+  <sql id="Blob_Column_List">
+    fk_product_type, type_name
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
+    select 
+    <include refid="Base_Column_List" />
+    ,
+    <include refid="Blob_Column_List" />
+    from t_product_type_price
+    where guid = #{guid,jdbcType=CHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from t_product_type_price
+    where guid = #{guid,jdbcType=CHAR}
+  </delete>
+  <insert id="insert" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
+    insert into t_product_type_price (guid, price, remark, 
+      check_state, check_time, check_remark, 
+      state, create_user, create_time, 
+      modified_user, modified_time, fk_product_type, 
+      type_name)
+    values (#{guid,jdbcType=CHAR}, #{price,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, 
+      #{checkState,jdbcType=INTEGER}, #{checkTime,jdbcType=TIMESTAMP}, #{checkRemark,jdbcType=VARCHAR}, 
+      #{state,jdbcType=INTEGER}, #{createUser,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{modifiedUser,jdbcType=CHAR}, #{modifiedTime,jdbcType=TIMESTAMP}, #{fkProductType,jdbcType=LONGVARCHAR}, 
+      #{typeName,jdbcType=LONGVARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
+    insert into t_product_type_price
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        guid,
+      </if>
+      <if test="price != null">
+        price,
+      </if>
+      <if test="remark != null">
+        remark,
+      </if>
+      <if test="checkState != null">
+        check_state,
+      </if>
+      <if test="checkTime != null">
+        check_time,
+      </if>
+      <if test="checkRemark != null">
+        check_remark,
+      </if>
+      <if test="state != null">
+        state,
+      </if>
+      <if test="createUser != null">
+        create_user,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="modifiedUser != null">
+        modified_user,
+      </if>
+      <if test="modifiedTime != null">
+        modified_time,
+      </if>
+      <if test="fkProductType != null">
+        fk_product_type,
+      </if>
+      <if test="typeName != null">
+        type_name,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="guid != null">
+        #{guid,jdbcType=CHAR},
+      </if>
+      <if test="price != null">
+        #{price,jdbcType=DECIMAL},
+      </if>
+      <if test="remark != null">
+        #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="checkState != null">
+        #{checkState,jdbcType=INTEGER},
+      </if>
+      <if test="checkTime != null">
+        #{checkTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="checkRemark != null">
+        #{checkRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="state != null">
+        #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createUser != null">
+        #{createUser,jdbcType=CHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifiedUser != null">
+        #{modifiedUser,jdbcType=CHAR},
+      </if>
+      <if test="modifiedTime != null">
+        #{modifiedTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="fkProductType != null">
+        #{fkProductType,jdbcType=LONGVARCHAR},
+      </if>
+      <if test="typeName != null">
+        #{typeName,jdbcType=LONGVARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
+    update t_product_type_price
+    <set>
+      <if test="price != null">
+        price = #{price,jdbcType=DECIMAL},
+      </if>
+      <if test="remark != null">
+        remark = #{remark,jdbcType=VARCHAR},
+      </if>
+      <if test="checkState != null">
+        check_state = #{checkState,jdbcType=INTEGER},
+      </if>
+      <if test="checkTime != null">
+        check_time = #{checkTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="checkRemark != null">
+        check_remark = #{checkRemark,jdbcType=VARCHAR},
+      </if>
+      <if test="state != null">
+        state = #{state,jdbcType=INTEGER},
+      </if>
+      <if test="createUser != null">
+        create_user = #{createUser,jdbcType=CHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="modifiedUser != null">
+        modified_user = #{modifiedUser,jdbcType=CHAR},
+      </if>
+      <if test="modifiedTime != null">
+        modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="fkProductType != null">
+        fk_product_type = #{fkProductType,jdbcType=LONGVARCHAR},
+      </if>
+      <if test="typeName != null">
+        type_name = #{typeName,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
+    update t_product_type_price
+    set price = #{price,jdbcType=DECIMAL},
+      remark = #{remark,jdbcType=VARCHAR},
+      check_state = #{checkState,jdbcType=INTEGER},
+      check_time = #{checkTime,jdbcType=TIMESTAMP},
+      check_remark = #{checkRemark,jdbcType=VARCHAR},
+      state = #{state,jdbcType=INTEGER},
+      create_user = #{createUser,jdbcType=CHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      modified_user = #{modifiedUser,jdbcType=CHAR},
+      modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
+      fk_product_type = #{fkProductType,jdbcType=LONGVARCHAR},
+      type_name = #{typeName,jdbcType=LONGVARCHAR}
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePrice">
+    update t_product_type_price
+    set price = #{price,jdbcType=DECIMAL},
+      remark = #{remark,jdbcType=VARCHAR},
+      check_state = #{checkState,jdbcType=INTEGER},
+      check_time = #{checkTime,jdbcType=TIMESTAMP},
+      check_remark = #{checkRemark,jdbcType=VARCHAR},
+      state = #{state,jdbcType=INTEGER},
+      create_user = #{createUser,jdbcType=CHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      modified_user = #{modifiedUser,jdbcType=CHAR},
+      modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
+    where guid = #{guid,jdbcType=CHAR}
+  </update>
+
+  <!-- 查询列表 lym -->
+  <select id="selectList" parameterType="com.hcloud.microserver.system.facade.carbon.forms.ProductTypePriceForm" resultMap="ResultMapWithBLOBs">
+    SELECT <include refid="Base_Column_List"/>,<include refid="Blob_Column_List"/> FROM t_product_type_price
+      WHERE state = 1
+    <if test="typeName != null">
+      AND type_name LIKE CONCAT("%",#{typeName,jdbcType=LONGVARCHAR},"%)"
+    </if>
+    <if test="checkState != null">
+      AND check_state = #{checkState,jdbcType=INTEGER}
+    </if>
+    <if test="checkTime != null">
+      AND check_time = #{checkTime,jdbcType=TIMESTAMP}
+    </if>
+      ORDER BY create_time DESC
+  </select>
+
+  <!-- 根据定价修改商品价格 lym -->
+  <update id="updateGoodsInfoPrice" parameterType="com.hcloud.microserver.system.facade.carbon.entity.ProductTypePriceWithBLOBs">
+    UPDATE t_goods_info
+      SET price = #{price,jdbcType=DECIMAL}
+      WHERE guid IN
+       ( SELECT tmp.guid FROM(SELECT a.guid,a.price,c.fk_product_type FROM t_goods_info a
+        LEFT JOIN t_goods_detail b ON a.guid = b.fk_goods_guid
+        LEFT JOIN t_product_info c ON b.fk_product_guid = c.guid
+        WHERE a.state = 1 AND b.state = 1 AND c.state = 1
+        AND  FIND_IN_SET(c.fk_product_type,#{fkProductType,jdbcType=LONGVARCHAR})
+        ) tmp
+       )
+  </update>
+</mapper>