Ver código fonte

订单中心

wangxiaoming 6 anos atrás
pai
commit
58e697396d

+ 91 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/StoreShip.java

@@ -0,0 +1,91 @@
+package com.iamberry.rst.core.cm;
+
+import  java.util.Date;
+import  java.io.Serializable;
+/**
+ *  类
+ * @author ljk
+ * @Date 2018-09-13
+ */
+public class StoreShip  implements  Serializable{
+    //
+    private Integer storeShipId;
+    //店铺id
+    private Integer storeId;
+    //发货人姓名
+    private String storeShipName;
+    //发货人电话号码
+    private String storeShipTel;
+    //发货人省份
+    private String storeShipProvince;
+    //发货人城市
+    private String storeShipCity;
+    //发货人地址
+    private String storeShipAddress;
+    //创建时间'
+    private Date storeShipCreateDate;
+
+    public Integer getStoreShipId(){
+        return storeShipId;
+    }
+
+    public void setStoreShipId(Integer  storeShipId){
+        this.storeShipId=storeShipId;
+    }
+
+    public Integer getStoreId(){
+        return storeId;
+    }
+
+    public void setStoreId(Integer  storeId){
+        this.storeId=storeId;
+    }
+
+    public String getStoreShipName(){
+        return storeShipName;
+    }
+
+    public void setStoreShipName(String  storeShipName){
+        this.storeShipName=storeShipName;
+    }
+
+    public String getStoreShipTel(){
+        return storeShipTel;
+    }
+
+    public void setStoreShipTel(String  storeShipTel){
+        this.storeShipTel=storeShipTel;
+    }
+
+    public String getStoreShipProvince(){
+        return storeShipProvince;
+    }
+
+    public void setStoreShipProvince(String  storeShipProvince){
+        this.storeShipProvince=storeShipProvince;
+    }
+
+    public String getStoreShipCity(){
+        return storeShipCity;
+    }
+
+    public void setStoreShipCity(String  storeShipCity){
+        this.storeShipCity=storeShipCity;
+    }
+
+    public String getStoreShipAddress(){
+        return storeShipAddress;
+    }
+
+    public void setStoreShipAddress(String  storeShipAddress){
+        this.storeShipAddress=storeShipAddress;
+    }
+
+    public Date getStoreShipCreateDate(){
+        return storeShipCreateDate;
+    }
+
+    public void setStoreShipCreateDate(Date  storeShipCreateDate){
+        this.storeShipCreateDate=storeShipCreateDate;
+    }
+}

+ 37 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/StoreShipService.java

@@ -0,0 +1,37 @@
+package com.iamberry.rst.faces.cm;
+
+import com.iamberry.rst.core.cm.StoreShip;
+
+import java.util.List;
+
+/**
+ *  接口
+ * @author ljk
+ * @Date 2018-09-13
+ */
+public interface StoreShipService {
+    /**
+     * 获取集合
+     * @param  storeShip
+     * @return List
+     */
+    List<StoreShip> getStoreShipList(StoreShip  storeShip);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  storeShip
+     */
+    StoreShip  getStoreShipById(Integer  id);
+    /**
+     * 增加数据
+     * @param  storeShip
+     * @return Integer
+     */
+    Integer  save(StoreShip  storeShip);
+    /**
+     * 修改数据
+     * @param  storeShip
+     * @return Integer
+     */
+    Integer  update(StoreShip  storeShip);
+}

+ 56 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/StoreShipServiceImpl.java

@@ -0,0 +1,56 @@
+package com.iamberry.rst.service.cm;
+
+import com.iamberry.rst.core.cm.StoreShip;
+import com.iamberry.rst.faces.cm.StoreShipService;
+import com.iamberry.rst.service.cm.mapper.StoreShipMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ *  接口
+ * @author ljk
+ * @Date 2018-09-13
+ */
+@Service
+public class StoreShipServiceImpl  implements StoreShipService {
+    @Autowired
+    private StoreShipMapper storeShipMapper;
+    /**
+     * 获取集合
+     * @param  storeShip
+     * @return List
+     */
+    @Override
+    public List<StoreShip> getStoreShipList(StoreShip  storeShip){
+        return  storeShipMapper.getStoreShipList(storeShip);
+    }
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  storeShip
+     */
+    @Override
+    public  StoreShip  getStoreShipById(Integer  id){
+        return  storeShipMapper.getStoreShipById(id);
+    }
+    /**
+     * 增加数据
+     * @param  storeShip
+     * @return Integer
+     */
+    @Override
+    public  Integer  save(StoreShip  storeShip){
+        return  storeShipMapper.save(storeShip);
+    }
+    /**
+     * 修改数据
+     * @param  storeShip
+     * @return Integer
+     */
+    @Override
+    public  Integer  update(StoreShip  storeShip){
+        return  storeShipMapper.update(storeShip);
+    }
+}

