FsCourseSopAppLinkMapper.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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.fs.course.mapper.FsCourseSopAppLinkMapper">
  6. <resultMap type="FsCourseSopAppLink" id="FsCourseSopAppLinkResult">
  7. <result property="id" column="id" />
  8. <result property="link" column="link" />
  9. <result property="createTime" column="create_time" />
  10. <result property="updateTime" column="update_time" />
  11. <result property="companyId" column="company_id" />
  12. <result property="companyUserId" column="company_user_id" />
  13. <result property="qwUserId" column="qw_user_id" />
  14. <result property="qwUserName" column="qw_user_name" />
  15. <result property="corpId" column="corp_id" />
  16. <result property="courseId" column="course_id" />
  17. <result property="courseTitle" column="course_title" />
  18. <result property="courseUrl" column="course_url" />
  19. <result property="videoId" column="video_id" />
  20. <result property="videoTitle" column="video_title" />
  21. <result property="appRealLink" column="app_real_Link" />
  22. <result property="qwExternalId" column="qw_external_id" />
  23. <result property="isRead" column="is_read" />
  24. </resultMap>
  25. <sql id="selectFsCourseSopAppLinkVo">
  26. select id, link, create_time, update_time, company_id, company_user_id, qw_user_id, qw_user_name, corp_id, course_id, course_title, course_url, video_id, video_title, app_real_Link, qw_external_id,is_read from fs_course_sop_app_link
  27. </sql>
  28. <select id="selectFsCourseSopAppLinkList" parameterType="FsCourseSopAppLink" resultMap="FsCourseSopAppLinkResult">
  29. <include refid="selectFsCourseSopAppLinkVo"/>
  30. <where>
  31. <if test="link != null and link != ''"> and link = #{link}</if>
  32. <if test="companyId != null "> and company_id = #{companyId}</if>
  33. <if test="companyUserId != null "> and company_user_id = #{companyUserId}</if>
  34. <if test="qwUserId != null and qwUserId != ''"> and qw_user_id = #{qwUserId}</if>
  35. <if test="qwUserName != null and qwUserName != ''"> and qw_user_name like concat('%', #{qwUserName}, '%')</if>
  36. <if test="corpId != null and corpId != ''"> and corp_id = #{corpId}</if>
  37. <if test="courseId != null "> and course_id = #{courseId}</if>
  38. <if test="courseTitle != null and courseTitle != ''"> and course_title = #{courseTitle}</if>
  39. <if test="courseUrl != null and courseUrl != ''"> and course_url = #{courseUrl}</if>
  40. <if test="videoId != null "> and video_id = #{videoId}</if>
  41. <if test="videoTitle != null and videoTitle != ''"> and video_title = #{videoTitle}</if>
  42. <if test="appRealLink != null and appRealLink != ''"> and app_real_Link = #{appRealLink}</if>
  43. <if test="qwExternalId != null "> and qw_external_id = #{qwExternalId}</if>
  44. <if test="isRead != null "> and is_read = #{isRead}</if>
  45. </where>
  46. </select>
  47. <select id="selectFsCourseSopAppLinkById" parameterType="Long" resultMap="FsCourseSopAppLinkResult">
  48. <include refid="selectFsCourseSopAppLinkVo"/>
  49. where id = #{id}
  50. </select>
  51. <insert id="insertFsCourseSopAppLink" parameterType="FsCourseSopAppLink" useGeneratedKeys="true" keyProperty="id">
  52. insert into fs_course_sop_app_link
  53. <trim prefix="(" suffix=")" suffixOverrides=",">
  54. <if test="link != null">link,</if>
  55. <if test="createTime != null">create_time,</if>
  56. <if test="updateTime != null">update_time,</if>
  57. <if test="companyId != null">company_id,</if>
  58. <if test="companyUserId != null">company_user_id,</if>
  59. <if test="qwUserId != null">qw_user_id,</if>
  60. <if test="qwUserName != null">qw_user_name,</if>
  61. <if test="corpId != null">corp_id,</if>
  62. <if test="courseId != null">course_id,</if>
  63. <if test="courseTitle != null">course_title,</if>
  64. <if test="courseUrl != null">course_url,</if>
  65. <if test="videoId != null">video_id,</if>
  66. <if test="videoTitle != null">video_title,</if>
  67. <if test="appRealLink != null">app_real_Link,</if>
  68. <if test="qwExternalId != null">qw_external_id,</if>
  69. </trim>
  70. <trim prefix="values (" suffix=")" suffixOverrides=",">
  71. <if test="link != null">#{link},</if>
  72. <if test="createTime != null">#{createTime},</if>
  73. <if test="updateTime != null">#{updateTime},</if>
  74. <if test="companyId != null">#{companyId},</if>
  75. <if test="companyUserId != null">#{companyUserId},</if>
  76. <if test="qwUserId != null">#{qwUserId},</if>
  77. <if test="qwUserName != null">#{qwUserName},</if>
  78. <if test="corpId != null">#{corpId},</if>
  79. <if test="courseId != null">#{courseId},</if>
  80. <if test="courseTitle != null">#{courseTitle},</if>
  81. <if test="courseUrl != null">#{courseUrl},</if>
  82. <if test="videoId != null">#{videoId},</if>
  83. <if test="videoTitle != null">#{videoTitle},</if>
  84. <if test="appRealLink != null">#{appRealLink},</if>
  85. <if test="qwExternalId != null">#{qwExternalId},</if>
  86. </trim>
  87. </insert>
  88. <insert id="insertFsCourseSopAppLinkBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
  89. INSERT INTO fs_course_sop_app_link
  90. <trim prefix="(" suffix=")" suffixOverrides=",">
  91. <if test="courseAppSopLinks != null and courseAppSopLinks.size() &gt; 0">
  92. <!-- 假设所有日志对象的字段一致 -->
  93. <!-- 动态生成列列表,基于第一个日志对象 -->
  94. <foreach collection="courseAppSopLinks" item="item" index="index" open="" close="" separator="">
  95. <if test="index == 0">
  96. <if test="item.link != null">link,</if>
  97. <if test="item.createTime != null">create_time,</if>
  98. <if test="item.updateTime != null">update_time,</if>
  99. <if test="item.companyId != null">company_id,</if>
  100. <if test="item.companyUserId != null">company_user_id,</if>
  101. <if test="item.qwUserId != null">qw_user_id,</if>
  102. <if test="item.qwUserName != null">qw_user_name,</if>
  103. <if test="item.corpId != null">corp_id,</if>
  104. <if test="item.courseId != null">course_id,</if>
  105. <if test="item.courseTitle != null">course_title,</if>
  106. <if test="item.courseUrl != null">course_url,</if>
  107. <if test="item.videoId != null">video_id,</if>
  108. <if test="item.videoTitle != null">video_title,</if>
  109. <if test="item.appRealLink != null">app_real_Link,</if>
  110. <if test="item.qwExternalId != null">qw_external_id,</if>
  111. <if test="item.isRead != null">is_read,</if>
  112. </if>
  113. </foreach>
  114. </if>
  115. </trim>
  116. <trim prefix="VALUES">
  117. <foreach collection="courseAppSopLinks" item="item" separator=",">
  118. (<trim suffixOverrides=",">
  119. <if test="item.link != null">#{item.link},</if>
  120. <if test="item.createTime != null">#{item.createTime},</if>
  121. <if test="item.updateTime != null">#{item.updateTime},</if>
  122. <if test="item.companyId != null">#{item.companyId},</if>
  123. <if test="item.companyUserId != null">#{item.companyUserId},</if>
  124. <if test="item.qwUserId != null">#{item.qwUserId},</if>
  125. <if test="item.qwUserName != null">#{item.qwUserName},</if>
  126. <if test="item.corpId != null">#{item.corpId},</if>
  127. <if test="item.courseId != null">#{item.courseId},</if>
  128. <if test="item.courseTitle != null">#{item.courseTitle},</if>
  129. <if test="item.courseUrl != null">#{item.courseUrl},</if>
  130. <if test="item.videoId != null">#{item.videoId},</if>
  131. <if test="item.videoTitle != null">#{item.videoTitle},</if>
  132. <if test="item.appRealLink != null">#{item.appRealLink},</if>
  133. <if test="item.qwExternalId != null">#{item.qwExternalId},</if>
  134. <if test="item.isRead != null">#{item.isRead},</if>
  135. </trim>)
  136. </foreach>
  137. </trim>
  138. </insert>
  139. <update id="updateFsCourseSopAppLink" parameterType="FsCourseSopAppLink">
  140. update fs_course_sop_app_link
  141. <trim prefix="SET" suffixOverrides=",">
  142. <if test="link != null">link = #{link},</if>
  143. <if test="createTime != null">create_time = #{createTime},</if>
  144. <if test="updateTime != null">update_time = #{updateTime},</if>
  145. <if test="companyId != null">company_id = #{companyId},</if>
  146. <if test="companyUserId != null">company_user_id = #{companyUserId},</if>
  147. <if test="qwUserId != null">qw_user_id = #{qwUserId},</if>
  148. <if test="qwUserName != null">qw_user_name = #{qwUserName},</if>
  149. <if test="corpId != null">corp_id = #{corpId},</if>
  150. <if test="courseId != null">course_id = #{courseId},</if>
  151. <if test="courseTitle != null">course_title = #{courseTitle},</if>
  152. <if test="courseUrl != null">course_url = #{courseUrl},</if>
  153. <if test="videoId != null">video_id = #{videoId},</if>
  154. <if test="videoTitle != null">video_title = #{videoTitle},</if>
  155. <if test="appRealLink != null">app_real_Link = #{appRealLink},</if>
  156. <if test="qwExternalId != null">qw_external_id = #{qwExternalId},</if>
  157. <if test="isRead != null">is_read = #{isRead},</if>
  158. </trim>
  159. where id = #{id}
  160. </update>
  161. <delete id="deleteFsCourseSopAppLinkById" parameterType="Long">
  162. delete from fs_course_sop_app_link where id = #{id}
  163. </delete>
  164. <delete id="deleteFsCourseSopAppLinkByIds" parameterType="String">
  165. delete from fs_course_sop_app_link where id in
  166. <foreach item="id" collection="array" open="(" separator="," close=")">
  167. #{id}
  168. </foreach>
  169. </delete>
  170. </mapper>