后台服务
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

WxQuestionOneselfLogMapper.xml 4.0 KiB

2 лет назад
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. </sql>
  51. <select id="findList" parameterType="com.iformall.domain.po.WxQuestionOneselfLog" resultMap="BaseResultMap">
  52. select
  53. <include refid="allColumns"/>
  54. from wx_question_oneself_log
  55. <include refid="dynamicWhereConditions"/>
  56. </select>
  57. <select id="findDetailsList" parameterType="com.iformall.domain.po.WxQuestionOneselfLog" resultType="com.iformall.domain.po.WxQuestionOneselfLog">
  58. select wqol.*,wqot.answer as answers,wqot.type,wqot.sort
  59. from wx_question_oneself_log wqol
  60. left join wx_question_oneself_topic wqot on wqot.id = wqol.topic_id
  61. where wqol.wqou_id = #{wqouId}
  62. <if test=" null != tenantId and '' != tenantId">
  63. and wqol.`tenant_id` = #{tenantId}
  64. </if>
  65. <if test=" null != parentTenantId and '' != parentTenantId">
  66. and wqol.`parent_tenant_id` = #{parentTenantId}
  67. </if>
  68. order by wqot.sort
  69. </select>
  70. <insert id="insertList" parameterType="java.util.List">
  71. insert into wx_question_oneself_log
  72. (`id`,`tenant_id`,`parent_tenant_id`, `wqou_id`, `topic_id`, `topic_title`, `answer`, `answer_str`,`create_date`,`update_date`)
  73. values
  74. <foreach collection="list" item="item" index="index" separator=",">
  75. (#{item.id,jdbcType=BIGINT},
  76. #{item.tenantId,jdbcType=VARCHAR},
  77. #{item.parentTenantId,jdbcType=VARCHAR},
  78. #{item.wqouId,jdbcType=BIGINT},
  79. #{item.topicId,jdbcType=BIGINT},
  80. #{item.topicTitle,jdbcType=VARCHAR},
  81. #{item.answer,jdbcType=VARCHAR},
  82. #{item.answerStr,jdbcType=VARCHAR},
  83. #{item.createDate,jdbcType=TIMESTAMP},
  84. #{item.updateDate,jdbcType=TIMESTAMP})
  85. </foreach>
  86. </insert>
  87. </mapper>