XF--LRQYEJOKYDS\Administrator 4 лет назад
Родитель
Сommit
a278d4e06e

+ 30 - 0
Yijia-SaaS/yijia-market/pom.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>yijia</artifactId>
+        <groupId>com.yijia</groupId>
+        <version>1.0.1</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>yijia-market</artifactId>
+
+    <description>营销管理模块</description>
+
+    <dependencies>
+
+        <!-- 通用工具-->
+        <dependency>
+            <groupId>com.yijia</groupId>
+            <artifactId>yijia-common</artifactId>
+        </dependency>
+        <!--定时任务-->
+        <dependency>
+            <groupId>com.yijia</groupId>
+            <artifactId>yijia-quartz</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

+ 103 - 0
Yijia-SaaS/yijia-market/src/main/java/com/yijia/market/controller/MarkertPlanController.java

@@ -0,0 +1,103 @@
+package com.yijia.market.controller;
+
+import java.util.List;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.yijia.common.annotation.Log;
+import com.yijia.common.core.controller.BaseController;
+import com.yijia.common.core.domain.AjaxResult;
+import com.yijia.common.enums.BusinessType;
+import com.yijia.market.domain.MarkertPlan;
+import com.yijia.market.service.IMarkertPlanService;
+import com.yijia.common.utils.poi.ExcelUtil;
+import com.yijia.common.core.page.TableDataInfo;
+
+/**
+ * 营销方案Controller
+ * 
+ * @author yijia
+ * @date 2020-12-22
+ */
+@RestController
+@RequestMapping("/market/plan")
+public class MarkertPlanController extends BaseController
+{
+    @Autowired
+    private IMarkertPlanService markertPlanService;
+
+    /**
+     * 查询营销方案列表
+     */
+    @PreAuthorize("@ss.hasPermi('market:plan:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(MarkertPlan markertPlan)
+    {
+        startPage();
+        List<MarkertPlan> list = markertPlanService.selectMarkertPlanList(markertPlan);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出营销方案列表
+     */
+    @PreAuthorize("@ss.hasPermi('market:plan:export')")
+    @Log(title = "营销方案", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(MarkertPlan markertPlan)
+    {
+        List<MarkertPlan> list = markertPlanService.selectMarkertPlanList(markertPlan);
+        ExcelUtil<MarkertPlan> util = new ExcelUtil<MarkertPlan>(MarkertPlan.class);
+        return util.exportExcel(list, "plan");
+    }
+
+    /**
+     * 获取营销方案详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('market:plan:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(markertPlanService.selectMarkertPlanById(id));
+    }
+
+    /**
+     * 新增营销方案
+     */
+    @PreAuthorize("@ss.hasPermi('market:plan:add')")
+    @Log(title = "营销方案", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody MarkertPlan markertPlan)
+    {
+        return toAjax(markertPlanService.insertMarkertPlan(markertPlan));
+    }
+
+    /**
+     * 修改营销方案
+     */
+    @PreAuthorize("@ss.hasPermi('market:plan:edit')")
+    @Log(title = "营销方案", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody MarkertPlan markertPlan)
+    {
+        return toAjax(markertPlanService.updateMarkertPlan(markertPlan));
+    }
+
+    /**
+     * 删除营销方案
+     */
+    @PreAuthorize("@ss.hasPermi('market:plan:remove')")
+    @Log(title = "营销方案", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(markertPlanService.deleteMarkertPlanByIds(ids));
+    }
+}

+ 103 - 0
Yijia-SaaS/yijia-market/src/main/java/com/yijia/market/controller/MarketCouponController.java

@@ -0,0 +1,103 @@
+package com.yijia.market.controller;
+
+import java.util.List;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.yijia.common.annotation.Log;
+import com.yijia.common.core.controller.BaseController;
+import com.yijia.common.core.domain.AjaxResult;
+import com.yijia.common.enums.BusinessType;
+import com.yijia.market.domain.MarketCoupon;
+import com.yijia.market.service.IMarketCouponService;
+import com.yijia.common.utils.poi.ExcelUtil;
+import com.yijia.common.core.page.TableDataInfo;
+
+/**
+ * 优惠劵管理Controller
+ * 
+ * @author yijia
+ * @date 2020-12-22
+ */
+@RestController
+@RequestMapping("/market/coupon")
+public class MarketCouponController extends BaseController
+{
+    @Autowired
+    private IMarketCouponService marketCouponService;
+
+    /**
+     * 查询优惠劵管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('market:coupon:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(MarketCoupon marketCoupon)
+    {
+        startPage();
+        List<MarketCoupon> list = marketCouponService.selectMarketCouponList(marketCoupon);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出优惠劵管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('market:coupon:export')")
+    @Log(title = "优惠劵管理", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(MarketCoupon marketCoupon)
+    {
+        List<MarketCoupon> list = marketCouponService.selectMarketCouponList(marketCoupon);
+        ExcelUtil<MarketCoupon> util = new ExcelUtil<MarketCoupon>(MarketCoupon.class);
+        return util.exportExcel(list, "coupon");
+    }
+
+    /**
+     * 获取优惠劵管理详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('market:coupon:query')")
+    @GetMapping(value = "/{couponId}")
+    public AjaxResult getInfo(@PathVariable("couponId") Long couponId)
+    {
+        return AjaxResult.success(marketCouponService.selectMarketCouponById(couponId));
+    }
+
+    /**
+     * 新增优惠劵管理
+     */
+    @PreAuthorize("@ss.hasPermi('market:coupon:add')")
+    @Log(title = "优惠劵管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody MarketCoupon marketCoupon)
+    {
+        return toAjax(marketCouponService.insertMarketCoupon(marketCoupon));
+    }
+
+    /**
+     * 修改优惠劵管理
+     */
+    @PreAuthorize("@ss.hasPermi('market:coupon:edit')")
+    @Log(title = "优惠劵管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody MarketCoupon marketCoupon)
+    {
+        return toAjax(marketCouponService.updateMarketCoupon(marketCoupon));
+    }
+
+    /**
+     * 删除优惠劵管理
+     */
+    @PreAuthorize("@ss.hasPermi('market:coupon:remove')")
+    @Log(title = "优惠劵管理", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{couponIds}")
+    public AjaxResult remove(@PathVariable Long[] couponIds)
+    {
+        return toAjax(marketCouponService.deleteMarketCouponByIds(couponIds));
+    }
+}

+ 149 - 0
Yijia-SaaS/yijia-market/src/main/java/com/yijia/market/domain/MarkertPlan.java

@@ -0,0 +1,149 @@
+package com.yijia.market.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.yijia.common.annotation.Excel;
+import com.yijia.common.core.domain.BaseEntity;
+
+/**
+ * 营销方案对象 markert_plan
+ * 
+ * @author yijia
+ * @date 2020-12-22
+ */
+public class MarkertPlan extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** id */
+    private Long id;
+
+    /** 等级名称 */
+    @Excel(name = "等级名称")
+    private String grade;
+
+    /** 优惠条件(满100元) */
+    @Excel(name = "优惠条件", readConverterExp = "满=100元")
+    private String discountTerm;
+
+    /** 优惠条件金额(100元) */
+    @Excel(name = "优惠条件金额", readConverterExp = "1=00元")
+    private String discountAmt;
+
+    /** 汽油优惠金额 */
+    @Excel(name = "汽油优惠金额")
+    private String gasoilDiscountAmt;
+
+    /** 柴油优惠金额 */
+    @Excel(name = "柴油优惠金额")
+    private String dieseloilDiscountAmt;
+
+    /** 会员优惠是否叠加 */
+    @Excel(name = "会员优惠是否叠加")
+    private String vipDiscountyPlus;
+
+    /** 可否叠加劵 */
+    @Excel(name = "可否叠加劵")
+    private String couponPlus;
+
+    /** 优惠方案类型(1满减方案,2,立减方案) */
+    @Excel(name = "优惠方案类型", readConverterExp = "1=满减方案,2,立减方案")
+    private String discountPlanType;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setGrade(String grade) 
+    {
+        this.grade = grade;
+    }
+
+    public String getGrade() 
+    {
+        return grade;
+    }
+    public void setDiscountTerm(String discountTerm) 
+    {
+        this.discountTerm = discountTerm;
+    }
+
+    public String getDiscountTerm() 
+    {
+        return discountTerm;
+    }
+    public void setDiscountAmt(String discountAmt) 
+    {
+        this.discountAmt = discountAmt;
+    }
+
+    public String getDiscountAmt() 
+    {
+        return discountAmt;
+    }
+    public void setGasoilDiscountAmt(String gasoilDiscountAmt) 
+    {
+        this.gasoilDiscountAmt = gasoilDiscountAmt;
+    }
+
+    public String getGasoilDiscountAmt() 
+    {
+        return gasoilDiscountAmt;
+    }
+    public void setDieseloilDiscountAmt(String dieseloilDiscountAmt) 
+    {
+        this.dieseloilDiscountAmt = dieseloilDiscountAmt;
+    }
+
+    public String getDieseloilDiscountAmt() 
+    {
+        return dieseloilDiscountAmt;
+    }
+    public void setVipDiscountyPlus(String vipDiscountyPlus) 
+    {
+        this.vipDiscountyPlus = vipDiscountyPlus;
+    }
+
+    public String getVipDiscountyPlus() 
+    {
+        return vipDiscountyPlus;
+    }
+    public void setCouponPlus(String couponPlus) 
+    {
+        this.couponPlus = couponPlus;
+    }
+
+    public String getCouponPlus() 
+    {
+        return couponPlus;
+    }
+    public void setDiscountPlanType(String discountPlanType) 
+    {
+        this.discountPlanType = discountPlanType;
+    }
+
+    public String getDiscountPlanType() 
+    {
+        return discountPlanType;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("grade", getGrade())
+            .append("discountTerm", getDiscountTerm())
+            .append("discountAmt", getDiscountAmt())
+            .append("gasoilDiscountAmt", getGasoilDiscountAmt())
+            .append("dieseloilDiscountAmt", getDieseloilDiscountAmt())
+            .append("vipDiscountyPlus", getVipDiscountyPlus())
+            .append("couponPlus", getCouponPlus())
+            .append("discountPlanType", getDiscountPlanType())
+            .toString();
+    }
+}

+ 166 - 0
Yijia-SaaS/yijia-market/src/main/java/com/yijia/market/domain/MarketCoupon.java

@@ -0,0 +1,166 @@
+package com.yijia.market.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.yijia.common.annotation.Excel;
+import com.yijia.common.core.domain.BaseEntity;
+
+/**
+ * 优惠劵管理对象 market_coupon
+ * 
+ * @author yijia
+ * @date 2020-12-22
+ */
+public class MarketCoupon extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long couponId;
+
+    /** 油站编码 */
+    @Excel(name = "油站编码")
+    private String stationNo;
+
+    /** 油站名称 */
+    @Excel(name = "油站名称")
+    private String stationName;
+
+    /** 优惠卷名称 */
+    @Excel(name = "优惠卷名称")
+    private String couponName;
+
+    /** 优惠劵规则 */
+    @Excel(name = "优惠劵规则")
+    private String couponRule;
+
+    /** 优惠类型(0满减,1 立减,2,直降) */
+    @Excel(name = "优惠类型", readConverterExp = "0=满减,1,立=减,2,直降")
+    private String couponType;
+
+    /** 优惠金额 */
+    @Excel(name = "优惠金额")
+    private Long couponAmt;
+
+    /** 满减金额 */
+    @Excel(name = "满减金额")
+    private Long couponReulAmt;
+
+    /** 优惠油品(0汽油,1柴油) */
+    @Excel(name = "优惠油品", readConverterExp = "0=汽油,1柴油")
+    private String couponOil;
+
+    /** 有效期 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date validityDate;
+
+    public void setCouponId(Long couponId) 
+    {
+        this.couponId = couponId;
+    }
+
+    public Long getCouponId() 
+    {
+        return couponId;
+    }
+    public void setStationNo(String stationNo) 
+    {
+        this.stationNo = stationNo;
+    }
+
+    public String getStationNo() 
+    {
+        return stationNo;
+    }
+    public void setStationName(String stationName) 
+    {
+        this.stationName = stationName;
+    }
+
+    public String getStationName() 
+    {
+        return stationName;
+    }
+    public void setCouponName(String couponName) 
+    {
+        this.couponName = couponName;
+    }
+
+    public String getCouponName() 
+    {
+        return couponName;
+    }
+    public void setCouponRule(String couponRule) 
+    {
+        this.couponRule = couponRule;
+    }
+
+    public String getCouponRule() 
+    {
+        return couponRule;
+    }
+    public void setCouponType(String couponType) 
+    {
+        this.couponType = couponType;
+    }
+
+    public String getCouponType() 
+    {
+        return couponType;
+    }
+    public void setCouponAmt(Long couponAmt) 
+    {
+        this.couponAmt = couponAmt;
+    }
+
+    public Long getCouponAmt() 
+    {
+        return couponAmt;
+    }
+    public void setCouponReulAmt(Long couponReulAmt) 
+    {
+        this.couponReulAmt = couponReulAmt;
+    }
+
+    public Long getCouponReulAmt() 
+    {
+        return couponReulAmt;
+    }
+    public void setCouponOil(String couponOil) 
+    {
+        this.couponOil = couponOil;
+    }
+
+    public String getCouponOil() 
+    {
+        return couponOil;
+    }
+    public void setValidityDate(Date validityDate) 
+    {
+        this.validityDate = validityDate;
+    }
+
+    public Date getValidityDate() 
+    {
+        return validityDate;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("couponId", getCouponId())
+            .append("stationNo", getStationNo())
+            .append("stationName", getStationName())
+            .append("couponName", getCouponName())
+            .append("couponRule", getCouponRule())
+            .append("couponType", getCouponType())
+            .append("couponAmt", getCouponAmt())
+            .append("couponReulAmt", getCouponReulAmt())
+            .append("couponOil", getCouponOil())
+            .append("validityDate", getValidityDate())
+            .toString();
+    }
+}

+ 63 - 0
Yijia-SaaS/yijia-market/src/main/java/com/yijia/market/mapper/MarkertPlanMapper.java

@@ -0,0 +1,63 @@
+package com.yijia.market.mapper;
+
+
+import com.yijia.market.domain.MarkertPlan;
+
+import java.util.List;
+
+/**
+ * 营销方案Mapper接口
+ * 
+ * @author yijia
+ * @date 2020-12-22
+ */
+public interface MarkertPlanMapper 
+{
+    /**
+     * 查询营销方案
+     * 
+     * @param id 营销方案ID
+     * @return 营销方案
+     */
+    public MarkertPlan selectMarkertPlanById(Long id);
+
+    /**
+     * 查询营销方案列表
+     * 
+     * @param markertPlan 营销方案
+     * @return 营销方案集合
+     */
+    public List<MarkertPlan> selectMarkertPlanList(MarkertPlan markertPlan);
+
+    /**
+     * 新增营销方案
+     * 
+     * @param markertPlan 营销方案
+     * @return 结果
+     */
+    public int insertMarkertPlan(MarkertPlan markertPlan);
+
+    /**
+     * 修改营销方案
+     * 
+     * @param markertPlan 营销方案
+     * @return 结果
+     */
+    public int updateMarkertPlan(MarkertPlan markertPlan);
+
+    /**
+     * 删除营销方案
+     * 
+     * @param id 营销方案ID
+     * @return 结果
+     */
+    public int deleteMarkertPlanById(Long id);
+
+    /**
+     * 批量删除营销方案
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteMarkertPlanByIds(Long[] ids);
+}

+ 61 - 0
Yijia-SaaS/yijia-market/src/main/java/com/yijia/market/mapper/MarketCouponMapper.java

@@ -0,0 +1,61 @@
+package com.yijia.market.mapper;
+
+import java.util.List;
+import com.yijia.market.domain.MarketCoupon;
+
+/**
+ * 优惠劵管理Mapper接口
+ * 
+ * @author yijia
+ * @date 2020-12-22
+ */
+public interface MarketCouponMapper 
+{
+    /**
+     * 查询优惠劵管理
+     * 
+     * @param couponId 优惠劵管理ID
+     * @return 优惠劵管理
+     */
+    public MarketCoupon selectMarketCouponById(Long couponId);
+
+    /**
+     * 查询优惠劵管理列表
+     * 
+     * @param marketCoupon 优惠劵管理
+     * @return 优惠劵管理集合
+     */
+    public List<MarketCoupon> selectMarketCouponList(MarketCoupon marketCoupon);
+
+    /**
+     * 新增优惠劵管理
+     * 
+     * @param marketCoupon 优惠劵管理
+     * @return 结果
+     */
+    public int insertMarketCoupon(MarketCoupon marketCoupon);
+
+    /**
+     * 修改优惠劵管理
+     * 
+     * @param marketCoupon 优惠劵管理
+     * @return 结果
+     */
+    public int updateMarketCoupon(MarketCoupon marketCoupon);
+
+    /**
+     * 删除优惠劵管理
+     * 
+     * @param couponId 优惠劵管理ID
+     * @return 结果
+     */
+    public int deleteMarketCouponById(Long couponId);
+
+    /**
+     * 批量删除优惠劵管理
+     * 
+     * @param couponIds 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteMarketCouponByIds(Long[] couponIds);
+}

+ 61 - 0
Yijia-SaaS/yijia-market/src/main/java/com/yijia/market/service/IMarkertPlanService.java

@@ -0,0 +1,61 @@
+package com.yijia.market.service;
+
+import java.util.List;
+import com.yijia.market.domain.MarkertPlan;
+
+/**
+ * 营销方案Service接口
+ * 
+ * @author yijia
+ * @date 2020-12-22
+ */
+public interface IMarkertPlanService 
+{
+    /**
+     * 查询营销方案
+     * 
+     * @param id 营销方案ID
+     * @return 营销方案
+     */
+    public MarkertPlan selectMarkertPlanById(Long id);
+
+    /**
+     * 查询营销方案列表
+     * 
+     * @param markertPlan 营销方案
+     * @return 营销方案集合
+     */
+    public List<MarkertPlan> selectMarkertPlanList(MarkertPlan markertPlan);
+
+    /**
+     * 新增营销方案
+     * 
+     * @param markertPlan 营销方案
+     * @return 结果
+     */
+    public int insertMarkertPlan(MarkertPlan markertPlan);
+
+    /**
+     * 修改营销方案
+     * 
+     * @param markertPlan 营销方案
+     * @return 结果
+     */
+    public int updateMarkertPlan(MarkertPlan markertPlan);
+
+    /**
+     * 批量删除营销方案
+     * 
+     * @param ids 需要删除的营销方案ID
+     * @return 结果
+     */
+    public int deleteMarkertPlanByIds(Long[] ids);
+
+    /**
+     * 删除营销方案信息
+     * 
+     * @param id 营销方案ID
+     * @return 结果
+     */
+    public int deleteMarkertPlanById(Long id);
+}

+ 61 - 0
Yijia-SaaS/yijia-market/src/main/java/com/yijia/market/service/IMarketCouponService.java

@@ -0,0 +1,61 @@
+package com.yijia.market.service;
+
+import java.util.List;
+import com.yijia.market.domain.MarketCoupon;
+
+/**
+ * 优惠劵管理Service接口
+ * 
+ * @author yijia
+ * @date 2020-12-22
+ */
+public interface IMarketCouponService 
+{
+    /**
+     * 查询优惠劵管理
+     * 
+     * @param couponId 优惠劵管理ID
+     * @return 优惠劵管理
+     */
+    public MarketCoupon selectMarketCouponById(Long couponId);
+
+    /**
+     * 查询优惠劵管理列表
+     * 
+     * @param marketCoupon 优惠劵管理
+     * @return 优惠劵管理集合
+     */
+    public List<MarketCoupon> selectMarketCouponList(MarketCoupon marketCoupon);
+
+    /**
+     * 新增优惠劵管理
+     * 
+     * @param marketCoupon 优惠劵管理
+     * @return 结果
+     */
+    public int insertMarketCoupon(MarketCoupon marketCoupon);
+
+    /**
+     * 修改优惠劵管理
+     * 
+     * @param marketCoupon 优惠劵管理
+     * @return 结果
+     */
+    public int updateMarketCoupon(MarketCoupon marketCoupon);
+
+    /**
+     * 批量删除优惠劵管理
+     * 
+     * @param couponIds 需要删除的优惠劵管理ID
+     * @return 结果
+     */
+    public int deleteMarketCouponByIds(Long[] couponIds);
+
+    /**
+     * 删除优惠劵管理信息
+     * 
+     * @param couponId 优惠劵管理ID
+     * @return 结果
+     */
+    public int deleteMarketCouponById(Long couponId);
+}

+ 93 - 0
Yijia-SaaS/yijia-market/src/main/java/com/yijia/market/service/impl/MarkertPlanServiceImpl.java

@@ -0,0 +1,93 @@
+package com.yijia.market.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.yijia.market.mapper.MarkertPlanMapper;
+import com.yijia.market.domain.MarkertPlan;
+import com.yijia.market.service.IMarkertPlanService;
+
+/**
+ * 营销方案Service业务层处理
+ * 
+ * @author yijia
+ * @date 2020-12-22
+ */
+@Service
+public class MarkertPlanServiceImpl implements IMarkertPlanService 
+{
+    @Autowired
+    private MarkertPlanMapper markertPlanMapper;
+
+    /**
+     * 查询营销方案
+     * 
+     * @param id 营销方案ID
+     * @return 营销方案
+     */
+    @Override
+    public MarkertPlan selectMarkertPlanById(Long id)
+    {
+        return markertPlanMapper.selectMarkertPlanById(id);
+    }
+
+    /**
+     * 查询营销方案列表
+     * 
+     * @param markertPlan 营销方案
+     * @return 营销方案
+     */
+    @Override
+    public List<MarkertPlan> selectMarkertPlanList(MarkertPlan markertPlan)
+    {
+        return markertPlanMapper.selectMarkertPlanList(markertPlan);
+    }
+
+    /**
+     * 新增营销方案
+     * 
+     * @param markertPlan 营销方案
+     * @return 结果
+     */
+    @Override
+    public int insertMarkertPlan(MarkertPlan markertPlan)
+    {
+        return markertPlanMapper.insertMarkertPlan(markertPlan);
+    }
+
+    /**
+     * 修改营销方案
+     * 
+     * @param markertPlan 营销方案
+     * @return 结果
+     */
+    @Override
+    public int updateMarkertPlan(MarkertPlan markertPlan)
+    {
+        return markertPlanMapper.updateMarkertPlan(markertPlan);
+    }
+
+    /**
+     * 批量删除营销方案
+     * 
+     * @param ids 需要删除的营销方案ID
+     * @return 结果
+     */
+    @Override
+    public int deleteMarkertPlanByIds(Long[] ids)
+    {
+        return markertPlanMapper.deleteMarkertPlanByIds(ids);
+    }
+
+    /**
+     * 删除营销方案信息
+     * 
+     * @param id 营销方案ID
+     * @return 结果
+     */
+    @Override
+    public int deleteMarkertPlanById(Long id)
+    {
+        return markertPlanMapper.deleteMarkertPlanById(id);
+    }
+}

+ 93 - 0
Yijia-SaaS/yijia-market/src/main/java/com/yijia/market/service/impl/MarketCouponServiceImpl.java

@@ -0,0 +1,93 @@
+package com.yijia.market.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.yijia.market.mapper.MarketCouponMapper;
+import com.yijia.market.domain.MarketCoupon;
+import com.yijia.market.service.IMarketCouponService;
+
+/**
+ * 优惠劵管理Service业务层处理
+ * 
+ * @author yijia
+ * @date 2020-12-22
+ */
+@Service
+public class MarketCouponServiceImpl implements IMarketCouponService 
+{
+    @Autowired
+    private MarketCouponMapper marketCouponMapper;
+
+    /**
+     * 查询优惠劵管理
+     * 
+     * @param couponId 优惠劵管理ID
+     * @return 优惠劵管理
+     */
+    @Override
+    public MarketCoupon selectMarketCouponById(Long couponId)
+    {
+        return marketCouponMapper.selectMarketCouponById(couponId);
+    }
+
+    /**
+     * 查询优惠劵管理列表
+     * 
+     * @param marketCoupon 优惠劵管理
+     * @return 优惠劵管理
+     */
+    @Override
+    public List<MarketCoupon> selectMarketCouponList(MarketCoupon marketCoupon)
+    {
+        return marketCouponMapper.selectMarketCouponList(marketCoupon);
+    }
+
+    /**
+     * 新增优惠劵管理
+     * 
+     * @param marketCoupon 优惠劵管理
+     * @return 结果
+     */
+    @Override
+    public int insertMarketCoupon(MarketCoupon marketCoupon)
+    {
+        return marketCouponMapper.insertMarketCoupon(marketCoupon);
+    }
+
+    /**
+     * 修改优惠劵管理
+     * 
+     * @param marketCoupon 优惠劵管理
+     * @return 结果
+     */
+    @Override
+    public int updateMarketCoupon(MarketCoupon marketCoupon)
+    {
+        return marketCouponMapper.updateMarketCoupon(marketCoupon);
+    }
+
+    /**
+     * 批量删除优惠劵管理
+     * 
+     * @param couponIds 需要删除的优惠劵管理ID
+     * @return 结果
+     */
+    @Override
+    public int deleteMarketCouponByIds(Long[] couponIds)
+    {
+        return marketCouponMapper.deleteMarketCouponByIds(couponIds);
+    }
+
+    /**
+     * 删除优惠劵管理信息
+     * 
+     * @param couponId 优惠劵管理ID
+     * @return 结果
+     */
+    @Override
+    public int deleteMarketCouponById(Long couponId)
+    {
+        return marketCouponMapper.deleteMarketCouponById(couponId);
+    }
+}

+ 92 - 0
Yijia-SaaS/yijia-market/src/main/resources/mapper/market/MarkertPlanMapper.xml

@@ -0,0 +1,92 @@
+<?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.yijia.market.mapper.MarkertPlanMapper">
+    
+    <resultMap type="MarkertPlan" id="MarkertPlanResult">
+        <result property="id"    column="id"    />
+        <result property="grade"    column="grade"    />
+        <result property="discountTerm"    column="discount_term"    />
+        <result property="discountAmt"    column="discount_amt"    />
+        <result property="gasoilDiscountAmt"    column="gasoil_discount_amt"    />
+        <result property="dieseloilDiscountAmt"    column="dieseloil_discount_amt"    />
+        <result property="vipDiscountyPlus"    column="vip_discounty_plus"    />
+        <result property="couponPlus"    column="coupon_plus"    />
+        <result property="discountPlanType"    column="discount_plan_type"    />
+    </resultMap>
+
+    <sql id="selectMarkertPlanVo">
+        select id, grade, discount_term, discount_amt, gasoil_discount_amt, dieseloil_discount_amt, vip_discounty_plus, coupon_plus, discount_plan_type from markert_plan
+    </sql>
+
+    <select id="selectMarkertPlanList" parameterType="MarkertPlan" resultMap="MarkertPlanResult">
+        <include refid="selectMarkertPlanVo"/>
+        <where>  
+            <if test="grade != null  and grade != ''"> and grade = #{grade}</if>
+            <if test="discountTerm != null  and discountTerm != ''"> and discount_term = #{discountTerm}</if>
+            <if test="discountAmt != null  and discountAmt != ''"> and discount_amt = #{discountAmt}</if>
+            <if test="gasoilDiscountAmt != null  and gasoilDiscountAmt != ''"> and gasoil_discount_amt = #{gasoilDiscountAmt}</if>
+            <if test="dieseloilDiscountAmt != null  and dieseloilDiscountAmt != ''"> and dieseloil_discount_amt = #{dieseloilDiscountAmt}</if>
+            <if test="vipDiscountyPlus != null  and vipDiscountyPlus != ''"> and vip_discounty_plus = #{vipDiscountyPlus}</if>
+            <if test="couponPlus != null  and couponPlus != ''"> and coupon_plus = #{couponPlus}</if>
+            <if test="discountPlanType != null  and discountPlanType != ''"> and discount_plan_type = #{discountPlanType}</if>
+        </where>
+    </select>
+    
+    <select id="selectMarkertPlanById" parameterType="Long" resultMap="MarkertPlanResult">
+        <include refid="selectMarkertPlanVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertMarkertPlan" parameterType="MarkertPlan" useGeneratedKeys="true" keyProperty="id">
+        insert into markert_plan
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="grade != null">grade,</if>
+            <if test="discountTerm != null">discount_term,</if>
+            <if test="discountAmt != null">discount_amt,</if>
+            <if test="gasoilDiscountAmt != null">gasoil_discount_amt,</if>
+            <if test="dieseloilDiscountAmt != null">dieseloil_discount_amt,</if>
+            <if test="vipDiscountyPlus != null">vip_discounty_plus,</if>
+            <if test="couponPlus != null">coupon_plus,</if>
+            <if test="discountPlanType != null">discount_plan_type,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="grade != null">#{grade},</if>
+            <if test="discountTerm != null">#{discountTerm},</if>
+            <if test="discountAmt != null">#{discountAmt},</if>
+            <if test="gasoilDiscountAmt != null">#{gasoilDiscountAmt},</if>
+            <if test="dieseloilDiscountAmt != null">#{dieseloilDiscountAmt},</if>
+            <if test="vipDiscountyPlus != null">#{vipDiscountyPlus},</if>
+            <if test="couponPlus != null">#{couponPlus},</if>
+            <if test="discountPlanType != null">#{discountPlanType},</if>
+         </trim>
+    </insert>
+
+    <update id="updateMarkertPlan" parameterType="MarkertPlan">
+        update markert_plan
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="grade != null">grade = #{grade},</if>
+            <if test="discountTerm != null">discount_term = #{discountTerm},</if>
+            <if test="discountAmt != null">discount_amt = #{discountAmt},</if>
+            <if test="gasoilDiscountAmt != null">gasoil_discount_amt = #{gasoilDiscountAmt},</if>
+            <if test="dieseloilDiscountAmt != null">dieseloil_discount_amt = #{dieseloilDiscountAmt},</if>
+            <if test="vipDiscountyPlus != null">vip_discounty_plus = #{vipDiscountyPlus},</if>
+            <if test="couponPlus != null">coupon_plus = #{couponPlus},</if>
+            <if test="discountPlanType != null">discount_plan_type = #{discountPlanType},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteMarkertPlanById" parameterType="Long">
+        delete from markert_plan where id = #{id}
+    </delete>
+
+    <delete id="deleteMarkertPlanByIds" parameterType="String">
+        delete from markert_plan where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+    
+</mapper>

+ 97 - 0
Yijia-SaaS/yijia-market/src/main/resources/mapper/market/MarketCouponMapper.xml

@@ -0,0 +1,97 @@
+<?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.yijia.market.mapper.MarketCouponMapper">
+    
+    <resultMap type="MarketCoupon" id="MarketCouponResult">
+        <result property="couponId"    column="coupon_id"    />
+        <result property="stationNo"    column="station_no"    />
+        <result property="stationName"    column="station_name"    />
+        <result property="couponName"    column="coupon_name"    />
+        <result property="couponRule"    column="coupon_rule"    />
+        <result property="couponType"    column="coupon_type"    />
+        <result property="couponAmt"    column="coupon_amt"    />
+        <result property="couponReulAmt"    column="coupon_reul_amt"    />
+        <result property="couponOil"    column="coupon_oil"    />
+        <result property="validityDate"    column="validity_date"    />
+    </resultMap>
+
+    <sql id="selectMarketCouponVo">
+        select coupon_id, station_no, station_name, coupon_name, coupon_rule, coupon_type, coupon_amt, coupon_reul_amt, coupon_oil, validity_date from market_coupon
+    </sql>
+
+    <select id="selectMarketCouponList" parameterType="MarketCoupon" resultMap="MarketCouponResult">
+        <include refid="selectMarketCouponVo"/>
+        <where>  
+            <if test="stationNo != null  and stationNo != ''"> and station_no = #{stationNo}</if>
+            <if test="stationName != null  and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
+            <if test="couponName != null  and couponName != ''"> and coupon_name like concat('%', #{couponName}, '%')</if>
+            <if test="couponRule != null  and couponRule != ''"> and coupon_rule = #{couponRule}</if>
+            <if test="couponType != null  and couponType != ''"> and coupon_type = #{couponType}</if>
+            <if test="couponAmt != null "> and coupon_amt = #{couponAmt}</if>
+            <if test="couponReulAmt != null "> and coupon_reul_amt = #{couponReulAmt}</if>
+            <if test="couponOil != null  and couponOil != ''"> and coupon_oil = #{couponOil}</if>
+            <if test="validityDate != null "> and validity_date = #{validityDate}</if>
+        </where>
+    </select>
+    
+    <select id="selectMarketCouponById" parameterType="Long" resultMap="MarketCouponResult">
+        <include refid="selectMarketCouponVo"/>
+        where coupon_id = #{couponId}
+    </select>
+        
+    <insert id="insertMarketCoupon" parameterType="MarketCoupon" useGeneratedKeys="true" keyProperty="couponId">
+        insert into market_coupon
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="stationNo != null">station_no,</if>
+            <if test="stationName != null">station_name,</if>
+            <if test="couponName != null">coupon_name,</if>
+            <if test="couponRule != null">coupon_rule,</if>
+            <if test="couponType != null">coupon_type,</if>
+            <if test="couponAmt != null">coupon_amt,</if>
+            <if test="couponReulAmt != null">coupon_reul_amt,</if>
+            <if test="couponOil != null">coupon_oil,</if>
+            <if test="validityDate != null">validity_date,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="stationNo != null">#{stationNo},</if>
+            <if test="stationName != null">#{stationName},</if>
+            <if test="couponName != null">#{couponName},</if>
+            <if test="couponRule != null">#{couponRule},</if>
+            <if test="couponType != null">#{couponType},</if>
+            <if test="couponAmt != null">#{couponAmt},</if>
+            <if test="couponReulAmt != null">#{couponReulAmt},</if>
+            <if test="couponOil != null">#{couponOil},</if>
+            <if test="validityDate != null">#{validityDate},</if>
+         </trim>
+    </insert>
+
+    <update id="updateMarketCoupon" parameterType="MarketCoupon">
+        update market_coupon
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="stationNo != null">station_no = #{stationNo},</if>
+            <if test="stationName != null">station_name = #{stationName},</if>
+            <if test="couponName != null">coupon_name = #{couponName},</if>
+            <if test="couponRule != null">coupon_rule = #{couponRule},</if>
+            <if test="couponType != null">coupon_type = #{couponType},</if>
+            <if test="couponAmt != null">coupon_amt = #{couponAmt},</if>
+            <if test="couponReulAmt != null">coupon_reul_amt = #{couponReulAmt},</if>
+            <if test="couponOil != null">coupon_oil = #{couponOil},</if>
+            <if test="validityDate != null">validity_date = #{validityDate},</if>
+        </trim>
+        where coupon_id = #{couponId}
+    </update>
+
+    <delete id="deleteMarketCouponById" parameterType="Long">
+        delete from market_coupon where coupon_id = #{couponId}
+    </delete>
+
+    <delete id="deleteMarketCouponByIds" parameterType="String">
+        delete from market_coupon where coupon_id in 
+        <foreach item="couponId" collection="array" open="(" separator="," close=")">
+            #{couponId}
+        </foreach>
+    </delete>
+    
+</mapper>