PartyStudyRulesMapper.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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.inspur.mapper.PartyStudyRulesMapper">
  6. <resultMap type="com.inspur.domain.partystudy.PartyStudyRules" id="PartyStudyRulesResult">
  7. <result property="id" column="id" />
  8. <result property="title" column="title" />
  9. <result property="content" column="content" />
  10. <result property="describe" column="describe" />
  11. <result property="url" column="url" />
  12. <result property="thumb" column="thumb" />
  13. <result property="picsPath" column="pics_path" />
  14. <result property="audioPic" column="audio_pic" />
  15. <result property="fileName" column="file_name" />
  16. <result property="filePath" column="file_path" />
  17. <result property="audioPath" column="audio_path" />
  18. <result property="insertTime" column="insert_time" />
  19. <result property="delStatus" column="del_status" />
  20. <result property="isPush" column="is_push" />
  21. <result property="newsType" column="news_type" />
  22. <result property="newsContent" column="news_content" />
  23. <result property="joinid" column="joinid" />
  24. <result property="newsid" column="newsid" />
  25. <result property="sort" column="sort" />
  26. <result property="orgid" column="orgid" />
  27. <result property="userTableId" column="user_table_id" />
  28. </resultMap>
  29. <sql id="selectPartyStudyRulesVo">
  30. select id, title, content, `describe`, url, thumb, pics_path, audio_pic, audio_path, file_path,file_name,insert_time, del_status, is_push, news_type, news_content, joinid, newsid, sort, orgid, user_table_id from party_study_rules
  31. </sql>
  32. <select id="selectPartyStudyRulesList" parameterType="PartyStudyRules" resultMap="PartyStudyRulesResult">
  33. <include refid="selectPartyStudyRulesVo"/>
  34. <where>
  35. <if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
  36. <if test="content != null and content != ''"> and content = #{content}</if>
  37. <if test="describe != null and describe != ''"> and `describe` = #{describe}</if>
  38. <if test="url != null and url != ''"> and url = #{url}</if>
  39. <if test="thumb != null and thumb != ''"> and thumb = #{thumb}</if>
  40. <if test="picsPath != null and picsPath != ''"> and pics_path = #{picsPath}</if>
  41. <if test="audioPic != null and audioPic != ''"> and audio_pic = #{audioPic}</if>
  42. <if test="audioPath != null and audioPath != ''"> and audio_path = #{audioPath}</if>
  43. <if test="insertTime != null "> and insert_time = #{insertTime}</if>
  44. <if test="delStatus != null and delStatus != ''"> and del_status = #{delStatus}</if>
  45. <if test="isPush != null and isPush != ''"> and is_push = #{isPush}</if>
  46. <if test="newsType != null and newsType != ''"> and news_type = #{newsType}</if>
  47. <if test="newsContent != null and newsContent != ''"> and news_content = #{newsContent}</if>
  48. <if test="joinid != null "> and joinid = #{joinid}</if>
  49. <if test="newsid != null "> and newsid = #{newsid}</if>
  50. <if test="sort != null and sort != ''"> and sort = #{sort}</if>
  51. <if test="orgid != null "> and orgid = #{orgid}</if>
  52. <if test="userTableId != null "> and user_table_id = #{userTableId}</if>
  53. </where>
  54. </select>
  55. <select id="selectPartyStudyRulesById" parameterType="Long" resultMap="PartyStudyRulesResult">
  56. <include refid="selectPartyStudyRulesVo"/>
  57. where id = #{id}
  58. </select>
  59. <insert id="insertPartyStudyRules" parameterType="PartyStudyRules">
  60. insert into party_study_rules
  61. <trim prefix="(" suffix=")" suffixOverrides=",">
  62. <if test="id != null">id,</if>
  63. <if test="title != null">title,</if>
  64. <if test="content != null">content,</if>
  65. <if test="describe != null">`describe`,</if>
  66. <if test="url != null">url,</if>
  67. <if test="thumb != null">thumb,</if>
  68. <if test="picsPath != null">pics_path,</if>
  69. <if test="audioPic != null">audio_pic,</if>
  70. <if test="audioPath != null">audio_path,</if>
  71. <if test="insertTime != null">insert_time,</if>
  72. <if test="delStatus != null">del_status,</if>
  73. <if test="isPush != null">is_push,</if>
  74. <if test="newsType != null">news_type,</if>
  75. <if test="newsContent != null">news_content,</if>
  76. <if test="joinid != null">joinid,</if>
  77. <if test="newsid != null">newsid,</if>
  78. <if test="sort != null">sort,</if>
  79. <if test="orgid != null">orgid,</if>
  80. <if test="userTableId != null">user_table_id,</if>
  81. </trim>
  82. <trim prefix="values (" suffix=")" suffixOverrides=",">
  83. <if test="id != null">#{id},</if>
  84. <if test="title != null">#{title},</if>
  85. <if test="content != null">#{content},</if>
  86. <if test="describe != null">#{describe},</if>
  87. <if test="url != null">#{url},</if>
  88. <if test="thumb != null">#{thumb},</if>
  89. <if test="picsPath != null">#{picsPath},</if>
  90. <if test="audioPic != null">#{audioPic},</if>
  91. <if test="audioPath != null">#{audioPath},</if>
  92. <if test="insertTime != null">#{insertTime},</if>
  93. <if test="delStatus != null">#{delStatus},</if>
  94. <if test="isPush != null">#{isPush},</if>
  95. <if test="newsType != null">#{newsType},</if>
  96. <if test="newsContent != null">#{newsContent},</if>
  97. <if test="joinid != null">#{joinid},</if>
  98. <if test="newsid != null">#{newsid},</if>
  99. <if test="sort != null">#{sort},</if>
  100. <if test="orgid != null">#{orgid},</if>
  101. <if test="userTableId != null">#{userTableId},</if>
  102. </trim>
  103. </insert>
  104. <update id="updatePartyStudyRules" parameterType="PartyStudyRules">
  105. update party_study_rules
  106. <trim prefix="SET" suffixOverrides=",">
  107. <if test="title != null">title = #{title},</if>
  108. <if test="content != null">content = #{content},</if>
  109. <if test="describe != null">`describe` = #{describe},</if>
  110. <if test="url != null">url = #{url},</if>
  111. <if test="thumb != null">thumb = #{thumb},</if>
  112. <if test="picsPath != null">pics_path = #{picsPath},</if>
  113. <if test="audioPic != null">audio_pic = #{audioPic},</if>
  114. <if test="audioPath != null">audio_path = #{audioPath},</if>
  115. <if test="insertTime != null">insert_time = #{insertTime},</if>
  116. <if test="delStatus != null">del_status = #{delStatus},</if>
  117. <if test="isPush != null">is_push = #{isPush},</if>
  118. <if test="newsType != null">news_type = #{newsType},</if>
  119. <if test="newsContent != null">news_content = #{newsContent},</if>
  120. <if test="joinid != null">joinid = #{joinid},</if>
  121. <if test="newsid != null">newsid = #{newsid},</if>
  122. <if test="sort != null">sort = #{sort},</if>
  123. <if test="orgid != null">orgid = #{orgid},</if>
  124. <if test="userTableId != null">user_table_id = #{userTableId},</if>
  125. </trim>
  126. where id = #{id}
  127. </update>
  128. <delete id="deletePartyStudyRulesById" parameterType="Long">
  129. delete from party_study_rules where id = #{id}
  130. </delete>
  131. <delete id="deletePartyStudyRulesByIds" parameterType="String">
  132. delete from party_study_rules where id in
  133. <foreach item="id" collection="array" open="(" separator="," close=")">
  134. #{id}
  135. </foreach>
  136. </delete>
  137. </mapper>