浏览代码

新增查询收款客户接口

zhoulc 2 年之前
父节点
当前提交
426109c028

+ 34 - 0
src/main/java/com/steerinfo/dil/controller/RmsReceivingCompanyController.java

@@ -0,0 +1,34 @@
+package com.steerinfo.dil.controller;
+
+import com.steerinfo.dil.service.RmsReceivingCompanyService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author xiaosh
+ */
+@RestController
+@RequestMapping("${api.version}/rmsReceivingCompany")
+public class RmsReceivingCompanyController {
+
+    @Resource(name = "rmsReceivingCompanyService1")
+    private RmsReceivingCompanyService rmsReceivingCompanyService;
+
+    @ApiOperation(value = "查询收款客户")
+    @PostMapping("/name")
+    public List<String> queryRmsReceivingCompanyName(){
+        return rmsReceivingCompanyService.queryRmsReceivingCompanyName();
+    }
+
+    @ApiOperation(value = "查询收款客户")
+    @PostMapping("/map")
+    public List<Map<String, Object>> queryRmsReceivingCompanyMap(){
+        return rmsReceivingCompanyService.queryRmsReceivingCompanyMap();
+    }
+    }

+ 21 - 0
src/main/java/com/steerinfo/dil/mapper/RmsReceivingCompanyMapper.java

@@ -0,0 +1,21 @@
+package com.steerinfo.dil.mapper;
+
+import com.steerinfo.dil.model.RmsReceivingCompany;
+import com.steerinfo.framework.mapper.IBaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+
+import java.math.BigDecimal;
+import java.util.List;
+
+/**
+ * @author xiaosh
+ */
+@Mapper
+public interface RmsReceivingCompanyMapper extends IBaseMapper<RmsReceivingCompany, BigDecimal> {
+    /**
+     * 查询所有收款客户
+     * @return 收款客户列表
+     */
+    List<RmsReceivingCompany> selectAll();
+}

+ 128 - 0
src/main/java/com/steerinfo/dil/model/RmsReceivingCompany.java

