TenantGroupMapper.xml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3. <mapper namespace="com.yonge.cooleshow.biz.dal.mapper.TenantGroupMapper">
  4. <!-- 表字段 -->
  5. <sql id="baseColumns">
  6. t.id_ AS id
  7. , t.tenant_id_ AS tenantId
  8. , t.name_ AS name
  9. , t.admin_id_ AS adminId
  10. , t.im_group_id_ AS imGroupId
  11. , t.create_by_ AS createBy
  12. , t.create_time_ AS createTime
  13. </sql>
  14. <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.wrapper.TenantGroupWrapper$TenantGroup">
  15. SELECT DISTINCT
  16. <include refid="baseColumns" />
  17. FROM tenant_group t
  18. <if test="param.tenantAlbumId != null">
  19. LEFT JOIN tenant_group_album tga on t.id_ = tga.tenant_group_id_
  20. </if>
  21. <where>
  22. <if test="param.keyword != null and param.keyword.trim() !=''">
  23. AND t.name_ like concat('%',#{param.keyword},'%')
  24. </if>
  25. <if test="param.tenantId != null">
  26. AND t.tenant_id_ = #{param.tenantId}
  27. </if>
  28. <if test="param.adminId != null">
  29. AND t.admin_id_ = #{param.adminId}
  30. </if>
  31. <if test="param.tenantAlbumId != null">
  32. AND tga.tenant_album_id_ = #{param.tenantAlbumId} AND tga.del_flag_=0 AND tga.status_=1
  33. </if>
  34. </where>
  35. ORDER BY t.id_ DESC
  36. </select>
  37. </mapper>