CmRelatedMapper.xml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  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.caimei.modules.info.dao.CmRelatedMapper">
  6. <resultMap type="CmRelated" id="CmRelatedResult">
  7. <result property="id" column="id" />
  8. <result property="type" column="type" />
  9. <result property="authorId" column="authorId" />
  10. <result property="relatedId" column="relatedId" />
  11. <result property="delFlag" column="delFlag" />
  12. <result property="updateTime" column="updateTime" />
  13. <result property="createTime" column="createTime" />
  14. <result property="sort" column="sort" />
  15. </resultMap>
  16. <sql id="selectCmRelatedVo">
  17. select
  18. cm_related.id,
  19. cm_related.type,
  20. cm_related.authorId,
  21. cm_related.relatedId,
  22. cm_related.delFlag,
  23. cm_related.updateTime,
  24. cm_related.createTime,
  25. cm_related.sort
  26. </sql>
  27. <select id="getByCmRelated" parameterType="CmRelated" resultMap="CmRelatedResult">
  28. <include refid="selectCmRelatedVo"/>
  29. from cm_related AS cm_related
  30. <where> cm_related.delFlag = 0
  31. <if test="id != null and id != ''">
  32. and cm_related.id
  33. <if test="id.toUpperCase().indexOf('=')==-1">
  34. = #{id}
  35. </if>
  36. <if test="id.toUpperCase().indexOf('=')!=-1">
  37. <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
  38. <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
  39. <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
  40. #{idIn}
  41. </foreach>
  42. </if>
  43. </if>
  44. <if test="type != null and type != ''">
  45. and cm_related.type
  46. <if test="type.toUpperCase().indexOf('=')==-1">
  47. = #{type}
  48. </if>
  49. <if test="type.toUpperCase().indexOf('=')!=-1">
  50. <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
  51. <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
  52. <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
  53. #{typeIn}
  54. </foreach>
  55. </if>
  56. </if>
  57. <if test="authorId != null and authorId != ''"> and cm_related.authorId = #{authorId}</if>
  58. <if test="relatedId != null and relatedId != ''"> and cm_related.relatedId = #{relatedId}</if>
  59. <if test="delFlag != null "> and cm_related.delFlag = #{delFlag}</if>
  60. <if test="updateTime != null "> and cm_related.updateTime = #{updateTime}</if>
  61. <if test="createTime != null "> and cm_related.createTime = #{createTime}</if>
  62. <if test="sort != null "> and cm_related.sort = #{sort}</if>
  63. </where>
  64. group by cm_related.id
  65. order by cm_related.createTime desc
  66. limit 0,1
  67. </select>
  68. <select id="findList" parameterType="CmRelated" resultMap="CmRelatedResult">
  69. <include refid="selectCmRelatedVo"/>
  70. from cm_related AS cm_related
  71. <if test="info != null">
  72. left join info AS info on cm_related.relatedId=info.id
  73. </if>
  74. <where> cm_related.delFlag = 0
  75. <if test="id != null and id != ''">
  76. and cm_related.id
  77. <if test="id.toUpperCase().indexOf('=')==-1">
  78. = #{id}
  79. </if>
  80. <if test="id.toUpperCase().indexOf('=')!=-1">
  81. <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
  82. <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
  83. <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
  84. #{idIn}
  85. </foreach>
  86. </if>
  87. </if>
  88. <if test="type != null and type != ''">
  89. and cm_related.type
  90. <if test="type.toUpperCase().indexOf('=')==-1">
  91. = #{type}
  92. </if>
  93. <if test="type.toUpperCase().indexOf('=')!=-1">
  94. <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
  95. <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
  96. <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
  97. #{typeIn}
  98. </foreach>
  99. </if>
  100. </if>
  101. <if test="authorId != null and authorId != ''"> and cm_related.authorId = #{authorId}</if>
  102. <if test="relatedId != null and relatedId != ''"> and cm_related.relatedId = #{relatedId}</if>
  103. <if test="delFlag != null "> and cm_related.delFlag = #{delFlag}</if>
  104. <if test="updateTime != null "> and cm_related.updateTime = #{updateTime}</if>
  105. <if test="createTime != null "> and cm_related.createTime = #{createTime}</if>
  106. <if test="sort != null "> and cm_related.sort = #{sort}</if>
  107. -- info
  108. <if test="info != null ">
  109. <if test="info.id != null and info.id != ''">
  110. and info.id
  111. = #{info.id}
  112. </if>
  113. <if test="info.typeId != null and info.typeId != ''">
  114. and info.typeId
  115. = #{info.typeId}
  116. </if>
  117. <if test="info.title != null and info.title != ''"> and info.title = #{info.title}</if>
  118. <if test="info.label != null and info.label != ''"> and info.label = #{info.label}</if>
  119. <if test="info.publisher != null and info.publisher != ''"> and info.publisher = #{info.publisher}</if>
  120. <if test="info.source != null and info.source != ''"> and info.source = #{info.source}</if>
  121. <if test="info.publishSource != null "> and info.publishSource = #{info.publishSource}</if>
  122. <if test="info.shopId != null "> and info.shopId = #{info.shopId}</if>
  123. <if test="info.keyword != null and info.keyword != ''"> and info.keyword = #{info.keyword}</if>
  124. <if test="info.recommendContent != null and info.recommendContent != ''"> and info.recommendContent = #{info.recommendContent}</if>
  125. <if test="info.infoContent != null and info.infoContent != ''"> and info.infoContent = #{info.infoContent}</if>
  126. <if test="info.guidanceImage != null and info.guidanceImage != ''"> and info.guidanceImage = #{info.guidanceImage}</if>
  127. <if test="info.homePageImage != null and info.homePageImage != ''"> and info.homePageImage = #{info.homePageImage}</if>
  128. <if test="info.pubdate != null "> and info.pubdate = #{info.pubdate}</if>
  129. <if test="info.recommendStatus != null and info.recommendStatus != ''"> and info.recommendStatus = #{info.recommendStatus}</if>
  130. <if test="info.enabledStatus != null and info.enabledStatus != ''"> and info.enabledStatus = #{info.enabledStatus}</if>
  131. <if test="info.basePraise != null "> and info.basePraise = #{info.basePraise}</if>
  132. <if test="info.basePv != null "> and info.basePv = #{info.basePv}</if>
  133. <if test="info.priorityIndex != null "> and info.priorityIndex = #{info.priorityIndex}</if>
  134. <if test="info.auditStatus != null "> and info.auditStatus = #{info.auditStatus}</if>
  135. <if test="info.onlineStatus != null "> and info.onlineStatus = #{info.onlineStatus}</if>
  136. <if test="info.failReason != null and info.failReason != ''"> and info.failReason = #{info.failReason}</if>
  137. <if test="info.createBy != null and info.createBy != ''"> and info.createBy = #{info.createBy}</if>
  138. <if test="info.createDate != null "> and info.createDate = #{info.createDate}</if>
  139. <if test="info.updateBy != null and info.updateBy != ''"> and info.updateBy = #{info.updateBy}</if>
  140. <if test="info.updateDate != null "> and info.updateDate = #{info.updateDate}</if>
  141. <if test="info.topPosition != null "> and info.topPosition = #{info.topPosition}</if>
  142. <if test="info.labelIds != null and info.labelIds != ''"> and info.labelIds = #{info.labelIds}</if>
  143. <if test="info.relatedLabels != null and info.relatedLabels != ''"> and info.relatedLabels = #{info.relatedLabels}</if>
  144. <if test="info.delFlag != null "> and info.delFlag = #{info.delFlag}</if>
  145. <if test="info.autoStatus != null "> and info.autoStatus = #{info.autoStatus}</if>
  146. <if test="info.startPubDate != null and info.startPubDate != ''">
  147. AND info.pubdate <![CDATA[ >= ]]> #{info.startPubDate}
  148. </if>
  149. <if test="info.endPubDate != null and info.endPubDate != ''">
  150. AND info.pubdate <![CDATA[ <= ]]> #{info.endPubDate}
  151. </if>
  152. </if>
  153. </where>
  154. group by cm_related.id
  155. order by cm_related.sort asc,cm_related.createTime desc
  156. </select>
  157. <select id="getCmRelatedList" parameterType="CmRelated" resultMap="CmRelatedResult">
  158. <include refid="selectCmRelatedVo"/>
  159. from cm_related AS cm_related
  160. <if test="info != null">
  161. left join info AS info on cm_related.relatedId=info.id
  162. </if>
  163. <where> cm_related.delFlag = 0
  164. <if test="id != null and id != ''">
  165. and cm_related.id
  166. <if test="id.toUpperCase().indexOf('=')==-1">
  167. = #{id}
  168. </if>
  169. <if test="id.toUpperCase().indexOf('=')!=-1">
  170. <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
  171. <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
  172. <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
  173. #{idIn}
  174. </foreach>
  175. </if>
  176. </if>
  177. <if test="type != null and type != ''">
  178. and cm_related.type
  179. <if test="type.toUpperCase().indexOf('=')==-1">
  180. = #{type}
  181. </if>
  182. <if test="type.toUpperCase().indexOf('=')!=-1">
  183. <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
  184. <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
  185. <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
  186. #{typeIn}
  187. </foreach>
  188. </if>
  189. </if>
  190. <if test="authorId != null and authorId != ''"> and cm_related.authorId = #{authorId}</if>
  191. <if test="relatedId != null and relatedId != ''"> and cm_related.relatedId = #{relatedId}</if>
  192. <if test="delFlag != null "> and cm_related.delFlag = #{delFlag}</if>
  193. <if test="updateTime != null "> and cm_related.updateTime = #{updateTime}</if>
  194. <if test="createTime != null "> and cm_related.createTime = #{createTime}</if>
  195. <if test="sort != null "> and cm_related.sort = #{sort}</if>
  196. -- info
  197. <if test="info != null ">
  198. <if test="info.id != null and info.id != ''">
  199. and info.id
  200. = #{info.id}
  201. </if>
  202. <if test="info.typeId != null and info.typeId != ''">
  203. and info.typeId
  204. = #{info.typeId}
  205. </if>
  206. <if test="info.title != null and info.title != ''"> and info.title = #{info.title}</if>
  207. <if test="info.label != null and info.label != ''"> and info.label = #{info.label}</if>
  208. <if test="info.publisher != null and info.publisher != ''"> and info.publisher = #{info.publisher}</if>
  209. <if test="info.source != null and info.source != ''"> and info.source = #{info.source}</if>
  210. <if test="info.publishSource != null "> and info.publishSource = #{info.publishSource}</if>
  211. <if test="info.shopId != null "> and info.shopId = #{info.shopId}</if>
  212. <if test="info.keyword != null and info.keyword != ''"> and info.keyword = #{info.keyword}</if>
  213. <if test="info.recommendContent != null and info.recommendContent != ''"> and info.recommendContent = #{info.recommendContent}</if>
  214. <if test="info.infoContent != null and info.infoContent != ''"> and info.infoContent = #{info.infoContent}</if>
  215. <if test="info.guidanceImage != null and info.guidanceImage != ''"> and info.guidanceImage = #{info.guidanceImage}</if>
  216. <if test="info.homePageImage != null and info.homePageImage != ''"> and info.homePageImage = #{info.homePageImage}</if>
  217. <if test="info.pubdate != null "> and info.pubdate = #{info.pubdate}</if>
  218. <if test="info.recommendStatus != null and info.recommendStatus != ''"> and info.recommendStatus = #{info.recommendStatus}</if>
  219. <if test="info.enabledStatus != null and info.enabledStatus != ''"> and info.enabledStatus = #{info.enabledStatus}</if>
  220. <if test="info.basePraise != null "> and info.basePraise = #{info.basePraise}</if>
  221. <if test="info.basePv != null "> and info.basePv = #{info.basePv}</if>
  222. <if test="info.priorityIndex != null "> and info.priorityIndex = #{info.priorityIndex}</if>
  223. <if test="info.auditStatus != null "> and info.auditStatus = #{info.auditStatus}</if>
  224. <if test="info.onlineStatus != null "> and info.onlineStatus = #{info.onlineStatus}</if>
  225. <if test="info.failReason != null and info.failReason != ''"> and info.failReason = #{info.failReason}</if>
  226. <if test="info.createBy != null and info.createBy != ''"> and info.createBy = #{info.createBy}</if>
  227. <if test="info.createDate != null "> and info.createDate = #{info.createDate}</if>
  228. <if test="info.updateBy != null and info.updateBy != ''"> and info.updateBy = #{info.updateBy}</if>
  229. <if test="info.updateDate != null "> and info.updateDate = #{info.updateDate}</if>
  230. <if test="info.topPosition != null "> and info.topPosition = #{info.topPosition}</if>
  231. <if test="info.labelIds != null and info.labelIds != ''"> and info.labelIds = #{info.labelIds}</if>
  232. <if test="info.relatedLabels != null and info.relatedLabels != ''"> and info.relatedLabels = #{info.relatedLabels}</if>
  233. <if test="info.delFlag != null "> and info.delFlag = #{info.delFlag}</if>
  234. <if test="info.autoStatus != null "> and info.autoStatus = #{info.autoStatus}</if>
  235. <if test="info.startPubDate != null and info.startPubDate != ''">
  236. AND info.pubdate <![CDATA[ >= ]]> #{info.startPubDate}
  237. </if>
  238. <if test="info.endPubDate != null and info.endPubDate != ''">
  239. AND info.pubdate <![CDATA[ <= ]]> #{info.endPubDate}
  240. </if>
  241. </if>
  242. </where>
  243. group by cm_related.id
  244. order by cm_related.sort asc,cm_related.createTime desc
  245. </select>
  246. <select id="getCmRelatedCount" parameterType="CmRelated" resultType="String">
  247. select count(1)
  248. from cm_related AS cm_related
  249. <where> cm_related.delFlag = 0
  250. <if test="id != null and id != ''">
  251. and cm_related.id
  252. <if test="id.toUpperCase().indexOf('=')==-1">
  253. = #{id}
  254. </if>
  255. <if test="id.toUpperCase().indexOf('=')!=-1">
  256. <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
  257. <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
  258. <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
  259. #{idIn}
  260. </foreach>
  261. </if>
  262. </if>
  263. <if test="type != null and type != ''">
  264. and cm_related.type
  265. <if test="type.toUpperCase().indexOf('=')==-1">
  266. = #{type}
  267. </if>
  268. <if test="type.toUpperCase().indexOf('=')!=-1">
  269. <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
  270. <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
  271. <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
  272. #{typeIn}
  273. </foreach>
  274. </if>
  275. </if>
  276. <if test="authorId != null and authorId != ''"> and cm_related.authorId = #{authorId}</if>
  277. <if test="relatedId != null and relatedId != ''"> and cm_related.relatedId = #{relatedId}</if>
  278. <if test="delFlag != null "> and cm_related.delFlag = #{delFlag}</if>
  279. <if test="updateTime != null "> and cm_related.updateTime = #{updateTime}</if>
  280. <if test="createTime != null "> and cm_related.createTime = #{createTime}</if>
  281. <if test="sort != null "> and cm_related.sort = #{sort}</if>
  282. </where>
  283. group by cm_related.id
  284. </select>
  285. <select id="getCmRelatedById" parameterType="String" resultMap="CmRelatedResult">
  286. <include refid="selectCmRelatedVo"/>
  287. from cm_related AS cm_related
  288. where cm_related.delFlag = 0 and cm_related.id = #{id}
  289. </select>
  290. <select id="getByIds" parameterType="CmRelated" resultType="String">
  291. select id
  292. from cm_related AS cm_related
  293. <where> cm_related.delFlag = 0
  294. <if test="id != null and id != ''">
  295. and cm_related.id
  296. <if test="id.toUpperCase().indexOf('=')==-1">
  297. = #{id}
  298. </if>
  299. <if test="id.toUpperCase().indexOf('=')!=-1">
  300. <if test="id.toUpperCase().indexOf('NOT')!=-1"> not </if>
  301. <if test="id.toUpperCase().indexOf('IN')!=-1"> in </if>
  302. <foreach item="idIn" collection="id.substring(id.toUpperCase().indexOf('=')+1,id.length()).trim().split(',')" open="(" separator="," close=")">
  303. #{idIn}
  304. </foreach>
  305. </if>
  306. </if>
  307. <if test="type != null and type != ''">
  308. and cm_related.type
  309. <if test="type.toUpperCase().indexOf('=')==-1">
  310. = #{type}
  311. </if>
  312. <if test="type.toUpperCase().indexOf('=')!=-1">
  313. <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
  314. <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
  315. <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
  316. #{typeIn}
  317. </foreach>
  318. </if>
  319. </if>
  320. <if test="authorId != null and authorId != ''"> and cm_related.authorId = #{authorId}</if>
  321. <if test="relatedId != null and relatedId != ''"> and cm_related.relatedId = #{relatedId}</if>
  322. <if test="delFlag != null "> and cm_related.delFlag = #{delFlag}</if>
  323. <if test="updateTime != null "> and cm_related.updateTime = #{updateTime}</if>
  324. <if test="createTime != null "> and cm_related.createTime = #{createTime}</if>
  325. <if test="sort != null "> and cm_related.sort = #{sort}</if>
  326. </where>
  327. group by cm_related.id
  328. </select>
  329. <select id="getById" parameterType="CmRelated" resultType="String">
  330. select id
  331. from cm_related AS cm_related
  332. <where> cm_related.delFlag = 0
  333. <if test="id != null and id != ''">
  334. and cm_related.id
  335. <if test="id.toString().toUpperCase().indexOf('=')==-1">
  336. = #{id}
  337. </if>
  338. <if test="id.toString().toUpperCase().indexOf('=')!=-1">
  339. <if test="id.toString().toUpperCase().indexOf('NOT')!=-1"> not </if>
  340. <if test="id.toString().toUpperCase().indexOf('IN')!=-1"> in </if>
  341. <foreach item="idIn" collection="id.toString().substring(id.toString().toUpperCase().indexOf('=')+1,id.toString().length()).trim().split(',')" open="(" separator="," close=")">
  342. #{idIn}
  343. </foreach>
  344. </if>
  345. </if>
  346. <if test="type != null and type != ''">
  347. and cm_related.type
  348. <if test="type.toUpperCase().indexOf('=')==-1">
  349. = #{type}
  350. </if>
  351. <if test="type.toUpperCase().indexOf('=')!=-1">
  352. <if test="type.toUpperCase().indexOf('NOT')!=-1"> not </if>
  353. <if test="type.toUpperCase().indexOf('IN')!=-1"> in </if>
  354. <foreach item="typeIn" collection="type.substring(type.toUpperCase().indexOf('=')+1,type.length()).trim().split(',')" open="(" separator="," close=")">
  355. #{typeIn}
  356. </foreach>
  357. </if>
  358. </if>
  359. <if test="authorId != null and authorId != ''"> and cm_related.authorId = #{authorId}</if>
  360. <if test="relatedId != null and relatedId != ''"> and cm_related.relatedId = #{relatedId}</if>
  361. <if test="delFlag != null "> and cm_related.delFlag = #{delFlag}</if>
  362. <if test="updateTime != null "> and cm_related.updateTime = #{updateTime}</if>
  363. <if test="createTime != null "> and cm_related.createTime = #{createTime}</if>
  364. <if test="sort != null "> and cm_related.sort = #{sort}</if>
  365. </where>
  366. group by cm_related.id
  367. limit 0,1
  368. </select>
  369. <insert id="addCmRelated" parameterType="CmRelated" useGeneratedKeys="true" keyProperty="id">
  370. insert into cm_related
  371. <trim prefix="(" suffix=")" suffixOverrides=",">
  372. <if test="id != null and id != ''">id,</if>
  373. <if test="type != null and type != ''">type,</if>
  374. <if test="authorId != null and authorId != ''">authorId,</if>
  375. <if test="relatedId != null and relatedId != ''">relatedId,</if>
  376. <if test="delFlag != null">delFlag,</if>
  377. <if test="updateTime != null">updateTime,</if>
  378. <if test="createTime != null">createTime,</if>
  379. <if test="sort != null">sort,</if>
  380. </trim>
  381. <trim prefix="values (" suffix=")" suffixOverrides=",">
  382. <if test="id != null and id != ''">#{id},</if>
  383. <if test="type != null and type != ''">#{type},</if>
  384. <if test="authorId != null and authorId != ''">#{authorId},</if>
  385. <if test="relatedId != null and relatedId != ''">#{relatedId},</if>
  386. <if test="delFlag != null">#{delFlag},</if>
  387. <if test="updateTime != null">#{updateTime},</if>
  388. <if test="createTime != null">#{createTime},</if>
  389. <if test="sort != null">#{sort},</if>
  390. </trim>
  391. </insert>
  392. <update id="updateCmRelated" parameterType="CmRelated">
  393. update cm_related
  394. <trim prefix="SET" suffixOverrides=",">
  395. <if test="type != null and type != ''">type = #{type},</if>
  396. <if test="authorId != null and authorId != ''">authorId = #{authorId},</if>
  397. <if test="relatedId != null and relatedId != ''">relatedId = #{relatedId},</if>
  398. <if test="delFlag != null">delFlag = #{delFlag},</if>
  399. <if test="updateTime != null">updateTime = #{updateTime},</if>
  400. <if test="createTime != null">createTime = #{createTime},</if>
  401. <if test="sort != null">sort = #{sort},</if>
  402. </trim>
  403. where id = #{id}
  404. </update>
  405. <update id="updateDelCmRelatedByIds" parameterType="String">
  406. update cm_related set delFlag=#{delFlag} where id in
  407. <foreach item="id" collection="ids" open="(" separator="," close=")">
  408. #{id}
  409. </foreach>
  410. </update>
  411. <delete id="delCmRelatedById" parameterType="String">
  412. delete
  413. from cm_related where id = #{id}
  414. </delete>
  415. <delete id="delCmRelatedByAuthorId" parameterType="String">
  416. delete
  417. from cm_related where type = #{type} and authorId = #{authorId}
  418. </delete>
  419. <delete id="delCmRelatedByIds" parameterType="String">
  420. delete from cm_related where id in
  421. <foreach item="id" collection="ids" open="(" separator="," close=")">
  422. #{id}
  423. </foreach>
  424. </delete>
  425. </mapper>