Browse Source

增加交货地址

chenw 7 years ago
parent
commit
5bdea4fefe

+ 78 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/Address.java

@@ -0,0 +1,78 @@
+package com.usoftchina.saas.document.entities;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class Address extends CommonBaseEntity implements Serializable {
+    private Date ad_recorddate;
+
+    private String ad_text1;
+
+    private String ad_text2;
+
+    private String ad_text3;
+
+    private String ad_text4;
+
+    private String ad_text5;
+
+    private String ad_address;
+
+    public Date getAd_recorddate() {
+        return ad_recorddate;
+    }
+
+    public void setAd_recorddate(Date ad_recorddate) {
+        this.ad_recorddate = ad_recorddate;
+    }
+
+    public String getAd_text1() {
+        return ad_text1;
+    }
+
+    public void setAd_text1(String ad_text1) {
+        this.ad_text1 = ad_text1 == null ? null : ad_text1.trim();
+    }
+
+    public String getAd_text2() {
+        return ad_text2;
+    }
+
+    public void setAd_text2(String ad_text2) {
+        this.ad_text2 = ad_text2 == null ? null : ad_text2.trim();
+    }
+
+    public String getAd_text3() {
+        return ad_text3;
+    }
+
+    public void setAd_text3(String ad_text3) {
+        this.ad_text3 = ad_text3 == null ? null : ad_text3.trim();
+    }
+
+    public String getAd_text4() {
+        return ad_text4;
+    }
+
+    public void setAd_text4(String ad_text4) {
+        this.ad_text4 = ad_text4 == null ? null : ad_text4.trim();
+    }
+
+    public String getAd_text5() {
+        return ad_text5;
+    }
+
+    public void setAd_text5(String ad_text5) {
+        this.ad_text5 = ad_text5 == null ? null : ad_text5.trim();
+    }
+
+    public String getAd_address() {
+        return ad_address;
+    }
+
+    public void setAd_address(String ad_address) {
+        this.ad_address = ad_address == null ? null : ad_address.trim();
+    }
+}

+ 38 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/AddressController.java

@@ -0,0 +1,38 @@
+package com.usoftchina.saas.document.controller;
+
+
+import com.sun.org.apache.regexp.internal.RE;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.document.entities.Address;
+import com.usoftchina.saas.document.service.AddressService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/address")
+public class AddressController {
+
+    @Autowired
+    private AddressService addressService;
+
+    @PostMapping("/save")
+    public Result save(Address address){
+        addressService.save(address);
+        return Result.success();
+    }
+
+    @PostMapping("/delete/{id}")
+    public Result deleteById(Long id){
+        addressService.removeByPrimaryKey(id);
+        return Result.success();
+    }
+
+    @PostMapping("/batchDelete")
+    public Result deleteByIds(String ids){
+        addressService.removeByIds(ids);
+        return Result.success();
+    }
+
+}

+ 24 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/AddressMapper.java

@@ -0,0 +1,24 @@
+package com.usoftchina.saas.document.mapper;
+
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.document.entities.Address;
+import java.util.List;
+
+public interface AddressMapper extends CommonBaseMapper<Address> {
+
+    int deleteByPrimaryKey(Long ad_id);
+
+    int insert(Address record);
+
+    int insertSelective(Address record);
+
+    Address selectByPrimaryKey(Long ad_id);
+
+    int updateByPrimaryKeySelective(Address record);
+
+    int updateByPrimaryKeyWithBLOBs(Address record);
+
+    int updateByPrimaryKey(Address record);
+
+    int deleteByIds(String ids);
+}

+ 11 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/AddressService.java

@@ -0,0 +1,11 @@
+package com.usoftchina.saas.document.service;
+
+import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.document.entities.Address;
+import com.usoftchina.saas.document.mapper.AddressMapper;
+
+public interface AddressService extends CommonBaseService<AddressMapper, Address>  {
+
+    void removeByIds(String ids);
+
+}

+ 51 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/AddressServiceImpl.java

