123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <?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.chinaitop.depot.intelligent.basicdata.mapper.WareHouseBasicInfoMapper" >
- <select id="getStorehouseInfo" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT
- t.*
- FROM
- (
- SELECT
- t2.storehouse_type,
- t2.storehouse_code,
- t2.storehouse_name,
- t2.design_capacity,
- t2.house_doot_position,
- t2.storehouse_state,
- t2.dutyStoreman,
- t1.lkmc,
- t1.pz,
- t1.hwxz,
- t1.dj,
- t1.kcsl,
- t5.EnumItemName rq,
- t1.rq AS rcrq,
- t1.cjsj AS cjsj,
- t1.UnitID
- FROM
- `lsreport_ts`.data_kcgl_kcsw_default AS t1
- LEFT JOIN basic_storehouse t2 ON t1.UnitID = t2.org_id
- AND t1.ch = t2.storehouse_id
- LEFT JOIN (
- SELECT
- t4.EnumItemId,
- t4.EnumItemName,
- MAX(t4.EnumItemName) scnf,
- t3.UnitID,
- t3.ch,
- t3.scnf scnfEnumId
- FROM
- `lsreport_ts`.data_kcgl_fcbgz_default t3
- INNER JOIN `lsreport_ts`.enumitem t4 ON t3.scnf = t4.EnumItemId
- AND t3.srsl > 0
- AND t3.UnitID = #{org_id}
- GROUP BY
- t3.ch
- ) t5 ON t2.org_id = t5.UnitID
- AND t2.storehouse_id = t5.ch
- <where>
- t2.del_flag = 1
- <if test="org_id != null">
- AND t2.org_id = #{org_id}
- </if>
- <if test="library_type != null">
- AND t2.library_type = #{library_type}
- </if>
- <if test="cfCdoe != null">
- AND t2.storehouse_code = #{cfCdoe}
- </if>
- </where>
- ) t
- GROUP BY
- t.storehouse_code
- </select>
- <select id="getColumn1Max" parameterType="java.util.Map" resultType="java.util.Map">
- SELECT
- <trim suffixOverrides="," >
- <if test="column1 != null" >
- MAX(${column1}) column1,
- </if>
- <if test="column2 != null" >
- MAX(${column2}) column2,
- </if>
- <if test="column3 != null" >
- MAX(${column3}) column3,
- </if>
- </trim>
- FROM ${tableName}
- where ${column1} >= 10000
- </select>
- <select id="getEnum" parameterType="java.lang.String" resultType="java.lang.String">
- SELECT
- enumName
- FROM
- basic_enum
- WHERE
- enumId = ${code} AND delFlag = 1
- </select>
- <select id="getKeeperName" parameterType="java.util.Map" resultType="java.lang.String">
- SELECT
- GROUP_CONCAT(bk.name) keeperName
- FROM
- basic_keeper_house kh,
- basic_keeper bk,
- basic_storehouse bs
- WHERE
- kh.org_id = bk.org_id
- AND bk.id = kh.keeper_Id
- AND kh.house_Id = bs.storehouse_id
- AND bk.org_id = bs.org_id
- AND bs.storehouse_code = ${storehouse_code}
- AND bs.org_id = ${UnitID}
- AND bs.del_flag = 1
- </select>
- </mapper>
|