Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 

100 wiersze
4.1 KiB

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.iformall.mapper.WxQuestionOneselfLogMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxQuestionOneselfLog">
  5. <id column="id" jdbcType="BIGINT" property="id"/>
  6. <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/>
  7. <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" />
  8. <result column="wqou_id" jdbcType="BIGINT" property="wqouId"/>
  9. <result column="topic_id" jdbcType="BIGINT" property="topicId"/>
  10. <result column="topic_title" jdbcType="VARCHAR" property="topicTitle"/>
  11. <result column="answer" jdbcType="VARCHAR" property="answer"/>
  12. <result column="answer_str" jdbcType="VARCHAR" property="answerStr"/>
  13. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  14. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  15. </resultMap>
  16. <sql id="allColumns">
  17. `id`,`tenant_id`,`parent_tenant_id`, `wqou_id`, `topic_id`, `topic_title`, `answer`, `answer_str`,
  18. `create_date`,`update_date`
  19. </sql>
  20. <sql id="dynamicWhereConditions">
  21. where 1 = 1
  22. <if test=" null != id ">
  23. and `id` = #{id}
  24. </if>
  25. <if test=" null != tenantId and '' != tenantId">
  26. and `tenant_id` = #{tenantId}
  27. </if>
  28. <if test=" null != parentTenantId and '' != parentTenantId">
  29. and `parent_tenant_id` = #{parentTenantId}
  30. </if>
  31. <if test=" null != wqouId ">
  32. and `wqou_id` = #{wqouId}
  33. </if>
  34. <if test=" null != topicId ">
  35. and `topic_id` = #{topicId}
  36. </if>
  37. <if test=" null != startDate ">
  38. and `create_date` &gt;= #{startDate}
  39. </if>
  40. <if test=" null != endDate ">
  41. and `create_date` &lt;= #{endDate}
  42. </if>
  43. <if test=" null != ids ">
  44. and id in
  45. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  46. #{idItem}
  47. </foreach>
  48. </if>
  49. <if test=" null != sortColumns">order by ${sortColumns}</if>
  50. <if test=" null == sortColumns">order by </if>
  51. </sql>
  52. <select id="findList" parameterType="com.iformall.domain.po.WxQuestionOneselfLog" resultMap="BaseResultMap">
  53. select
  54. <include refid="allColumns"/>
  55. from wx_question_oneself_log
  56. <include refid="dynamicWhereConditions"/>
  57. </select>
  58. <select id="findDetailsList" parameterType="com.iformall.domain.po.WxQuestionOneselfLog" resultMap="com.iformall.domain.po.WxQuestionOneselfLog">
  59. select wqol.*,wqot.answer as answers,wqot.type,wqot.sort
  60. from wx_question_oneself_log wqol
  61. left join wx_question_oneself_topic wqot on wqot.id = wqol.topic_id
  62. where wqol.wqou_id = #{wqouId}
  63. <if test=" null != tenantId and '' != tenantId">
  64. and `tenant_id` = #{tenantId}
  65. </if>
  66. <if test=" null != parentTenantId and '' != parentTenantId">
  67. and `parent_tenant_id` = #{parentTenantId}
  68. </if>
  69. order by wqot.sort
  70. </select>
  71. <insert id="insertList" parameterType="java.util.List">
  72. insert into wx_question_oneself_log
  73. (`id`,`tenant_id`,`parent_tenant_id`, `wqou_id`, `topic_id`, `topic_title`, `answer`, `answer_str`,`create_date`,`update_date`)
  74. values
  75. <foreach collection="list" item="item" index="index" separator=",">
  76. (#{item.id,jdbcType=BIGINT},
  77. #{item.tenantId,jdbcType=VARCHAR},
  78. #{item.parentTenantId,jdbcType=VARCHAR},
  79. #{item.wqouId,jdbcType=BIGINT},
  80. #{item.topicId,jdbcType=BIGINT},
  81. #{item.topicTitle,jdbcType=VARCHAR},
  82. #{item.answer,jdbcType=VARCHAR},
  83. #{item.answerStr,jdbcType=VARCHAR},
  84. #{item.createDate,jdbcType=TIMESTAMP},
  85. #{item.updateDate,jdbcType=TIMESTAMP})
  86. </foreach>
  87. </insert>
  88. </mapper>