ProfileTpMapper.xml 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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.base.mapper.ProfileTpMapper">
  6. <resultMap type="com.zhongzheng.modules.base.domain.ProfileTp" id="ProfileTpResult">
  7. <result property="profileTpId" column="profile_tp_id"/>
  8. <result property="name" column="name"/>
  9. <result property="code" column="code"/>
  10. <result property="status" column="status"/>
  11. <result property="createTime" column="create_time"/>
  12. <result property="updateTime" column="update_time"/>
  13. <result property="keyValue" column="key_value"/>
  14. <result property="userIds" column="user_ids"/>
  15. <result property="keyValue2" column="key_value2"/>
  16. <result property="goodsIds" column="goods_ids"/>
  17. </resultMap>
  18. <resultMap type="com.zhongzheng.modules.base.vo.ProfileTpVo" id="ProfileTpVoResult">
  19. <result property="profileTpId" column="profile_tp_id"/>
  20. <result property="name" column="name"/>
  21. <result property="code" column="code"/>
  22. <result property="status" column="status"/>
  23. <result property="keyValue" column="key_value"/>
  24. <result property="userIds" column="user_ids"/>
  25. <result property="keyValue2" column="key_value2"/>
  26. <result property="goodsIds" column="goods_ids"/>
  27. <collection property="businessList" column="profile_tp_id" select="findBusinessList"/>
  28. <collection property="userList" column="user_ids" select="findUserList"/>
  29. </resultMap>
  30. <resultMap type="com.zhongzheng.modules.base.vo.ProfileTpBusinessVo" id="ProfileTpBusiness">
  31. <result property="id" column="id"/>
  32. <result property="educationTypeId" column="education_type_id"/>
  33. <result property="businessId" column="business_id"/>
  34. <result property="projectId" column="project_id"/>
  35. <result property="educationName" column="education_name"/>
  36. <result property="projectName" column="project_name"/>
  37. <result property="businessName" column="business_name"/>
  38. </resultMap>
  39. <resultMap type="com.zhongzheng.common.core.domain.entity.SysUser" id="ProfileTpSysUser">
  40. <result property="userId" column="user_id"/>
  41. <result property="nickName" column="nick_name"/>
  42. </resultMap>
  43. <select id="findUserList" resultMap="ProfileTpSysUser">
  44. SELECT
  45. u.nick_name,
  46. u.user_id
  47. FROM
  48. sys_user u
  49. WHERE
  50. FIND_IN_SET( u.user_id, #{user_ids})
  51. </select>
  52. <select id="findBusinessList" resultMap="ProfileTpBusiness">
  53. SELECT
  54. b.education_type_id,
  55. b.id,
  56. b.business_id,
  57. b.project_id,
  58. cet.education_name,
  59. cpt.project_name,
  60. cb.business_name
  61. FROM
  62. profile_tp_business b
  63. LEFT JOIN course_education_type cet ON b.education_type_id = cet.id
  64. LEFT JOIN course_project_type cpt ON b.project_id = cpt.id
  65. LEFT JOIN course_business cb ON b.business_id = cb.id
  66. WHERE
  67. b.profile_tp_id=#{profile_tp_id}
  68. </select>
  69. <select id="selectList" parameterType="com.zhongzheng.modules.base.bo.ProfileTpQueryBo" resultMap="ProfileTpVoResult">
  70. SELECT
  71. *
  72. FROM
  73. profile_tp p
  74. WHERE
  75. 1 =1
  76. <if test="status != null and status.size()!=0 ">
  77. AND p.status in
  78. <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
  79. #{item}
  80. </foreach>
  81. </if>
  82. <if test="goodsId != null">
  83. and FIND_IN_SET(#{goodsId},p.goods_ids)
  84. </if>
  85. order by p.create_time desc
  86. </select>
  87. </mapper>