增加负库存的开关

This commit is contained in:
季圣华
2020-06-18 22:31:04 +08:00
parent a0e61fa8eb
commit 84943631ba
9 changed files with 461 additions and 793 deletions

View File

@@ -1,354 +1,122 @@
package com.jsh.erp.datasource.entities;
public class SystemConfig {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.id
*
* @mbggenerated
*/
private Long id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.company_name
*
* @mbggenerated
*/
private String companyName;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.company_contacts
*
* @mbggenerated
*/
private String companyContacts;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.company_address
*
* @mbggenerated
*/
private String companyAddress;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.company_tel
*
* @mbggenerated
*/
private String companyTel;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.company_fax
*
* @mbggenerated
*/
private String companyFax;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.company_post_code
*
* @mbggenerated
*/
private String companyPostCode;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.depot_flag
*
* @mbggenerated
*/
private String depotFlag;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.customer_flag
*
* @mbggenerated
*/
private String customerFlag;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.tenant_id
*
* @mbggenerated
*/
private String minusStockFlag;
private Long tenantId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_systemconfig.delete_Flag
*
* @mbggenerated
*/
private String deleteFlag;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.id
*
* @return the value of jsh_systemconfig.id
*
* @mbggenerated
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.id
*
* @param id the value for jsh_systemconfig.id
*
* @mbggenerated
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.company_name
*
* @return the value of jsh_systemconfig.company_name
*
* @mbggenerated
*/
public String getCompanyName() {
return companyName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.company_name
*
* @param companyName the value for jsh_systemconfig.company_name
*
* @mbggenerated
*/
public void setCompanyName(String companyName) {
this.companyName = companyName == null ? null : companyName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.company_contacts
*
* @return the value of jsh_systemconfig.company_contacts
*
* @mbggenerated
*/
public String getCompanyContacts() {
return companyContacts;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.company_contacts
*
* @param companyContacts the value for jsh_systemconfig.company_contacts
*
* @mbggenerated
*/
public void setCompanyContacts(String companyContacts) {
this.companyContacts = companyContacts == null ? null : companyContacts.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.company_address
*
* @return the value of jsh_systemconfig.company_address
*
* @mbggenerated
*/
public String getCompanyAddress() {
return companyAddress;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.company_address
*
* @param companyAddress the value for jsh_systemconfig.company_address
*
* @mbggenerated
*/
public void setCompanyAddress(String companyAddress) {
this.companyAddress = companyAddress == null ? null : companyAddress.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.company_tel
*
* @return the value of jsh_systemconfig.company_tel
*
* @mbggenerated
*/
public String getCompanyTel() {
return companyTel;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.company_tel
*
* @param companyTel the value for jsh_systemconfig.company_tel
*
* @mbggenerated
*/
public void setCompanyTel(String companyTel) {
this.companyTel = companyTel == null ? null : companyTel.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.company_fax
*
* @return the value of jsh_systemconfig.company_fax
*
* @mbggenerated
*/
public String getCompanyFax() {
return companyFax;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.company_fax
*
* @param companyFax the value for jsh_systemconfig.company_fax
*
* @mbggenerated
*/
public void setCompanyFax(String companyFax) {
this.companyFax = companyFax == null ? null : companyFax.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.company_post_code
*
* @return the value of jsh_systemconfig.company_post_code
*
* @mbggenerated
*/
public String getCompanyPostCode() {
return companyPostCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.company_post_code
*
* @param companyPostCode the value for jsh_systemconfig.company_post_code
*
* @mbggenerated
*/
public void setCompanyPostCode(String companyPostCode) {
this.companyPostCode = companyPostCode == null ? null : companyPostCode.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.depot_flag
*
* @return the value of jsh_systemconfig.depot_flag
*
* @mbggenerated
*/
public String getDepotFlag() {
return depotFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.depot_flag
*
* @param depotFlag the value for jsh_systemconfig.depot_flag
*
* @mbggenerated
*/
public void setDepotFlag(String depotFlag) {
this.depotFlag = depotFlag == null ? null : depotFlag.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.customer_flag
*
* @return the value of jsh_systemconfig.customer_flag
*
* @mbggenerated
*/
public String getCustomerFlag() {
return customerFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.customer_flag
*
* @param customerFlag the value for jsh_systemconfig.customer_flag
*
* @mbggenerated
*/
public void setCustomerFlag(String customerFlag) {
this.customerFlag = customerFlag == null ? null : customerFlag.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.tenant_id
*
* @return the value of jsh_systemconfig.tenant_id
*
* @mbggenerated
*/
public String getMinusStockFlag() {
return minusStockFlag;
}
public void setMinusStockFlag(String minusStockFlag) {
this.minusStockFlag = minusStockFlag == null ? null : minusStockFlag.trim();
}
public Long getTenantId() {
return tenantId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.tenant_id
*
* @param tenantId the value for jsh_systemconfig.tenant_id
*
* @mbggenerated
*/
public void setTenantId(Long tenantId) {
this.tenantId = tenantId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_systemconfig.delete_Flag
*
* @return the value of jsh_systemconfig.delete_Flag
*
* @mbggenerated
*/
public String getDeleteFlag() {
return deleteFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_systemconfig.delete_Flag
*
* @param deleteFlag the value for jsh_systemconfig.delete_Flag
*
* @mbggenerated
*/
public void setDeleteFlag(String deleteFlag) {
this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim();
}

View File

@@ -4,118 +4,46 @@ import java.util.ArrayList;
import java.util.List;
public class SystemConfigExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public SystemConfigExample() {
oredCriteria = new ArrayList<Criteria>();
oredCriteria = new ArrayList<>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
@@ -124,41 +52,23 @@ public class SystemConfigExample {
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
criteria = new ArrayList<>();
}
public boolean isValid() {
@@ -814,6 +724,76 @@ public class SystemConfigExample {
return (Criteria) this;
}
public Criteria andMinusStockFlagIsNull() {
addCriterion("minus_stock_flag is null");
return (Criteria) this;
}
public Criteria andMinusStockFlagIsNotNull() {
addCriterion("minus_stock_flag is not null");
return (Criteria) this;
}
public Criteria andMinusStockFlagEqualTo(String value) {
addCriterion("minus_stock_flag =", value, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagNotEqualTo(String value) {
addCriterion("minus_stock_flag <>", value, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagGreaterThan(String value) {
addCriterion("minus_stock_flag >", value, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagGreaterThanOrEqualTo(String value) {
addCriterion("minus_stock_flag >=", value, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagLessThan(String value) {
addCriterion("minus_stock_flag <", value, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagLessThanOrEqualTo(String value) {
addCriterion("minus_stock_flag <=", value, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagLike(String value) {
addCriterion("minus_stock_flag like", value, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagNotLike(String value) {
addCriterion("minus_stock_flag not like", value, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagIn(List<String> values) {
addCriterion("minus_stock_flag in", values, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagNotIn(List<String> values) {
addCriterion("minus_stock_flag not in", values, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagBetween(String value1, String value2) {
addCriterion("minus_stock_flag between", value1, value2, "minusStockFlag");
return (Criteria) this;
}
public Criteria andMinusStockFlagNotBetween(String value1, String value2) {
addCriterion("minus_stock_flag not between", value1, value2, "minusStockFlag");
return (Criteria) this;
}
public Criteria andTenantIdIsNull() {
addCriterion("tenant_id is null");
return (Criteria) this;
@@ -945,25 +925,12 @@ public class SystemConfigExample {
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table jsh_systemconfig
*
* @mbggenerated do_not_delete_during_merge
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
public static class Criterion {
private String condition;

View File

@@ -6,91 +6,25 @@ import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SystemConfigMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int countByExample(SystemConfigExample example);
long countByExample(SystemConfigExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int deleteByExample(SystemConfigExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int insert(SystemConfig record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int insertSelective(SystemConfig record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
List<SystemConfig> selectByExample(SystemConfigExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
SystemConfig selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int updateByExampleSelective(@Param("record") SystemConfig record, @Param("example") SystemConfigExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int updateByExample(@Param("record") SystemConfig record, @Param("example") SystemConfigExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int updateByPrimaryKeySelective(SystemConfig record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_systemconfig
*
* @mbggenerated
*/
int updateByPrimaryKey(SystemConfig record);
}

View File

@@ -17,6 +17,7 @@ import com.jsh.erp.service.MaterialExtend.MaterialExtendService;
import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.material.MaterialService;
import com.jsh.erp.service.serialNumber.SerialNumberService;
import com.jsh.erp.service.systemConfig.SystemConfigService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.QueryUtils;
import com.jsh.erp.utils.StringUtil;
@@ -60,6 +61,8 @@ public class DepotItemService {
@Resource
private UserService userService;
@Resource
private SystemConfigService systemConfigService;
@Resource
private LogService logService;
public DepotItem getDepotItem(long id)throws Exception {
@@ -429,7 +432,7 @@ public class DepotItemService {
}
BigDecimal stock = getStockByParam(depotItem.getDepotid(),depotItem.getMaterialid(),null,null,tenantId);
BigDecimal thisBasicNumber = depotItem.getBasicnumber()==null?BigDecimal.ZERO:depotItem.getBasicnumber();
if(stock.compareTo(thisBasicNumber)<0){
if(systemConfigService.getMinusStockFlag() == false && stock.compareTo(thisBasicNumber)<0){
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE,
String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName()));
}
@@ -558,7 +561,7 @@ public class DepotItemService {
if(BusinessConstants.DEPOTHEAD_TYPE_OUT.equals(depotHead.getType())){
BigDecimal stock = getStockByParam(depotItem.getDepotid(),depotItem.getMaterialid(),null,null,tenantId);
BigDecimal thisBasicNumber = depotItem.getBasicnumber()==null?BigDecimal.ZERO:depotItem.getBasicnumber();
if(stock.compareTo(thisBasicNumber)<0){
if(systemConfigService.getMinusStockFlag() == false && stock.compareTo(thisBasicNumber)<0){
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_CODE,
String.format(ExceptionConstants.MATERIAL_STOCK_NOT_ENOUGH_MSG,material==null?"":material.getName()));
}

View File

@@ -199,4 +199,21 @@ public class SystemConfigService {
}
return customerFlag;
}
/**
* 获取负库存开关
* @return
* @throws Exception
*/
public boolean getMinusStockFlag() throws Exception {
boolean minusStockFlag = false;
List<SystemConfig> list = getSystemConfig();
if(list.size()>0) {
String flag = list.get(0).getMinusStockFlag();
if(("1").equals(flag)) {
minusStockFlag = true;
}
}
return minusStockFlag;
}
}

View File

@@ -1,366 +1,323 @@
<?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.jsh.erp.datasource.mappers.SystemConfigMapper">
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.SystemConfig">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="company_name" jdbcType="VARCHAR" property="companyName" />
<result column="company_contacts" jdbcType="VARCHAR" property="companyContacts" />
<result column="company_address" jdbcType="VARCHAR" property="companyAddress" />
<result column="company_tel" jdbcType="VARCHAR" property="companyTel" />
<result column="company_fax" jdbcType="VARCHAR" property="companyFax" />
<result column="company_post_code" jdbcType="VARCHAR" property="companyPostCode" />
<result column="depot_flag" jdbcType="VARCHAR" property="depotFlag" />
<result column="customer_flag" jdbcType="VARCHAR" property="customerFlag" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, company_name, company_contacts, company_address, company_tel, company_fax, company_post_code,
depot_flag, customer_flag, tenant_id, delete_Flag
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.SystemConfigExample" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from jsh_systemconfig
<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.Long" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from jsh_systemconfig
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from jsh_systemconfig
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.SystemConfigExample">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from jsh_systemconfig
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.SystemConfig">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_systemconfig (id, company_name, company_contacts,
company_address, company_tel, company_fax,
company_post_code, depot_flag, customer_flag,
tenant_id, delete_Flag)
values (#{id,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, #{companyContacts,jdbcType=VARCHAR},
#{companyAddress,jdbcType=VARCHAR}, #{companyTel,jdbcType=VARCHAR}, #{companyFax,jdbcType=VARCHAR},
#{companyPostCode,jdbcType=VARCHAR}, #{depotFlag,jdbcType=VARCHAR}, #{customerFlag,jdbcType=VARCHAR},
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.SystemConfig">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_systemconfig
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="companyName != null">
company_name,
</if>
<if test="companyContacts != null">
company_contacts,
</if>
<if test="companyAddress != null">
company_address,
</if>
<if test="companyTel != null">
company_tel,
</if>
<if test="companyFax != null">
company_fax,
</if>
<if test="companyPostCode != null">
company_post_code,
</if>
<if test="depotFlag != null">
depot_flag,
</if>
<if test="customerFlag != null">
customer_flag,
</if>
<if test="tenantId != null">
tenant_id,
</if>
<if test="deleteFlag != null">
delete_Flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="companyName != null">
#{companyName,jdbcType=VARCHAR},
</if>
<if test="companyContacts != null">
#{companyContacts,jdbcType=VARCHAR},
</if>
<if test="companyAddress != null">
#{companyAddress,jdbcType=VARCHAR},
</if>
<if test="companyTel != null">
#{companyTel,jdbcType=VARCHAR},
</if>
<if test="companyFax != null">
#{companyFax,jdbcType=VARCHAR},
</if>
<if test="companyPostCode != null">
#{companyPostCode,jdbcType=VARCHAR},
</if>
<if test="depotFlag != null">
#{depotFlag,jdbcType=VARCHAR},
</if>
<if test="customerFlag != null">
#{customerFlag,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
#{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.SystemConfigExample" resultType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from jsh_systemconfig
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_systemconfig
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.companyName != null">
company_name = #{record.companyName,jdbcType=VARCHAR},
</if>
<if test="record.companyContacts != null">
company_contacts = #{record.companyContacts,jdbcType=VARCHAR},
</if>
<if test="record.companyAddress != null">
company_address = #{record.companyAddress,jdbcType=VARCHAR},
</if>
<if test="record.companyTel != null">
company_tel = #{record.companyTel,jdbcType=VARCHAR},
</if>
<if test="record.companyFax != null">
company_fax = #{record.companyFax,jdbcType=VARCHAR},
</if>
<if test="record.companyPostCode != null">
company_post_code = #{record.companyPostCode,jdbcType=VARCHAR},
</if>
<if test="record.depotFlag != null">
depot_flag = #{record.depotFlag,jdbcType=VARCHAR},
</if>
<if test="record.customerFlag != null">
customer_flag = #{record.customerFlag,jdbcType=VARCHAR},
</if>
<if test="record.tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
<if test="record.deleteFlag != null">
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_systemconfig
set id = #{record.id,jdbcType=BIGINT},
company_name = #{record.companyName,jdbcType=VARCHAR},
company_contacts = #{record.companyContacts,jdbcType=VARCHAR},
company_address = #{record.companyAddress,jdbcType=VARCHAR},
company_tel = #{record.companyTel,jdbcType=VARCHAR},
company_fax = #{record.companyFax,jdbcType=VARCHAR},
company_post_code = #{record.companyPostCode,jdbcType=VARCHAR},
depot_flag = #{record.depotFlag,jdbcType=VARCHAR},
customer_flag = #{record.customerFlag,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.SystemConfig">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_systemconfig
<set>
<if test="companyName != null">
company_name = #{companyName,jdbcType=VARCHAR},
</if>
<if test="companyContacts != null">
company_contacts = #{companyContacts,jdbcType=VARCHAR},
</if>
<if test="companyAddress != null">
company_address = #{companyAddress,jdbcType=VARCHAR},
</if>
<if test="companyTel != null">
company_tel = #{companyTel,jdbcType=VARCHAR},
</if>
<if test="companyFax != null">
company_fax = #{companyFax,jdbcType=VARCHAR},
</if>
<if test="companyPostCode != null">
company_post_code = #{companyPostCode,jdbcType=VARCHAR},
</if>
<if test="depotFlag != null">
depot_flag = #{depotFlag,jdbcType=VARCHAR},
</if>
<if test="customerFlag != null">
customer_flag = #{customerFlag,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.SystemConfig">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_systemconfig
set company_name = #{companyName,jdbcType=VARCHAR},
company_contacts = #{companyContacts,jdbcType=VARCHAR},
company_address = #{companyAddress,jdbcType=VARCHAR},
company_tel = #{companyTel,jdbcType=VARCHAR},
company_fax = #{companyFax,jdbcType=VARCHAR},
company_post_code = #{companyPostCode,jdbcType=VARCHAR},
depot_flag = #{depotFlag,jdbcType=VARCHAR},
customer_flag = #{customerFlag,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<mapper namespace="com.jsh.erp.datasource.mappers.SystemConfigMapper">
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.SystemConfig">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="company_name" jdbcType="VARCHAR" property="companyName" />
<result column="company_contacts" jdbcType="VARCHAR" property="companyContacts" />
<result column="company_address" jdbcType="VARCHAR" property="companyAddress" />
<result column="company_tel" jdbcType="VARCHAR" property="companyTel" />
<result column="company_fax" jdbcType="VARCHAR" property="companyFax" />
<result column="company_post_code" jdbcType="VARCHAR" property="companyPostCode" />
<result column="depot_flag" jdbcType="VARCHAR" property="depotFlag" />
<result column="customer_flag" jdbcType="VARCHAR" property="customerFlag" />
<result column="minus_stock_flag" jdbcType="VARCHAR" property="minusStockFlag" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, company_name, company_contacts, company_address, company_tel, company_fax, company_post_code,
depot_flag, customer_flag, minus_stock_flag, tenant_id, delete_Flag
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.SystemConfigExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from jsh_systemconfig
<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.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from jsh_systemconfig
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from jsh_systemconfig
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.SystemConfigExample">
delete from jsh_systemconfig
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.SystemConfig">
insert into jsh_systemconfig (id, company_name, company_contacts,
company_address, company_tel, company_fax,
company_post_code, depot_flag, customer_flag,
minus_stock_flag, tenant_id, delete_Flag
)
values (#{id,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, #{companyContacts,jdbcType=VARCHAR},
#{companyAddress,jdbcType=VARCHAR}, #{companyTel,jdbcType=VARCHAR}, #{companyFax,jdbcType=VARCHAR},
#{companyPostCode,jdbcType=VARCHAR}, #{depotFlag,jdbcType=VARCHAR}, #{customerFlag,jdbcType=VARCHAR},
#{minusStockFlag,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.SystemConfig">
insert into jsh_systemconfig
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="companyName != null">
company_name,
</if>
<if test="companyContacts != null">
company_contacts,
</if>
<if test="companyAddress != null">
company_address,
</if>
<if test="companyTel != null">
company_tel,
</if>
<if test="companyFax != null">
company_fax,
</if>
<if test="companyPostCode != null">
company_post_code,
</if>
<if test="depotFlag != null">
depot_flag,
</if>
<if test="customerFlag != null">
customer_flag,
</if>
<if test="minusStockFlag != null">
minus_stock_flag,
</if>
<if test="tenantId != null">
tenant_id,
</if>
<if test="deleteFlag != null">
delete_Flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="companyName != null">
#{companyName,jdbcType=VARCHAR},
</if>
<if test="companyContacts != null">
#{companyContacts,jdbcType=VARCHAR},
</if>
<if test="companyAddress != null">
#{companyAddress,jdbcType=VARCHAR},
</if>
<if test="companyTel != null">
#{companyTel,jdbcType=VARCHAR},
</if>
<if test="companyFax != null">
#{companyFax,jdbcType=VARCHAR},
</if>
<if test="companyPostCode != null">
#{companyPostCode,jdbcType=VARCHAR},
</if>
<if test="depotFlag != null">
#{depotFlag,jdbcType=VARCHAR},
</if>
<if test="customerFlag != null">
#{customerFlag,jdbcType=VARCHAR},
</if>
<if test="minusStockFlag != null">
#{minusStockFlag,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
#{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.SystemConfigExample" resultType="java.lang.Long">
select count(*) from jsh_systemconfig
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update jsh_systemconfig
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.companyName != null">
company_name = #{record.companyName,jdbcType=VARCHAR},
</if>
<if test="record.companyContacts != null">
company_contacts = #{record.companyContacts,jdbcType=VARCHAR},
</if>
<if test="record.companyAddress != null">
company_address = #{record.companyAddress,jdbcType=VARCHAR},
</if>
<if test="record.companyTel != null">
company_tel = #{record.companyTel,jdbcType=VARCHAR},
</if>
<if test="record.companyFax != null">
company_fax = #{record.companyFax,jdbcType=VARCHAR},
</if>
<if test="record.companyPostCode != null">
company_post_code = #{record.companyPostCode,jdbcType=VARCHAR},
</if>
<if test="record.depotFlag != null">
depot_flag = #{record.depotFlag,jdbcType=VARCHAR},
</if>
<if test="record.customerFlag != null">
customer_flag = #{record.customerFlag,jdbcType=VARCHAR},
</if>
<if test="record.minusStockFlag != null">
minus_stock_flag = #{record.minusStockFlag,jdbcType=VARCHAR},
</if>
<if test="record.tenantId != null">
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
<if test="record.deleteFlag != null">
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update jsh_systemconfig
set id = #{record.id,jdbcType=BIGINT},
company_name = #{record.companyName,jdbcType=VARCHAR},
company_contacts = #{record.companyContacts,jdbcType=VARCHAR},
company_address = #{record.companyAddress,jdbcType=VARCHAR},
company_tel = #{record.companyTel,jdbcType=VARCHAR},
company_fax = #{record.companyFax,jdbcType=VARCHAR},
company_post_code = #{record.companyPostCode,jdbcType=VARCHAR},
depot_flag = #{record.depotFlag,jdbcType=VARCHAR},
customer_flag = #{record.customerFlag,jdbcType=VARCHAR},
minus_stock_flag = #{record.minusStockFlag,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.SystemConfig">
update jsh_systemconfig
<set>
<if test="companyName != null">
company_name = #{companyName,jdbcType=VARCHAR},
</if>
<if test="companyContacts != null">
company_contacts = #{companyContacts,jdbcType=VARCHAR},
</if>
<if test="companyAddress != null">
company_address = #{companyAddress,jdbcType=VARCHAR},
</if>
<if test="companyTel != null">
company_tel = #{companyTel,jdbcType=VARCHAR},
</if>
<if test="companyFax != null">
company_fax = #{companyFax,jdbcType=VARCHAR},
</if>
<if test="companyPostCode != null">
company_post_code = #{companyPostCode,jdbcType=VARCHAR},
</if>
<if test="depotFlag != null">
depot_flag = #{depotFlag,jdbcType=VARCHAR},
</if>
<if test="customerFlag != null">
customer_flag = #{customerFlag,jdbcType=VARCHAR},
</if>
<if test="minusStockFlag != null">
minus_stock_flag = #{minusStockFlag,jdbcType=VARCHAR},
</if>
<if test="tenantId != null">
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.SystemConfig">
update jsh_systemconfig
set company_name = #{companyName,jdbcType=VARCHAR},
company_contacts = #{companyContacts,jdbcType=VARCHAR},
company_address = #{companyAddress,jdbcType=VARCHAR},
company_tel = #{companyTel,jdbcType=VARCHAR},
company_fax = #{companyFax,jdbcType=VARCHAR},
company_post_code = #{companyPostCode,jdbcType=VARCHAR},
depot_flag = #{depotFlag,jdbcType=VARCHAR},
customer_flag = #{customerFlag,jdbcType=VARCHAR},
minus_stock_flag = #{minusStockFlag,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>