郑永安
2023-09-19 69185134fcfaf913ea45f1255677225a2cc311a4
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?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.hotwork.Mapper.CompanyInfoMapper" >
  <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.CompanyInfo" >
    <!--          -->
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="code" property="code" jdbcType="VARCHAR" />
    <result column="company" property="company" jdbcType="VARCHAR" />
    <result column="contactname" property="contactname" jdbcType="VARCHAR" />
    <result column="contactphone" property="contactphone" jdbcType="VARCHAR" />
    <result column="ismain" property="ismain" jdbcType="TINYINT" />
    <result column="province" property="province" jdbcType="VARCHAR" />
    <result column="city" property="city" jdbcType="VARCHAR" />
    <result column="area" property="area" jdbcType="VARCHAR" />
    <result column="town" property="town" jdbcType="VARCHAR" />
    <result column="community" property="community" jdbcType="VARCHAR" />
    <result column="isdel" property="isdel" jdbcType="TINYINT" />
    <result column="createdby" property="createdby" jdbcType="VARCHAR" />
    <result column="createddate" property="createddate" jdbcType="TIMESTAMP" />
    <result column="lastmodifiedby" property="lastmodifiedby" jdbcType="VARCHAR" />
    <result column="lastmodifieddate" property="lastmodifieddate" jdbcType="TIMESTAMP" />
    <result column="longitude" property="longitude" jdbcType="VARCHAR" />
    <result column="latitude" property="latitude" jdbcType="VARCHAR" />
    <result column="isbanned" property="isbanned" jdbcType="TINYINT" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--          -->
    id,code,company, contactname, contactphone, ismain, province, city, area, town, community, isdel,
    createdby,createddate, lastmodifiedby, lastmodifieddate, longitude, latitude, isbanned
  </sql>
  <select id="selectDataGrid" resultType="com.gk.hotwork.Domain.CompanyInfo">
    select *
    from company
    <where>
      1=1
      and isdel = 0
      <if test="condition.company != null and condition.company !=''">
        and company like concat('%',#{condition.company},'%')
      </if>
      <if test="condition.province != null and condition.province !=''">
        and province like concat('%',#{condition.province},'%')
      </if>
      <if test="condition.city != null and condition.city !=''">
        and city like concat('%',#{condition.city},'%')
      </if>
      <if test="condition.area != null and condition.area !=''">
        and area like concat('%',#{condition.area},'%')
      </if>
      <if test="condition.town != null and condition.town !=''">
        and town like concat('%',#{condition.town},'%')
      </if>
      <if test="condition.community != null and condition.community !=''">
        and community like concat('%',#{condition.community},'%')
      </if>
      <if test="condition.isMain != null ">
        and ismain = #{condition.isMain}
      </if>
    </where>
  </select>
  <select id="selectExistByName" resultType="com.gk.hotwork.Domain.CompanyInfo">
    select *
    from company
    <where>
      isdel = 0
      and company = #{company}
      <if test="id != null">
      and id != #{id}
      </if>
    </where>
  </select>
  <select id="selectByAll" resultType="com.gk.hotwork.Domain.CompanyInfo">
    select *
    from company
    where isdel = 0
    and isbanned = 0
  </select>
  <select id="selectExistMain" resultType="com.gk.hotwork.Domain.CompanyInfo">
    select *
    from company
    where isdel = 0
      and ismain = 1
    <if test="id != null">
      and id != #{id}
    </if>
    limit 1
  </select>
</mapper>