Administrator
2023-06-19 49588f5a462ae7425e7eb030438a35fd80c246fa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?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.gk.firework.Mapper.EnterpriseWarehouseMapper">
  <resultMap id="BaseResultMap" type="com.gk.firework.Domain.EnterpriseWarehouse">
    <!--          -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="bulidingnumber" jdbcType="INTEGER" property="bulidingnumber" />
    <result column="dangerlevel" jdbcType="VARCHAR" property="dangerlevel" />
    <result column="area" jdbcType="INTEGER" property="area" />
    <result column="limits" jdbcType="INTEGER" property="limits" />
    <result column="safetyperson" jdbcType="VARCHAR" property="safetyperson" />
    <result column="enterpriseid" jdbcType="BIGINT" property="enterpriseid" />
    <result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
    <result column="createby" jdbcType="BIGINT" property="createby" />
    <result column="createbyname" jdbcType="VARCHAR" property="createbyname" />
    <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" />
    <result column="updateby" jdbcType="BIGINT" property="updateby" />
    <result column="holdinventory" jdbcType="INTEGER" property="holdinventory" />
    <result column="updatebyname" jdbcType="VARCHAR" property="updatebyname" />
    <result column="validflag" jdbcType="BIT" property="validflag" />
      <collection property="enterpriseResources"
                  javaType="java.util.List"
                  ofType="com.gk.firework.Domain.EnterpriseResource"
                  column="{ewid=id,tabletype=tabletype}"
                  select="selectInner">
      </collection>
  </resultMap>
    <select id="selectPages" resultMap="BaseResultMap">
         select ew.*,
         #{params.tabletype} tabletype
        from enterprisewarehouse ew
        where ew.validflag = 1
        and ew.enterpriseid = #{params.id}
        order by ew.createtime desc
    </select>
 
  <select id="selectInner" parameterType = "java.util.Map" resultType="com.gk.firework.Domain.EnterpriseResource">
      select  er.id id, er.url,er.filename,er.tabletype
      from enterpriseresource er
      where  er.validflag = 1
      and er.tabletype= #{tabletype}
      and belongid = #{ewid}
    </select>
 
</mapper>