郑永安
2023-06-19 f65443d8abeaedc9d102324565e8368e7c9d90c8
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?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.StaticStockMapper" >
  <resultMap id="BaseResultMap" type="com.gk.firework.Domain.StaticStock" >
    <!--          -->
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="owner" property="owner" jdbcType="BIGINT" />
    <result column="enterpriseName" property="enterpriseName" jdbcType="VARCHAR" />
    <result column="enterpriseNumber" property="enterpriseNumber" jdbcType="VARCHAR" />
    <result column="safetySuperVision" property="safetySuperVision" jdbcType="VARCHAR" />
    <result column="province" property="province" jdbcType="VARCHAR" />
    <result column="city" property="city" jdbcType="VARCHAR" />
    <result column="district" property="district" jdbcType="VARCHAR" />
    <result column="stockNum" property="stockNum" jdbcType="DECIMAL" />
    <result column="firecracker" property="firecracker" jdbcType="DECIMAL" />
    <result column="spray" property="spray" jdbcType="DECIMAL" />
    <result column="rotation" property="rotation" jdbcType="DECIMAL" />
    <result column="bead" property="bead" jdbcType="DECIMAL" />
    <result column="toy" property="toy" jdbcType="DECIMAL" />
    <result column="combined" property="combined" jdbcType="DECIMAL" />
    <result column="updatedby" property="updatedby" jdbcType="VARCHAR" />
    <result column="updateat" property="updateat" jdbcType="TIMESTAMP" />
    <result column="flag" property="flag" jdbcType="TINYINT" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--          -->
    id, owner, enterpriseName, enterpriseNumber, safetySuperVision, province, city, district,
    stockNum, firecracker, spray, rotation, bead, toy, combined, updatedby, updateat,
    flag
  </sql>
 
    <select id="selectEnterpriseStocks" resultType="com.gk.firework.Domain.StaticStock">
      select
      <include refid="Base_Column_List"/>
      from staticstock
        <where>
          1=1
          <if test="condition.name != null and condition.name != ''">
            and enterprisename like CONCAT('%',#{condition.name},'%')
          </if>
          <if test="condition.operator != null and condition.operator != ''">
            and (enterprisenumber =#{condition.operator}
            <if test="condition.subList != null and condition.subList.size() > 0">
              <foreach collection="condition.subList" item="item" index="index" >
                or  enterprisenumber = #{item}
              </foreach>
            </if>
            )
          </if>
          <if test="condition.type != null and condition.type != ''">
            and safetysupervision = #{condition.type}
          </if>
          <if test="condition.province != null and condition.province != ''">
            and province = #{condition.province}
          </if>
          <if test="condition.city != null and condition.city != ''">
            and city = #{condition.city}
          </if>
          <if test="condition.district != null and condition.district != ''">
            and district = #{condition.district}
          </if>
        </where>
    </select>
 
</mapper>