Files
nanguangszwlback/mhd-modules/mhd-system/src/main/resources/mapper/basic/warehouse/WarehouseMapper.xml
T

151 lines
7.4 KiB
XML

<?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.mhd.basic.domain.warehouse.repository.mapper.WarehouseMapper">
<resultMap type="com.mhd.basic.domain.warehouse.repository.po.WarehousePO" id="WarehouseResult">
<result property="warehouseId" column="warehouse_id" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="warehouseCode" column="warehouse_code" />
<result property="warehouseName" column="warehouse_name" />
<result property="warehouseType" column="warehouse_type" />
<result property="warehouseTypeName" column="warehouse_type_name" />
<result property="warehouseStructure" column="warehouse_structure" />
<result property="warehouseNature" column="warehouse_nature" />
<result property="warmLayerCode" column="warm_layer_code" />
<result property="warmLayerName" column="warm_layer_name" />
<result property="directorName" column="director_name" />
<result property="directorPhone" column="director_phone" />
<result property="regionCode" column="region_code" />
<result property="regionName" column="region_name" />
<result property="detailAddress" column="detail_address" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="buildingRegion" column="building_region" />
<result property="usageRegion" column="usage_region" />
<result property="remark" column="remark" />
<result property="openingUp" column="opening_up" />
<result property="nullify" column="nullify" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="createByName" column="create_by_name" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="updateByName" column="update_by_name" />
<result property="delFlag" column="del_flag" />
<result property="isEnable" column="IS_ENABLE" />
</resultMap>
<sql id="selectWarehousePo">
select warehouse_id, organization_id, organization_name, top_organization_id, warehouse_code, warehouse_name, warehouse_type, warehouse_type_name, warehouse_structure, warehouse_nature, warm_layer_code, warm_layer_name, director_name, director_phone, region_code, region_name, detail_address, longitude, latitude, building_region, usage_region, remark, opening_up, nullify, create_time, create_by, create_by_name, update_time, update_by, update_by_name, del_flag, IS_ENABLE from warehouse
</sql>
<sql id="selectWarehousePo1">
<where>
<if test="warehouseId != null ">
and warehouse_id = #{warehouseId}
</if>
<if test="organizationId != null ">
and organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="topOrganizationId != null ">
and top_organization_id = #{topOrganizationId}
</if>
<if test="warehouseCode != null and warehouseCode != ''">
and warehouse_code like concat('%', #{warehouseCode}, '%')
</if>
<if test="warehouseName != null and warehouseName != ''">
and warehouse_name like concat('%', #{warehouseName}, '%')
</if>
<if test="warehouseType != null and warehouseType != ''">
and warehouse_type = #{warehouseType}
</if>
<if test="warehouseTypeName != null and warehouseTypeName != ''">
and warehouse_type_name like concat('%', #{warehouseTypeName}, '%')
</if>
<if test="warehouseStructure != null ">
and warehouse_structure = #{warehouseStructure}
</if>
<if test="warehouseNature != null ">
and warehouse_nature = #{warehouseNature}
</if>
<if test="warmLayerCode != null and warmLayerCode != ''">
and warm_layer_code = #{warmLayerCode}
</if>
<if test="warmLayerName != null and warmLayerName != ''">
and warm_layer_name like concat('%', #{warmLayerName}, '%')
</if>
<if test="directorName != null and directorName != ''">
and director_name like concat('%', #{directorName}, '%')
</if>
<if test="directorPhone != null and directorPhone != ''">
and director_phone = #{directorPhone}
</if>
<if test="regionCode != null and regionCode != ''">
and region_code = #{regionCode}
</if>
<if test="regionName != null and regionName != ''">
and region_name like concat('%', #{regionName}, '%')
</if>
<if test="detailAddress != null and detailAddress != ''">
and detail_address = #{detailAddress}
</if>
<if test="longitude != null and longitude != ''">
and longitude = #{longitude}
</if>
<if test="latitude != null and latitude != ''">
and latitude = #{latitude}
</if>
<if test="buildingRegion != null ">
and building_region = #{buildingRegion}
</if>
<if test="usageRegion != null ">
and usage_region = #{usageRegion}
</if>
<if test="openingUp != null ">
and opening_up = #{openingUp}
</if>
<if test="nullify != null ">
and nullify = #{nullify}
</if>
<if test="createByName != null and createByName != ''">
and create_by_name like concat('%', #{createByName}, '%')
</if>
<if test="updateByName != null and updateByName != ''">
and update_by_name like concat('%', #{updateByName}, '%')
</if>
<if test="remark != null and remark != ''">
and remark like concat('%',#{remark},'%')
</if>
<if test="warehouseIds != null and warehouseIds.size > 0 ">
and warehouse_id in
<foreach collection="warehouseIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="orgIdList != null and orgIdList.size > 0 ">
and organization_id in
<foreach collection="orgIdList" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<choose>
<when test="delFlag != null"> and del_flag = #{delFlag} </when>
<otherwise> and del_flag = 1 </otherwise>
</choose>
</where>
</sql>
<select id="queryList" parameterType="com.mhd.basic.domain.warehouse.repository.todo.WarehouseDO" resultMap="WarehouseResult">
<include refid="selectWarehousePo"/>
<include refid="selectWarehousePo1"/>
order by create_time desc
</select>
</mapper>