SysChannelAreaRelationMapper.xml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ydtech.modules.admin.dao.SysChannelAreaRelationMapper">
  6. <resultMap id="BaseResultMap" type="com.ydtech.modules.admin.model.po.SysChannelAreaRelation">
  7. <id property="id" column="id" jdbcType="BIGINT"/>
  8. <result property="gradeId" column="grade_id" jdbcType="BIGINT"/>
  9. <result property="areaId" column="area_id" jdbcType="BIGINT"/>
  10. </resultMap>
  11. <sql id="Base_Column_List">
  12. id,grade_id,area_id
  13. </sql>
  14. <select id="queryRelationList"
  15. parameterType="com.ydtech.modules.admin.model.vo.SysChannelVo"
  16. resultType="com.ydtech.modules.admin.model.po.SysChannelAreaRelation">
  17. select
  18. a.area_id as areaId,
  19. b.name
  20. from sys_channel_area_relation as a
  21. left join sys_dept as b on a.area_id = b.id
  22. <where>
  23. <if test="sysChannelVo.gradeId != null ">
  24. and a.grade_id = #{sysChannelVo.gradeId}
  25. </if>
  26. <if test="sysChannelVo.id != null and sysChannelVo.id != '' ">
  27. and a.area_id = #{sysChannelVo.id}
  28. </if>
  29. <if test="sysChannelVo.name != null and sysChannelVo.name != '' ">
  30. and b.name like CONCAT('%', #{sysChannelVo.name}, '%')
  31. </if>
  32. </where>
  33. </select>
  34. </mapper>