1.货位表添加分类字段

feature-order-fix
x_z 3 years ago
parent a90dd9f217
commit 28d3ff41e8

@ -24,8 +24,6 @@ public interface InvSpaceDao {
int updateBatch(List<InvSpace> list);
int updateBatchSelective(List<InvSpace> list);
int batchInsert(@Param("list") List<InvSpace> list);
/**

@ -5,60 +5,65 @@ import lombok.Data;
import java.util.Date;
/**
*
*/
*
*/
@Data
public class InvSpace {
private Integer id;
/**
*
*/
*
*/
private String code;
/**
*
*/
*
*/
private String name;
/**
*
*/
*
*/
private String type;
/**
*
*/
private String invStorageCode;
/**
*
*/
*
*/
private String invWarehouseCode;
/**
*
*/
*
*/
private Integer status;
/**
*
*/
*
*/
private Date createTime;
/**
*
*/
*
*/
private Date updateTime;
/**
*
*/
*
*/
private String createUser;
/**
*
*/
*
*/
private String updateUser;
/**
*
*/
*
*/
private String remark;
}

@ -5,6 +5,7 @@
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="code" jdbcType="VARCHAR" property="code"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="type" jdbcType="VARCHAR" property="type"/>
<result column="invStorageCode" jdbcType="VARCHAR" property="invStorageCode"/>
<result column="invWarehouseCode" jdbcType="VARCHAR" property="invWarehouseCode"/>
<result column="status" jdbcType="INTEGER" property="status"/>
@ -19,6 +20,7 @@
id,
code,
`name`,
type,
invStorageCode,
invWarehouseCode,
`status`,
@ -44,11 +46,12 @@
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.admin.entity.business.InvSpace"
useGeneratedKeys="true">
insert into inv_space (code, `name`, invStorageCode,
insert into inv_space (code, `name`, type, invStorageCode,
invWarehouseCode, `status`, createTime,
updateTime, `createUser`, updateUser,
remark)
values (#{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{invStorageCode,jdbcType=VARCHAR},
values (#{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{invStorageCode,jdbcType=VARCHAR},
#{invWarehouseCode,jdbcType=VARCHAR}, #{status,jdbcType=BOOLEAN}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{createUser,jdbcType=VARCHAR}, #{updateUser,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR})
@ -64,6 +67,9 @@
<if test="name != null">
`name`,
</if>
<if test="type != null">
type,
</if>
<if test="invStorageCode != null">
invStorageCode,
</if>
@ -96,6 +102,9 @@
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="invStorageCode != null">
#{invStorageCode,jdbcType=VARCHAR},
</if>
@ -132,6 +141,9 @@
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
</if>
<if test="invStorageCode != null">
invStorageCode = #{invStorageCode,jdbcType=VARCHAR},
</if>
@ -164,6 +176,7 @@
update inv_space
set code = #{code,jdbcType=VARCHAR},
`name` = #{name,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
invStorageCode = #{invStorageCode,jdbcType=VARCHAR},
invWarehouseCode = #{invWarehouseCode,jdbcType=VARCHAR},
`status` = #{status,jdbcType=BOOLEAN},
@ -188,6 +201,11 @@
when id = #{item.id,jdbcType=INTEGER} then #{item.name,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.type,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="invStorageCode = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.invStorageCode,jdbcType=VARCHAR}
@ -235,93 +253,14 @@
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
update inv_space
<trim prefix="set" suffixOverrides=",">
<trim prefix="code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.code != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.code,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="`name` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.name != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.name,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="invStorageCode = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.invStorageCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.invStorageCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="invWarehouseCode = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.invWarehouseCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.invWarehouseCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.status != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=BOOLEAN}
</if>
</foreach>
</trim>
<trim prefix="createTime = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="updateTime = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="`createUser` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createUser != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createUser,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="updateUser = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateUser != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateUser,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="remark = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.remark != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.remark,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
insert into inv_space
(code, `name`, invStorageCode, invWarehouseCode, `status`, createTime, updateTime,
(code, `name`, type, invStorageCode, invWarehouseCode, `status`, createTime, updateTime,
`createUser`, updateUser, remark)
values
<foreach collection="list" item="item" separator=",">
(#{item.code,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.invStorageCode,jdbcType=VARCHAR},
(#{item.code,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR},
#{item.invStorageCode,jdbcType=VARCHAR},
#{item.invWarehouseCode,jdbcType=VARCHAR}, #{item.status,jdbcType=BOOLEAN},
#{item.createTime,jdbcType=TIMESTAMP},
#{item.updateTime,jdbcType=TIMESTAMP}, #{item.createUser,jdbcType=VARCHAR},
@ -345,7 +284,8 @@
AND s.invWarehouseCode = #{invWarehouseCode}
</if>
<if test="key != null and key != ''">
AND (s.code like concat('%', #{key}, '%') or s.name like concat('%', #{key}, '%'))
AND (s.code like concat('%', #{key}, '%') or s.name like concat('%', #{key}, '%') or
s.type like concat('%', #{key}, '%'))
</if>
</where>
</select>
@ -363,6 +303,9 @@
<if test="name != null and name != ''">
AND name = #{name}
</if>
<if test="type != null and type != ''">
AND type = #{type}
</if>
<if test="code != null and code != ''">
AND code = #{code}
</if>
@ -381,5 +324,4 @@
</if>
</where>
</select>
</mapper>

@ -27,8 +27,6 @@ CREATE TABLE `inv_count_order` (
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '盘点单据表' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
# 盘点单据详情表
DROP TABLE IF EXISTS `inv_count_order_detail`;
CREATE TABLE `inv_count_order_detail` (
@ -40,12 +38,14 @@ CREATE TABLE `inv_count_order_detail` (
`expireDate` datetime(0) NULL DEFAULT NULL COMMENT '失效日期',
`serialNo` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '序列号',
`countNum` int(0) NULL DEFAULT NULL COMMENT '盘点数量',
`bookNum` int(0) NULL DEFAULT NULL COMMENT '账面数量',
`invNum` int(0) NULL DEFAULT NULL COMMENT '账面数量',
`profitNum` int(0) NULL DEFAULT NULL COMMENT '盘盈数量',
`lossNum` int(0) NULL DEFAULT NULL COMMENT '盘亏数量',
`status` tinyint(1) NULL DEFAULT NULL COMMENT '盈亏状态 0亏损 1盈利',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '盘点单详情' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '盘点单详情' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
# 货位字典表
DROP TABLE IF EXISTS `inv_space`;
@ -53,6 +53,7 @@ CREATE TABLE `inv_space` (
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '货位码',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '货位名称',
`type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '货位分类',
`invStorageCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所属仓库',
`invWarehouseCode` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '所属分库',
`status` tinyint(1) NULL DEFAULT NULL COMMENT '状态',
@ -62,6 +63,7 @@ CREATE TABLE `inv_space` (
`updateUser` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '更新人',
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '货位字典表' ROW_FORMAT = Dynamic;
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '货位字典表' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;

Loading…
Cancel
Save