zhangfeng
2023-07-26 dd59c95e87ba585c4e3e2f059e218853784402e5
src/main/java/com/gk/hotwork/Mapper/mybatis/CompanyInfoMapper.xml
@@ -28,6 +28,7 @@
    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
@@ -60,6 +61,46 @@
      </if>
    </where>
  </select>
-->
  <select id="selectDataGrid" resultType="com.gk.hotwork.Domain.CompanyInfo">
    select c.*
    from
    (select *
    from company
    <where>
      1=1
      and isdel = 0
      <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.area != null and condition.area !=''">
        and area = #{condition.area}
      </if>
    </where>
    union
    select *
    from company
    <where>1=1
      and
      isdel = 0
      and province is null
      or province = ''
    </where>) c
    <where>
        1=1
      <if test="condition.company != null and condition.company !=''">
        and c.company like concat('%',#{condition.company},'%')
      </if>
      <if test="condition.companyid != null ">
        and c.id = #{condition.companyid}
      </if>
    </where>
  </select>
  <select id="selectExistByName" resultType="com.gk.hotwork.Domain.CompanyInfo">
    select *
    from company