@@ -0,0 +1,51 @@
+package com.usoftchina.saas.document.service.impl;
+
+import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.api.MaxnumberService;
+import com.usoftchina.saas.document.entities.Address;
+import com.usoftchina.saas.document.mapper.AddressMapper;
+import com.usoftchina.saas.document.service.AddressService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class AddressServiceImpl extends CommonBaseServiceImpl<AddressMapper, Address> implements AddressService {
+
+    @Autowired
+    private AddressMapper addressMapper;
+
+    /**
+     * 保存
+     * @param address
+     * @return
+     */
+    @Override
+    public boolean save(Address address){
+        addressMapper.insertSelective(address);
+        return true;
+    }
+
+    /**
+     * 通过主键删除
+     * @param id
+     * @return
+     */
+    @Override
+    public boolean removeByPrimaryKey(Long id){
+        if(id != null && id > 0){
+            addressMapper.deleteByPrimaryKey(id);
+        }
+        return true;
+    }
+
+    /**
+     * 批量删除
+     * @param ids
+     */
+    @Override
+    public void removeByIds(String ids) {
+        if(ids != null && ids.length() > 0){
+            addressMapper.deleteByIds(ids);
+        }
+    }
+}

+ 182 - 0
applications/document/document-server/src/main/resources/mapper/AddressMapper.xml

