TopCourseBusinessMapper.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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.zhongzheng.modules.top.goods.mapper.TopCourseBusinessMapper">
  6. <resultMap type="com.zhongzheng.modules.top.goods.vo.TopCourseBusinessVo" id="TopCourseBusinessVoResult">
  7. <result property="id" column="id"/>
  8. <result property="businessName" column="business_name"/>
  9. <result property="businessId" column="business_id"/>
  10. <result property="remark" column="remark"/>
  11. <result property="projectId" column="project_id"/>
  12. <result property="schoolYear" column="school_year"/>
  13. <result property="status" column="status"/>
  14. <result property="educationName" column="education_name"/>
  15. <result property="projectName" column="project_name"/>
  16. <result property="educationId" column="education_id"/>
  17. <result property="templateStatus" column="template_status"/>
  18. <result property="templateName" column="template_name"/>
  19. <result property="goodsLearningOrder" column="goods_learning_order"/>
  20. <result property="profileTpUserIds" column="profile_tp_user_ids"/>
  21. <result property="periodUserIds" column="period_user_ids"/>
  22. <result property="periodConfirmUserIds" column="period_confirm_user_ids"/>
  23. <result property="refundUserIds" column="refund_user_ids"/>
  24. <result property="refundConfirmUserIds" column="refund_confirm_user_ids"/>
  25. <result property="sort" column="sort"/>
  26. <result property="goodsFieldJson" column="goods_field_json"/>
  27. <result property="aliasName" column="alias_name"/>
  28. </resultMap>
  29. <select id="queryAllList" parameterType="com.zhongzheng.modules.course.bo.CourseBusinessQueryBo" resultMap="TopCourseBusinessVoResult">
  30. SELECT
  31. b.id as business_id,
  32. b.business_name,
  33. b.alias_name,
  34. e.education_name,
  35. e.id as education_id,
  36. p.project_name,
  37. p.id as project_id
  38. FROM
  39. top_course_business b
  40. LEFT JOIN top_course_project_type p on b.project_id =p.id
  41. LEFT JOIN top_course_education_type e ON p.education_id = e.id
  42. where 1=1
  43. and p.status = 1
  44. and b.status = 1
  45. <if test="businessName != null and businessName != ''">
  46. AND b.business_name = #{businessName}
  47. </if>
  48. <if test="encoder != null and encoder != ''">
  49. AND b.encoder = #{encoder}
  50. </if>
  51. <if test="projectId != null and projectId != ''">
  52. AND p.id = #{projectId}
  53. </if>
  54. <if test="educationId != null and educationId != ''">
  55. AND e.id = #{educationId}
  56. </if>
  57. <if test="id != null and id != ''">
  58. AND b.id = #{id}
  59. </if>
  60. order by b.sort
  61. </select>
  62. <select id="getBusinessFullName" parameterType="java.lang.Long" resultType="java.lang.String">
  63. SELECT
  64. CONCAT(cet.scheme_name,cet.education_name,IFNULL(cb.old_business_name, CONCAT(cb.business_name,cpt.project_name))) as `name`
  65. FROM top_course_business cb
  66. LEFT JOIN top_course_project_type cpt ON cb.project_id = cpt.id
  67. LEFT JOIN top_course_education_type cet ON cpt.education_id = cet.id
  68. WHERE cb.id = #{businessId}
  69. </select>
  70. <select id="queryList" parameterType="com.zhongzheng.modules.course.bo.CourseBusinessQueryBo" resultMap="TopCourseBusinessVoResult">
  71. SELECT
  72. b.*,
  73. e.education_name,
  74. e.id as education_id,
  75. p.project_name,
  76. t.name as template_name
  77. FROM
  78. top_course_business b
  79. LEFT JOIN top_course_project_type p on b.project_id =p.id
  80. LEFT JOIN top_course_education_type e ON p.education_id = e.id
  81. LEFT JOIN top_order_input_template t ON b.template_status = t.id
  82. where 1=1
  83. and p.status != -1
  84. and e.status != -1
  85. <if test="status != null and status.size()!=0 ">
  86. AND b.status in
  87. <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
  88. #{item}
  89. </foreach>
  90. </if>
  91. <if test="businessName != null and businessName != ''">
  92. AND b.business_name = #{businessName}
  93. </if>
  94. <if test="encoder != null and encoder != ''">
  95. AND b.encoder = #{encoder}
  96. </if>
  97. <if test="projectId != null and projectId != ''">
  98. AND p.id = #{projectId}
  99. </if>
  100. <if test="educationId != null and educationId != ''">
  101. AND e.id = #{educationId}
  102. </if>
  103. <if test="id != null and id != ''">
  104. AND b.id = #{id}
  105. </if>
  106. order by b.sort
  107. </select>
  108. </mapper>