SysChannelGroupInfoMapper.xml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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.SysChannelGroupInfoMapper">
  6. <resultMap id="BaseResultMap" type="com.ydtech.modules.admin.model.po.SysChannelGroupInfo">
  7. <id property="id" column="id" jdbcType="BIGINT"/>
  8. <result property="channelId" column="channel_id" jdbcType="BIGINT"/>
  9. <result property="gradeId" column="grade_id" jdbcType="BIGINT"/>
  10. <result property="gradeName" column="grade_name" jdbcType="VARCHAR"/>
  11. <result property="jqCostsProportion" column="jq_costs_proportion" jdbcType="VARCHAR"/>
  12. <result property="syCostsProportion" column="sy_costs_proportion" jdbcType="VARCHAR"/>
  13. <result property="noCostsProportion" column="no_costs_proportion" jdbcType="VARCHAR"/>
  14. <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
  15. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  16. <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
  17. <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
  18. </resultMap>
  19. <sql id="Base_Column_List">
  20. a.id,a.channel_id,a.grade_id,a.grade_name,a.jq_costs_proportion,
  21. a.sy_costs_proportion,a.no_costs_proportion,a.create_by,
  22. a.create_time,a.update_by,a.update_time
  23. </sql>
  24. <select id="queryProportion" resultMap="BaseResultMap">
  25. SELECT
  26. <include refid="Base_Column_List"/>
  27. FROM
  28. sys_channel_group_info a
  29. WHERE
  30. a.channel_id = (
  31. SELECT b.channel_id
  32. FROM sys_channel_cost_relation b
  33. WHERE b.cost_id = #{productId}
  34. )
  35. AND
  36. a.grade_id = (
  37. SELECT c.grade_id
  38. FROM sys_channel_area_relation c
  39. WHERE c.area_id = #{deptId}
  40. )
  41. </select>
  42. </mapper>