feiyu02
2024-11-21 9de446b0b83610055437fbc5172d216bb374900f
src/main/resources/mapper/ds1/ScenseMapper.xml
@@ -42,7 +42,50 @@
    S_Contacts, S_CreateDate, S_UpdateDate, S_Extension1, S_Extension2, S_Index, S_Remark
  </sql>
  <!-- 行政区划条件 -->
  <sql id="Where_Area">
    <if test="provincecode != null">
      AND ${tableAlias}.S_ProvinceCode = #{provincecode}
    </if>
    <if test="provincename != null">
      AND ${tableAlias}.S_ProvinceName = #{provincename}
    </if>
    <if test="citycode != null">
      AND ${tableAlias}.S_CityCode = #{citycode}
    </if>
    <if test="cityname != null">
      AND ${tableAlias}.S_CityName = #{cityname}
    </if>
    <if test="districtcode != null">
      AND ${tableAlias}.S_DistrictCode = #{districtcode}
    </if>
    <if test="districtname != null">
      AND ${tableAlias}.S_DistrictName = #{districtname}
    </if>
    <if test="towncode != null">
      AND ${tableAlias}.S_TownCode = #{towncode}
    </if>
    <if test="townname != null">
      AND ${tableAlias}.S_TownName = #{townname}
    </if>
  </sql>
  <select id="selectNoAccountScene" resultMap="BaseResultMap">
    select a.* FROM sm_t_scense as a LEFT JOIN sm_t_userinfo as b on a.S_GUID = b.D_GUID WHERE b.UI_GUID is null
  </select>
  <select id="getSceneByType" resultMap="BaseResultMap">
    select
    b.*
    from sm_t_monitorobjectversion as a
    left join sm_t_scense as b
    on a.S_GUID = b.S_GUID
    where a.T_ID = #{param1}
    <if test="param2 != null">
      and b.S_TypeID = #{param2}
    </if>
    <if test="param3 != null">
      and b.S_TownCode = #{param3}
    </if>
  </select>
</mapper>