@@ -0,0 +1,128 @@
+package com.steerinfo.dil.model;
+
+import com.steerinfo.framework.model.IBasePO;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 收款客户 rms_receiving_company
+ * @author xiaosh
+ */
+public class RmsReceivingCompany implements IBasePO<BigDecimal> {
+    /**
+     * 收款客户ID
+     */
+    @ApiModelProperty(value = "收款客户ID")
+    private BigDecimal companyId;
+    /**
+     * 收款客户编码
+     */
+    @ApiModelProperty(value = "收款客户编码")
+    private String companyCode;
+    /**
+     * 收款客户名称
+     */
+    @ApiModelProperty(value = "收款客户名称")
+    private String companyName;
+    /**
+     * 记录创建人
+     */
+    @ApiModelProperty(value = "记录创建人")
+    private String insertUsername;
+    /**
+     * 记录创建时间
+     */
+    @ApiModelProperty(value = "记录创建时间")
+    private Date insertTime;
+    /**
+     * 记录修改人
+     */
+    @ApiModelProperty(value = "记录修改人")
+    private String updateUsername;
+    /**
+     * 记录修改时间
+     */
+    @ApiModelProperty(value = "记录修改时间")
+    private Date updateTime;
+    /**
+     * 记录创建或修改备注
+     */
+    @ApiModelProperty(value = "记录创建或修改备注")
+    private String insertUpdateRemark;
+
+    @Override
+    public BigDecimal getId() {
+        return this.companyId;
+    }
+
+    @Override
+    public void setId(BigDecimal companyId) {
+        this.companyId = companyId;
+    }
+
+    public BigDecimal getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(BigDecimal companyId) {
+        this.companyId = companyId;
+    }
+
+    public String getCompanyCode() {
+        return companyCode;
+    }
+
+    public void setCompanyCode(String companyCode) {
+        this.companyCode = companyCode;
+    }
+
+    public String getCompanyName() {
+        return companyName;
+    }
+
+    public void setCompanyName(String companyName) {
+        this.companyName = companyName;
+    }
+
+    public String getInsertUsername() {
+        return insertUsername;
+    }
+
+    public void setInsertUsername(String insertUsername) {
+        this.insertUsername = insertUsername;
+    }
+
+    public Date getInsertTime() {
+        return insertTime;
+    }
+
+    public void setInsertTime(Date insertTime) {
+        this.insertTime = insertTime;
+    }
+
+    public String getUpdateUsername() {
+        return updateUsername;
+    }
+
+    public void setUpdateUsername(String updateUsername) {
+        this.updateUsername = updateUsername;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getInsertUpdateRemark() {
+        return insertUpdateRemark;
+    }
+
+    public void setInsertUpdateRemark(String insertUpdateRemark) {
+        this.insertUpdateRemark = insertUpdateRemark;
+    }
+}

+ 21 - 0
src/main/java/com/steerinfo/dil/service/RmsReceivingCompanyService.java

@@ -0,0 +1,21 @@
+package com.steerinfo.dil.service;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author xiaosh
+ */
+public interface RmsReceivingCompanyService {
+    /**
+     * 查询收款客户
+     * @return 名称列表
+     */
+    List<String> queryRmsReceivingCompanyName();
+
+    /**
+     * 查询收款客户
+     * @return 编号名称列表
+     */
+    List<Map<String, Object>> queryRmsReceivingCompanyMap();
+}

+ 49 - 0
src/main/java/com/steerinfo/dil/service/impl/RmsReceivingCompanyServiceImpl.java

@@ -0,0 +1,49 @@
+package com.steerinfo.dil.service.impl;
+
+import com.steerinfo.dil.mapper.RmsReceivingCompanyMapper;
+import com.steerinfo.dil.model.RmsReceivingCompany;
+import com.steerinfo.dil.service.RmsReceivingCompanyService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author xiaosh
+ */
+@Service(value = "rmsReceivingCompanyService1")
+public class RmsReceivingCompanyServiceImpl implements RmsReceivingCompanyService {
+
+    @Autowired
+    private RmsReceivingCompanyMapper rmsReceivingCompanyMapper;
+
+    @Override
+    public List<String> queryRmsReceivingCompanyName() {
+        List<String> receivingCompany = new ArrayList<>();
+        List<RmsReceivingCompany> list = rmsReceivingCompanyMapper.selectAll();
+        if(null != list && !list.isEmpty()){
+            for (RmsReceivingCompany rmsReceivingCompany : list) {
+                receivingCompany.add(rmsReceivingCompany.getCompanyName());
+            }
+        }
+        return receivingCompany;
+    }
+
+    @Override
+    public List<Map<String, Object>> queryRmsReceivingCompanyMap() {
+        List<Map<String, Object>> receivingCompany = new ArrayList<>();
+        List<RmsReceivingCompany> list = rmsReceivingCompanyMapper.selectAll();
+        if(null != list && !list.isEmpty()){
+            for (RmsReceivingCompany rmsReceivingCompany : list) {
+                Map<String, Object> map = new HashMap<>(4);
+                map.put("values1", rmsReceivingCompany.getCompanyCode());
+                map.put("label1", rmsReceivingCompany.getCompanyName());
+                receivingCompany.add(map);
+            }
+        }
+        return receivingCompany;
+    }
+}

+ 235 - 0
src/main/resources/com/steerinfo/dil/mapper/RmsReceivingCompanyMapper.xml

@@ -0,0 +1,235 @@
+<?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.steerinfo.dil.mapper.RmsReceivingCompanyMapper">
+    <resultMap id="BaseResultMap" type="com.steerinfo.dil.model.RmsReceivingCompany">
+        <id column="COMPANY_ID" javaType="DECIMAL" property="companyId"/>
+        <result column="COMPANY_CODE" jdbcType="VARCHAR" property="companyCode" />
+        <result column="COMPANY_NAME" jdbcType="VARCHAR" property="companyName" />
+        <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
+        <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
+        <result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
+        <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
+        <result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark" />
+    </resultMap>
+    <sql id="columns">
+        t.COMPANY_ID, t.COMPANY_CODE, t.COMPANY_NAME, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME,
+            t.UPDATE_TIME, t.INSERT_UPDATE_REMARK
+    </sql>
+    <sql id="select">
+        SELECT <include refid="columns" /> FROM rms_receiving_company t
+    </sql>
+    <sql id="where">
+        <where>
+            <if test="companyId != null">
+                and t.COMPANY_ID = #{companyId}
+            </if>
+            <if test="companyCode != null and companyCode != ''">
+                and t.COMPANY_CODE = #{companyCode}
+            </if>
+            <if test="companyName != null and companyName != ''">
+                and t.COMPANY_NAME = #{companyName}
+            </if>
+            <if test="insertUsername != null and insertUsername != ''">
+                and t.INSERT_USERNAME = #{insertUsername}
+            </if>
+            <if test="insertTime != null">
+                and t.INSERT_TIME = #{insertTime}
+            </if>
+            <if test="updateUsername != null and updateUsername != ''">
+                and t.UPDATE_USERNAME = #{updateUsername}
+            </if>
+            <if test="updateTime != null">
+                and t.UPDATE_TIME = #{updateTime}
+            </if>
+            <if test="insertUpdateRemark != null and insertUpdateRemark != ''">
+                and t.INSERT_UPDATE_REMARK = #{insertUpdateRemark}
+            </if>
+        </where>
+    </sql>
+    <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+        delete from rms_receiving_company
+        where COMPANY_ID = #{companyId, jdbcType=DECIMAL}
+    </delete>
+    <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
+        delete from rms_receiving_company
+        where 1 != 1
+        <if test="companyId != null and companyId != ''">
+            or COMPANY_ID = #{companyId}
+        </if>
+        <if test="companyCode != null and companyCode != ''">
+            or COMPANY_CODE = #{companyCode}
+        </if>
+        <if test="companyName != null and companyName != ''">
+            or COMPANY_NAME = #{companyName}
+        </if>
+    </delete>
+    <insert id="insert" parameterType="com.steerinfo.dil.model.RmsReceivingCompany">
+        insert into rms_receiving_company
+            (
+                COMPANY_ID,
+                COMPANY_CODE,
+                COMPANY_NAME,
+                INSERT_USERNAME,
+                INSERT_TIME,
+                UPDATE_USERNAME,
+                UPDATE_TIME,
+                INSERT_UPDATE_REMARK
+             )
+        values
+            (
+                #{companyId, jdbcType=DECIMAL},
+                #{companyCode, jdbcType=VARCHAR},
+                #{companyName, jdbcType=VARCHAR},
+                #{insertUsername, jdbcType=VARCHAR},
+                #{insertTime, jdbcType=TIMESTAMP},
+                #{updateUsername, jdbcType=VARCHAR},
+                #{updateTime, jdbcType=TIMESTAMP},
+                #{insertUpdateRemark, jdbcType=VARCHAR}
+             )
+    </insert>
+    <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsReceivingCompany">
+        insert into rms_receiving_company
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="companyId != null">
+                COMPANY_ID,
+            </if>
+            <if test="companyCode != null">
+                COMPANY_CODE,
+            </if>
+            <if test="companyName != null">
+                COMPANY_NAME,
+            </if>
+            <if test="insertUsername != null">
+                INSERT_USERNAME,
+            </if>
+            <if test="insertTime != null">
+                INSERT_TIME,
+            </if>
+            <if test="updateUsername != null">
+                UPDATE_USERNAME,
+            </if>
+            <if test="updateTime != null">
+                UPDATE_TIME,
+            </if>
+            <if test="insertUpdateRemark != null">
+                INSERT_UPDATE_REMARK,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="companyId != null">
+                #{companyId, jdbcType=DECIMAL},
+            </if>
+            <if test="companyCode != null">
+                #{companyCode, jdbcType=VARCHAR},
+            </if>
+            <if test="companyName != null">
+                #{companyName, jdbcType=VARCHAR},
+            </if>
+            <if test="insertUsername != null">
+                #{insertUsername, jdbcType=VARCHAR},
+            </if>
+            <if test="insertTime != null">
+                #{insertTime, jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateUsername != null">
+                #{updateUsername, jdbcType=VARCHAR},
+            </if>
+            <if test="updateTime != null">
+                #{updateTime, jdbcType=TIMESTAMP},
+            </if>
+            <if test="insertUpdateRemark != null">
+                #{insertUpdateRemark, jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsReceivingCompany">
+        update rms_receiving_company set
+            COMPANY_CODE = #{companyCode, jdbcType=VARCHAR},
+            COMPANY_NAME = #{companyName, jdbcType=VARCHAR},
+            INSERT_USERNAME = #{insertUsername, jdbcType=VARCHAR},
+            INSERT_TIME = #{insertTime, jdbcType=TIMESTAMP},
+            UPDATE_USERNAME = #{updateUsername, jdbcType=VARCHAR},
+            UPDATE_TIME = #{updateTime, jdbcType=TIMESTAMP},
+            INSERT_UPDATE_REMARK = #{insertUpdateRemark, jdbcType=VARCHAR}
+        where
+            COMPANY_ID = #{companyId, jdbcType=DECIMAL}
+    </update>
+    <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsReceivingCompany">
+        update rms_receiving_company
+        <set>
+            <if test="companyCode != null">
+                COMPANY_CODE = #{companyCode, jdbcType=VARCHAR},
+            </if>
+            <if test="companyName != null">
+                COMPANY_NAME = #{companyName, jdbcType=VARCHAR},
+            </if>
+            <if test="insertUsername != null">
+                INSERT_USERNAME = #{insertUsername, jdbcType=VARCHAR},
+            </if>
+            <if test="insertTime != null">
+                INSERT_TIME = #{insertTime, jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateUsername != null">
+                UPDATE_USERNAME = #{updateUsername, jdbcType=VARCHAR},
+            </if>
+            <if test="updateTime != null">
+                UPDATE_TIME = #{updateTime, jdbcType=TIMESTAMP},
+            </if>
+            <if test="insertUpdateRemark != null">
+                INSERT_UPDATE_REMARK = #{insertUpdateRemark, jdbcType=VARCHAR},
+            </if>
+        </set>
+        where COMPANY_ID = #{companyId, jdbcType=DECIMAL}
+    </update>
+    <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+        <include refid="select" />
+        where COMPANY_ID = #{companyId, jdbcType=DECIMAL}
+    </select>
+    <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+        <include refid="select" />
+        <include refid="where" />
+    </select>
+    <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
+        <include refid="select" />
+        <include refid="where" />
+    </select>
+    <insert id="batchInsert" parameterType="java.util.List">
+        insert into rms_receiving_company
+        (
+            COMPANY_ID,
+            COMPANY_CODE,
+            COMPANY_NAME,
+            INSERT_USERNAME,
+            INSERT_TIME,
+            UPDATE_USERNAME,
+            UPDATE_TIME,
+            INSERT_UPDATE_REMARK
+        )
+        ( <foreach collection="list" item="item" separator="union all">
+        select
+            #{companyId, jdbcType=DECIMAL},
+            #{companyCode, jdbcType=VARCHAR},
+            #{companyName, jdbcType=VARCHAR},
+            #{insertUsername, jdbcType=VARCHAR},
+            #{insertTime, jdbcType=TIMESTAMP},
+            #{updateUsername, jdbcType=VARCHAR},
+            #{updateTime, jdbcType=TIMESTAMP},
+            #{insertUpdateRemark, jdbcType=VARCHAR}
+        from dual
+    </foreach> )
+    </insert>
+    <update id="batchUpdate" parameterType="java.util.List">
+
+    </update>
+    <delete id="batchDelete" parameterType="java.util.List">
+        delete from rms_receiving_company
+        where COMPANY_ID in
+        <foreach close=")" collection="list" item="id" open="(" separator=",">
+            #{id}
+        </foreach>
+    </delete>
+
+    <select id="selectAll" resultMap="BaseResultMap">
+        <include refid="select" />
+    </select>
+</mapper>