@@ -0,0 +1,182 @@
+<?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.usoftchina.saas.document.mapper.AddressMapper">
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Address">
+    <id column="ad_id" jdbcType="INTEGER" property="ad_id" />
+    <result column="ad_recorddate" jdbcType="TIMESTAMP" property="ad_recorddate" />
+    <result column="companyId" jdbcType="INTEGER" property="companyId" />
+    <result column="updaterId" jdbcType="INTEGER" property="updaterId" />
+    <result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="ad_text1" jdbcType="VARCHAR" property="ad_text1" />
+    <result column="ad_text2" jdbcType="VARCHAR" property="ad_text2" />
+    <result column="ad_text3" jdbcType="VARCHAR" property="ad_text3" />
+    <result column="ad_text4" jdbcType="VARCHAR" property="ad_text4" />
+    <result column="ad_text5" jdbcType="VARCHAR" property="ad_text5" />
+  </resultMap>
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.usoftchina.saas.document.entities.Address">
+    <result column="ad_address" jdbcType="LONGVARCHAR" property="ad_address" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    ad_id, ad_recorddate, companyId, updaterId, updateTime, ad_text1, ad_text2, ad_text3, 
+    ad_text4, ad_text5
+  </sql>
+  <sql id="Blob_Column_List">
+    ad_address
+  </sql>
+
+  <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Address">
+    insert into address (ad_id, ad_recorddate, companyId, 
+      updaterId, updateTime, ad_text1, 
+      ad_text2, ad_text3, ad_text4, 
+      ad_text5, ad_address)
+    values (#{ad_id,jdbcType=INTEGER}, #{ad_recorddate,jdbcType=TIMESTAMP}, #{companyId,jdbcType=INTEGER}, 
+      #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{ad_text1,jdbcType=VARCHAR}, 
+      #{ad_text2,jdbcType=VARCHAR}, #{ad_text3,jdbcType=VARCHAR}, #{ad_text4,jdbcType=VARCHAR}, 
+      #{ad_text5,jdbcType=VARCHAR}, #{ad_address,jdbcType=LONGVARCHAR})
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Address">
+    insert into address
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="ad_id != null">
+        ad_id,
+      </if>
+      <if test="ad_recorddate != null">
+        ad_recorddate,
+      </if>
+      <if test="companyId != null">
+        companyId,
+      </if>
+      <if test="updaterId != null">
+        updaterId,
+      </if>
+      <if test="updateTime != null">
+        updateTime,
+      </if>
+      <if test="ad_text1 != null">
+        ad_text1,
+      </if>
+      <if test="ad_text2 != null">
+        ad_text2,
+      </if>
+      <if test="ad_text3 != null">
+        ad_text3,
+      </if>
+      <if test="ad_text4 != null">
+        ad_text4,
+      </if>
+      <if test="ad_text5 != null">
+        ad_text5,
+      </if>
+      <if test="ad_address != null">
+        ad_address,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="ad_id != null">
+        #{ad_id,jdbcType=INTEGER},
+      </if>
+      <if test="ad_recorddate != null">
+        #{ad_recorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="companyId != null">
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null">
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ad_text1 != null">
+        #{ad_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_text2 != null">
+        #{ad_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_text3 != null">
+        #{ad_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_text4 != null">
+        #{ad_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_text5 != null">
+        #{ad_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_address != null">
+        #{ad_address,jdbcType=LONGVARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Address">
+    update address
+    <set>
+      <if test="ad_recorddate != null">
+        ad_recorddate = #{ad_recorddate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="companyId != null">
+        companyId = #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterId != null">
+        updaterId = #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null">
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ad_text1 != null">
+        ad_text1 = #{ad_text1,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_text2 != null">
+        ad_text2 = #{ad_text2,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_text3 != null">
+        ad_text3 = #{ad_text3,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_text4 != null">
+        ad_text4 = #{ad_text4,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_text5 != null">
+        ad_text5 = #{ad_text5,jdbcType=VARCHAR},
+      </if>
+      <if test="ad_address != null">
+        ad_address = #{ad_address,jdbcType=LONGVARCHAR},
+      </if>
+    </set>
+    where ad_id = #{ad_id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.document.entities.Address">
+    update address
+    set ad_recorddate = #{ad_recorddate,jdbcType=TIMESTAMP},
+      companyId = #{companyId,jdbcType=INTEGER},
+      updaterId = #{updaterId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      ad_text1 = #{ad_text1,jdbcType=VARCHAR},
+      ad_text2 = #{ad_text2,jdbcType=VARCHAR},
+      ad_text3 = #{ad_text3,jdbcType=VARCHAR},
+      ad_text4 = #{ad_text4,jdbcType=VARCHAR},
+      ad_text5 = #{ad_text5,jdbcType=VARCHAR},
+      ad_address = #{ad_address,jdbcType=LONGVARCHAR}
+    where ad_id = #{ad_id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Address">
+    update address
+    set ad_recorddate = #{ad_recorddate,jdbcType=TIMESTAMP},
+      companyId = #{companyId,jdbcType=INTEGER},
+      updaterId = #{updaterId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      ad_text1 = #{ad_text1,jdbcType=VARCHAR},
+      ad_text2 = #{ad_text2,jdbcType=VARCHAR},
+      ad_text3 = #{ad_text3,jdbcType=VARCHAR},
+      ad_text4 = #{ad_text4,jdbcType=VARCHAR},
+      ad_text5 = #{ad_text5,jdbcType=VARCHAR}
+    where ad_id = #{ad_id,jdbcType=INTEGER}
+  </update>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from address
+    where ad_id = #{ad_id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByIds" parameterType="java.lang.String">
+    delete from address
+    where ad_id in (#{ids,jdbcType=VARCHAR})
+  </delete>
+
+</mapper>

+ 1 - 108
applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml

@@ -98,20 +98,6 @@
         wh_recorder, wh_date, companyid, updaterId, updatetime, wh_text1, wh_text2, wh_text3,
         wh_text4, wh_text5
     </sql>
-    <select id="selectByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample" resultMap="BaseResultMap">
-        select
-        <if test="distinct">
-            distinct
-        </if>
-        <include refid="Base_Column_List" />
-        from warehouse
-        <if test="_parameter != null">
-            <include refid="Example_Where_Clause" />
-        </if>
-        <if test="orderByClause != null">
-            order by ${orderByClause}
-        </if>
-    </select>
     <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
         select
         <include refid="Base_Column_List" />
@@ -122,12 +108,7 @@
         delete from warehouse
         where wh_id = #{wh_id,jdbcType=INTEGER}
     </delete>
-    <delete id="deleteByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample">
-        delete from warehouse
-        <if test="_parameter != null">
-            <include refid="Example_Where_Clause" />
-        </if>
-    </delete>
+
     <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Warehouse">
         insert into warehouse (wh_id, wh_code, wh_type,
         wh_description, wh_statuscode, wh_status,
@@ -251,94 +232,6 @@
             </if>
         </trim>
     </insert>
-    <select id="countByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample" resultType="java.lang.Integer">
-        select count(*) from warehouse
-        <if test="_parameter != null">
-            <include refid="Example_Where_Clause" />
-        </if>
-    </select>
-    <update id="updateByExampleSelective" parameterType="map">
-        update warehouse
-        <set>
-            <if test="record.wh_id != null">
-                wh_id = #{record.wh_id,jdbcType=INTEGER},
-            </if>
-            <if test="record.wh_code != null">
-                wh_code = #{record.wh_code,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_type != null">
-                wh_type = #{record.wh_type,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_description != null">
-                wh_description = #{record.wh_description,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_statuscode != null">
-                wh_statuscode = #{record.wh_statuscode,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_status != null">
-                wh_status = #{record.wh_status,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_recorderid != null">
-                wh_recorderid = #{record.wh_recorderid,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_recorder != null">
-                wh_recorder = #{record.wh_recorder,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_date != null">
-                wh_date = #{record.wh_date,jdbcType=TIMESTAMP},
-            </if>
-            <if test="record.companyid != null">
-                companyid = #{record.companyid,jdbcType=INTEGER},
-            </if>
-            <if test="record.updaterId != null">
-                updaterId = #{record.updaterId,jdbcType=INTEGER},
-            </if>
-            <if test="record.updatetime != null">
-                updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
-            </if>
-            <if test="record.wh_text1 != null">
-                wh_text1 = #{record.wh_text1,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_text2 != null">
-                wh_text2 = #{record.wh_text2,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_text3 != null">
-                wh_text3 = #{record.wh_text3,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_text4 != null">
-                wh_text4 = #{record.wh_text4,jdbcType=VARCHAR},
-            </if>
-            <if test="record.wh_text5 != null">
-                wh_text5 = #{record.wh_text5,jdbcType=VARCHAR},
-            </if>
-        </set>
-        <if test="_parameter != null">
-            <include refid="Update_By_Example_Where_Clause" />
-        </if>
-    </update>
-    <update id="updateByExample" parameterType="map">
-        update warehouse
-        set wh_id = #{record.wh_id,jdbcType=INTEGER},
-        wh_code = #{record.wh_code,jdbcType=VARCHAR},
-        wh_type = #{record.wh_type,jdbcType=VARCHAR},
-        wh_description = #{record.wh_description,jdbcType=VARCHAR},
-        wh_statuscode = #{record.wh_statuscode,jdbcType=VARCHAR},
-        wh_status = #{record.wh_status,jdbcType=VARCHAR},
-        wh_recorderid = #{record.wh_recorderid,jdbcType=VARCHAR},
-        wh_recorder = #{record.wh_recorder,jdbcType=VARCHAR},
-        wh_date = #{record.wh_date,jdbcType=TIMESTAMP},
-        companyid = #{record.companyid,jdbcType=INTEGER},
-        updaterId = #{record.updaterId,jdbcType=INTEGER},
-        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
-        wh_text1 = #{record.wh_text1,jdbcType=VARCHAR},
-        wh_text2 = #{record.wh_text2,jdbcType=VARCHAR},
-        wh_text3 = #{record.wh_text3,jdbcType=VARCHAR},
-        wh_text4 = #{record.wh_text4,jdbcType=VARCHAR},
-        wh_text5 = #{record.wh_text5,jdbcType=VARCHAR}
-        <if test="_parameter != null">
-            <include refid="Update_By_Example_Where_Clause" />
-        </if>
-    </update>
     <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Warehouse">
         update warehouse
         <set>