|
|
|
|
@ -1,104 +1,77 @@
|
|
|
|
|
<?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">
|
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
<mapper namespace="org.dromara.wcs.mapper.BaseLocationInfoMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap id="BaseLocationInfoResult" type="org.dromara.wcs.domain.vo.BaseLocationInfoVo" autoMapping="true">
|
|
|
|
|
<id property="objId" column="obj_id"/>
|
|
|
|
|
<result property="locationCode" column="location_code"/>
|
|
|
|
|
<result property="locationName" column="location_name"/>
|
|
|
|
|
<result property="locationArea" column="location_area"/>
|
|
|
|
|
<result property="storeCode" column="store_code"/>
|
|
|
|
|
<result property="storeName" column="store_name"/>
|
|
|
|
|
<result property="locationRows" column="location_rows"/>
|
|
|
|
|
<result property="locationColumns" column="location_columns"/>
|
|
|
|
|
<result property="locationLayers" column="location_layers"/>
|
|
|
|
|
<result property="agvPosition" column="agv_position"/>
|
|
|
|
|
<result property="materialCode" column="material_code"/>
|
|
|
|
|
<result property="materialName" column="material_name"/>
|
|
|
|
|
<result property="palletBarcode" column="pallet_barcode"/>
|
|
|
|
|
<result property="stackCount" column="stack_count"/>
|
|
|
|
|
<result property="locationStatus" column="location_status"/>
|
|
|
|
|
<result property="isFlag" column="is_flag"/>
|
|
|
|
|
<result property="remark" column="remark"/>
|
|
|
|
|
<result property="createdTime" column="created_time"/>
|
|
|
|
|
<result property="createdBy" column="created_by"/>
|
|
|
|
|
<result property="updatedBy" column="updated_by"/>
|
|
|
|
|
<result property="createdByName" column="created_by_name"/>
|
|
|
|
|
<result property="updatedByName" column="updated_by_name"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectCustomBaseLocationInfoVoColumns">
|
|
|
|
|
select
|
|
|
|
|
t.obj_id,
|
|
|
|
|
t.location_code,
|
|
|
|
|
t.location_name,
|
|
|
|
|
t.location_area,
|
|
|
|
|
t.store_code,
|
|
|
|
|
t.location_rows,
|
|
|
|
|
t.location_columns,
|
|
|
|
|
t.location_layers,
|
|
|
|
|
t.agv_position,
|
|
|
|
|
t.material_code,
|
|
|
|
|
t.pallet_barcode,
|
|
|
|
|
t.stack_count,
|
|
|
|
|
t.location_status,
|
|
|
|
|
t.is_flag,
|
|
|
|
|
t.remark,
|
|
|
|
|
t.created_by,
|
|
|
|
|
t.created_time,
|
|
|
|
|
t.create_dept,
|
|
|
|
|
t.updated_by,
|
|
|
|
|
t.updated_time
|
|
|
|
|
<sql id="selectBaseLocationInfoVoColumns">
|
|
|
|
|
select t.obj_id, t.location_code, t.location_name, t.location_area, t.store_code,
|
|
|
|
|
s.store_name, t.location_rows, t.location_columns, t.location_layers,
|
|
|
|
|
t.agv_position, t.material_code, m.material_name,
|
|
|
|
|
t.pallet_barcode, t.stack_count, t.location_status, t.is_flag, t.remark,
|
|
|
|
|
t.created_by, t.created_time, t.create_dept, t.updated_by, t.updated_time,
|
|
|
|
|
cu.user_name as created_by_name, uu.user_name as updated_by_name
|
|
|
|
|
from base_location_info t
|
|
|
|
|
left join base_store_info s on t.store_code = s.store_code
|
|
|
|
|
left join base_material_info m on t.material_code = m.material_code
|
|
|
|
|
left join wcs_core_ruoyi.sys_user cu on t.created_by = cu.user_id
|
|
|
|
|
left join wcs_core_ruoyi.sys_user uu on t.updated_by = uu.user_id
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<sql id="customBaseLocationInfoSqlSegment">
|
|
|
|
|
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != ''">
|
|
|
|
|
<choose>
|
|
|
|
|
<!-- 有真实过滤条件时把sqlSegment包进where,方便后续扩展join后继续复用Wrapper。 -->
|
|
|
|
|
<when test="ew.nonEmptyOfWhere">
|
|
|
|
|
<where>
|
|
|
|
|
${ew.sqlSegment}
|
|
|
|
|
</where>
|
|
|
|
|
</when>
|
|
|
|
|
<!-- 只有排序/分组时不能强行包where,否则会生成非法SQL。 -->
|
|
|
|
|
<otherwise>
|
|
|
|
|
${ew.sqlSegment}
|
|
|
|
|
</otherwise>
|
|
|
|
|
</choose>
|
|
|
|
|
<select id="selectCustomBaseLocationInfoVoList" resultMap="BaseLocationInfoResult">
|
|
|
|
|
<include refid="selectBaseLocationInfoVoColumns"/>
|
|
|
|
|
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != '' and ew.nonEmptyOfWhere">
|
|
|
|
|
<!-- 公共业务条件统一来自buildQueryWrapper,避免XML再维护一套重复筛选条件。 -->
|
|
|
|
|
<where>
|
|
|
|
|
${ew.sqlSegment}
|
|
|
|
|
</where>
|
|
|
|
|
</if>
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<sql id="customBaseLocationInfoWhereSegment">
|
|
|
|
|
order by t.obj_id desc
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectCustomBaseLocationInfoVoPage" resultMap="BaseLocationInfoResult">
|
|
|
|
|
<include refid="selectBaseLocationInfoVoColumns"/>
|
|
|
|
|
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != '' and ew.nonEmptyOfWhere">
|
|
|
|
|
<where>
|
|
|
|
|
${ew.sqlSegment}
|
|
|
|
|
</where>
|
|
|
|
|
</if>
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectCustomBaseLocationInfoVoList" resultMap="BaseLocationInfoResult">
|
|
|
|
|
<include refid="selectCustomBaseLocationInfoVoColumns"/>
|
|
|
|
|
<include refid="customBaseLocationInfoSqlSegment"/>
|
|
|
|
|
order by t.obj_id desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectCustomBaseLocationInfoVoPage" resultMap="BaseLocationInfoResult">
|
|
|
|
|
<include refid="selectCustomBaseLocationInfoVoColumns"/>
|
|
|
|
|
<include refid="customBaseLocationInfoSqlSegment"/>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectCustomBaseLocationInfoVoById" resultMap="BaseLocationInfoResult">
|
|
|
|
|
<include refid="selectCustomBaseLocationInfoVoColumns"/>
|
|
|
|
|
<include refid="selectBaseLocationInfoVoColumns"/>
|
|
|
|
|
where t.obj_id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectCustomBaseLocationInfoVoByIds" resultMap="BaseLocationInfoResult">
|
|
|
|
|
<include refid="selectCustomBaseLocationInfoVoColumns"/>
|
|
|
|
|
<include refid="selectBaseLocationInfoVoColumns"/>
|
|
|
|
|
where t.obj_id in
|
|
|
|
|
<foreach collection="coll" item="id" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
<foreach collection="coll" item="id" open="(" separator="," close=")">#{id}</foreach>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="countCustomBaseLocationInfo" resultType="java.lang.Long">
|
|
|
|
|
select count(1)
|
|
|
|
|
from base_location_info t
|
|
|
|
|
<include refid="customBaseLocationInfoWhereSegment"/>
|
|
|
|
|
select count(1) from base_location_info t
|
|
|
|
|
<if test="ew != null and ew.sqlSegment != null and ew.sqlSegment != '' and ew.nonEmptyOfWhere">
|
|
|
|
|
<where>
|
|
|
|
|
${ew.sqlSegment}
|
|
|
|
|
</where>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|
|
|
|
|
|