OrderBusinessConfigMapper.xml 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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.order.mapper.OrderBusinessConfigMapper">
  6. <resultMap type="com.zhongzheng.modules.order.domain.OrderBusinessConfig" id="OrderBusinessConfigResult">
  7. <result property="id" column="id"/>
  8. <result property="businessId" column="business_id"/>
  9. <result property="configName" column="config_name"/>
  10. <result property="createTime" column="create_time"/>
  11. <result property="updateTime" column="update_time"/>
  12. <result property="status" column="status"/>
  13. <result property="gradeType" column="grade_type"/>
  14. </resultMap>
  15. <resultMap type="com.zhongzheng.modules.order.vo.OrderBusinessConfigVo" id="OrderBusinessConfigVoResult">
  16. <result property="id" column="id"/>
  17. <result property="businessId" column="business_id"/>
  18. <result property="configName" column="config_name"/>
  19. <result property="aliasName" column="alias_name"/>
  20. <result property="businessName" column="business_name"/>
  21. <result property="educationName" column="education_name"/>
  22. <result property="projectName" column="project_name"/>
  23. <result property="gradeType" column="grade_type"/>
  24. </resultMap>
  25. <select id="getList" parameterType="com.zhongzheng.modules.order.bo.OrderBusinessConfigQueryBo" resultMap="OrderBusinessConfigVoResult">
  26. SELECT
  27. obc.*,
  28. cb.alias_name,
  29. cb.business_name,
  30. cpt.project_name,
  31. cet.education_name
  32. FROM
  33. order_business_config obc
  34. LEFT JOIN course_business cb ON obc.business_id = cb.id
  35. LEFT JOIN course_project_type cpt ON cb.project_id = cpt.id
  36. LEFT JOIN course_education_type cet ON cet.id = cpt.education_id
  37. WHERE
  38. obc.`status` = 1
  39. <if test="gradeType != null and gradeType != ''">
  40. and obc.grade_type = #{gradeType}
  41. </if>
  42. <if test="businessId != null and businessId != ''">
  43. and obc.business_id = #{businessId}
  44. </if>
  45. <if test="projectId != null and projectId != ''">
  46. and cpt.id = #{projectId}
  47. </if>
  48. <if test="educationId != null and educationId != ''">
  49. and cet.id = #{educationId}
  50. </if>
  51. <if test="businessName != null and businessName != ''">
  52. and cb.business_name = #{businessName}
  53. </if>
  54. <if test="projectName != null and projectName != ''">
  55. and cpt.project_name = #{projectName}
  56. </if>
  57. <if test="educationName != null and educationName != ''">
  58. and cet.education_name = #{educationName}
  59. </if>
  60. <if test="subjectId != null and subjectId != ''">
  61. and (SELECT COUNT(obcg.id) FROM order_business_config_goods obcg where obcg.subject_id = #{subjectId} AND obcg.config_id = obc.id AND obcg.`status` = 1) > 0
  62. </if>
  63. </select>
  64. <select id="getDetail" parameterType="com.zhongzheng.modules.order.bo.OrderBusinessConfigQueryBo" resultMap="OrderBusinessConfigVoResult">
  65. SELECT
  66. obc.*,
  67. cb.alias_name,
  68. cb.business_name,
  69. cpt.project_name,
  70. cet.education_name
  71. FROM
  72. order_business_config obc
  73. LEFT JOIN course_business cb ON obc.business_id = cb.id
  74. LEFT JOIN course_project_type cpt ON cb.project_id = cpt.id
  75. LEFT JOIN course_education_type cet ON cet.id = cpt.education_id
  76. WHERE
  77. obc.id = #{id}
  78. </select>
  79. </mapper>