后台服务
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

103 righe
3.9 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.WxQuestionOneselfTopicMapper">
  4. <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxQuestionOneselfTopic">
  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="question_id" jdbcType="BIGINT" property="questionId"/>
  9. <result column="title" jdbcType="VARCHAR" property="title"/>
  10. <result column="answer" jdbcType="VARCHAR" property="answer"/>
  11. <result column="type" jdbcType="TINYINT" property="type"/>
  12. <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
  13. <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
  14. <result column="sort" jdbcType="INTEGER" property="sort"/>
  15. </resultMap>
  16. <sql id="allColumns">
  17. `id`,`tenant_id`,`parent_tenant_id`, `question_id`, `title`, `answer`, `type`,
  18. `create_date`,`update_date`,`sort`
  19. </sql>
  20. <sql id="dynamicWhereConditions">
  21. where `del_status` = 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 != questionId ">
  32. and `question_id` = #{questionId}
  33. </if>
  34. <if test=" null != title ">
  35. and `title` like concat('%', #{title},'%')
  36. </if>
  37. <if test=" null != type ">
  38. and `type` = #{type}
  39. </if>
  40. <if test=" null != startDate ">
  41. and `create_date` &gt;= #{startDate}
  42. </if>
  43. <if test=" null != endDate ">
  44. and `create_date` &lt;= #{endDate}
  45. </if>
  46. <if test=" null != ids ">
  47. and id in
  48. <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
  49. #{idItem}
  50. </foreach>
  51. </if>
  52. <if test=" null != sortColumns">order by ${sortColumns}</if>
  53. <if test=" null == sortColumns">order by `sort`</if>
  54. </sql>
  55. <select id="findList" parameterType="com.iformall.domain.po.WxQuestionOneselfTopic" resultMap="BaseResultMap">
  56. select
  57. <include refid="allColumns"/>
  58. from wx_question_oneself_topic
  59. <include refid="dynamicWhereConditions"/>
  60. </select>
  61. <delete id="deleteQuestionId" parameterType="com.iformall.domain.po.WxQuestionOneselfTopic">
  62. delete from wx_question_oneself_topic
  63. where question_id = #{questionId}
  64. <if test=" null != tenantId and '' != tenantId">
  65. and `tenant_id` = #{tenantId}
  66. </if>
  67. <if test=" null != parentTenantId and '' != parentTenantId">
  68. and `parent_tenant_id` = #{parentTenantId}
  69. </if>
  70. </delete>
  71. <insert id="insertList" parameterType="java.util.List">
  72. insert into wx_question_oneself_topic
  73. (`id`,`tenant_id`,`parent_tenant_id`, `question_id`, `title`, `answer`, `type`, `create_date`,`update_date`,`sort`)
  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.questionId,jdbcType=BIGINT},
  80. #{item.title,jdbcType=VARCHAR},
  81. #{item.answer,jdbcType=VARCHAR},
  82. #{item.type,jdbcType=TINYINT},
  83. #{item.createDate,jdbcType=TIMESTAMP},
  84. #{item.updateDate,jdbcType=TIMESTAMP},
  85. #{item.sort,jdbcType=INTEGER})
  86. </foreach>
  87. </insert>
  88. </mapper>