+ 37 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/StoreShipMapper.java

@@ -0,0 +1,37 @@
+package com.iamberry.rst.service.cm.mapper;
+
+import com.iamberry.rst.core.cm.StoreShip;
+
+import java.util.List;
+
+/**
+ *  接口
+ * @author ljk
+ * @Date 2018-09-13
+ */
+public interface StoreShipMapper {
+    /**
+     * 获取集合
+     * @param  storeShip
+     * @return List
+     */
+    List<StoreShip> getStoreShipList(StoreShip  storeShip);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  storeShip
+     */
+    StoreShip  getStoreShipById(Integer  id);
+    /**
+     * 增加数据
+     * @param  storeShip
+     * @return Integer
+     */
+    Integer  save(StoreShip  storeShip);
+    /**
+     * 修改数据
+     * @param  storeShip
+     * @return Integer
+     */
+    Integer  update(StoreShip  storeShip);
+}

+ 95 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/storeShipMapper.xml

@@ -0,0 +1,95 @@
+<?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.iamberry.rst.service.cm.mapper.StoreShipMapper">
+    <resultMap  id="BaseResultMap" type="StoreShip" >
+        <result    column="store_ship_id"    property="storeShipId" />
+        <result    column="store_id"    property="storeId" />
+        <result    column="store_ship_name"    property="storeShipName" />
+        <result    column="store_ship_tel"    property="storeShipTel" />
+        <result    column="store_ship_province"    property="storeShipProvince" />
+        <result    column="store_ship_city"    property="storeShipCity" />
+        <result    column="store_ship_address"    property="storeShipAddress" />
+        <result    column="store_ship_create_date"    property="storeShipCreateDate" />
+    </resultMap>
+    <sql    id="Base_List" >
+        t.store_ship_id,
+        t.store_id,
+        t.store_ship_name,
+        t.store_ship_tel,
+        t.store_ship_province,
+        t.store_ship_city,
+        t.store_ship_address,
+        t.store_ship_create_date
+    </sql>
+    <select id="getStoreShipList" resultMap="BaseResultMap" parameterType="StoreShip" >
+        select
+        <include refid="Base_List" />
+        from tb_rst_store_ship t
+        <where>
+            <if test="storeShipId != null ">
+                AND t.store_ship_id = #{storeShipId}
+            </if >
+            <if test="storeId != null ">
+                AND t.store_id = #{storeId}
+            </if >
+            <if test="storeShipName != null and storeShipName != ''">
+                AND t.store_ship_name  like  CONCAT ('%',#{storeShipName},'%')
+            </if >
+            <if test="storeShipTel != null and storeShipTel != ''">
+                AND t.store_ship_tel  like  CONCAT ('%',#{storeShipTel},'%')
+            </if >
+        </where>
+    </select>
+    <select id="getStoreShipById" resultMap="BaseResultMap" parameterType="Integer" >
+        select
+        <include refid="Base_List" />
+        from tb_rst_store_ship t
+        where t.store_ship_id= #{storeShipId}
+    </select>
+    <insert id="save" parameterType="StoreShip" >
+        insert into
+        tb_rst_store_ship
+        (
+        store_id,
+        store_ship_name,
+        store_ship_tel,
+        store_ship_province,
+        store_ship_city,
+        store_ship_address
+        )
+        values
+        (
+        #{storeId},
+        #{storeShipName},
+        #{storeShipTel},
+        #{storeShipProvince},
+        #{storeShipCity},
+        #{storeShipAddress}
+        )
+    </insert>
+    <update id="update" parameterType="StoreShip" >
+        update
+        tb_rst_store_ship
+        <set >
+            <if test="storeId != null ">
+                store_id = #{storeId},
+            </if >
+            <if test="storeShipName != null and storeShipName != ''">
+                store_ship_name = #{storeShipName},
+            </if >
+            <if test="storeShipTel != null and storeShipTel != ''">
+                store_ship_tel = #{storeShipTel},
+            </if >
+            <if test="storeShipProvince != null and storeShipProvince != ''">
+                store_ship_province = #{storeShipProvince},
+            </if >
+            <if test="storeShipCity != null and storeShipCity != ''">
+                store_ship_city = #{storeShipCity},
+            </if >
+            <if test="storeShipAddress != null and storeShipAddress != ''">
+                store_ship_address = #{storeShipAddress},
+            </if >
+        </set >
+        where store_ship_id= #{storeShipId}
+    </update>
+</mapper>