|
|
|
@ -1,8 +1,8 @@
|
|
|
|
|
<?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.glxp.api.dao.auth.InvSpaceDao">
|
|
|
|
|
<resultMap id="BaseResultMap" autoMapping="true" type="com.glxp.api.entity.auth.InvSpace">
|
|
|
|
|
<!-- <id column="id" jdbcType="INTEGER" property="id"/>-->
|
|
|
|
|
<resultMap id="BaseResultMap" autoMapping="true" type="com.glxp.api.entity.auth.InvSpace">
|
|
|
|
|
<!-- <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"/>
|
|
|
|
@ -35,9 +35,9 @@
|
|
|
|
|
<insert id="insertEntity" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.auth.InvSpace"
|
|
|
|
|
useGeneratedKeys="true">
|
|
|
|
|
insert into auth_space (code, `name`, type, invStorageCode,
|
|
|
|
|
invWarehouseCode, `status`, createTime,
|
|
|
|
|
updateTime, `createUser`, updateUser,
|
|
|
|
|
remark)
|
|
|
|
|
invWarehouseCode, `status`, createTime,
|
|
|
|
|
updateTime, `createUser`, updateUser,
|
|
|
|
|
remark)
|
|
|
|
|
values (#{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
|
|
|
|
#{invStorageCode,jdbcType=VARCHAR},
|
|
|
|
|
#{invWarehouseCode,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
@ -243,9 +243,9 @@
|
|
|
|
|
|
|
|
|
|
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
|
|
|
|
|
insert into auth_space
|
|
|
|
|
(code, `name`, type, invStorageCode, invWarehouseCode, `status`, createTime, updateTime,
|
|
|
|
|
`createUser`, updateUser, remark)
|
|
|
|
|
values
|
|
|
|
|
(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.type,jdbcType=VARCHAR},
|
|
|
|
|
#{item.invStorageCode,jdbcType=VARCHAR},
|
|
|
|
@ -257,13 +257,14 @@
|
|
|
|
|
</foreach>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<select id="filterList" parameterType="com.glxp.api.req.auth.FilterInvSpaceRequest" resultType="com.glxp.api.res.auth.InvSpaceResponse">
|
|
|
|
|
<select id="filterList" parameterType="com.glxp.api.req.auth.FilterInvSpaceRequest"
|
|
|
|
|
resultType="com.glxp.api.res.auth.InvSpaceResponse">
|
|
|
|
|
select s.*,
|
|
|
|
|
w.name invStorageName,
|
|
|
|
|
iws.name invSubStorageName
|
|
|
|
|
from auth_space s
|
|
|
|
|
left join auth_dept w on s.invStorageCode = w.code
|
|
|
|
|
left join auth_warehouse iws on s.invWarehouseCode = iws.code
|
|
|
|
|
left join auth_dept w on s.invStorageCode = w.code
|
|
|
|
|
left join auth_warehouse iws on s.invWarehouseCode = iws.code
|
|
|
|
|
<where>
|
|
|
|
|
<if test="invStorageCode != null and invStorageCode != ''">
|
|
|
|
|
AND s.invStorageCode = #{invStorageCode}
|
|
|
|
@ -306,8 +307,8 @@
|
|
|
|
|
<select id="selectSpaceCodeList" resultType="com.glxp.api.res.auth.InvSpaceResponse">
|
|
|
|
|
select auth_space.code, auth_space.name, iws.name invSubStorageName, iw.name invStorageName
|
|
|
|
|
from auth_space
|
|
|
|
|
left join auth_warehouse iws on iws.code = auth_space.invWarehouseCode
|
|
|
|
|
left join auth_dept iw on iw.code = auth_space.invStorageCode
|
|
|
|
|
left join auth_warehouse iws on iws.code = auth_space.invWarehouseCode
|
|
|
|
|
left join auth_dept iw on iw.code = auth_space.invStorageCode
|
|
|
|
|
<where>
|
|
|
|
|
<if test="invStorageCode != null and invStorageCode != ''">
|
|
|
|
|
AND auth_space.invStorageCode = #{invStorageCode}
|
|
|
|
@ -373,7 +374,7 @@
|
|
|
|
|
|
|
|
|
|
<select id="selectExistByName" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
from auth_space
|
|
|
|
|
<where>
|
|
|
|
|
<if test="invStorageCode != null and invStorageCode != ''">
|
|
|
|
@ -389,7 +390,7 @@
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getMaxSpaceCode" resultType="java.lang.String">
|
|
|
|
|
select max(code) from auth_space
|
|
|
|
|
select max(CONVERT(code, signed))
|
|
|
|
|
<where>
|
|
|
|
|
<if test="invCode != null and invCode != ''">
|
|
|
|
|
and invWarehouseCode = #{invCode}
|
|
|
|
|