SysDocumentServiceDaoImplMapper.xml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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="sysDocumentServiceDaoImpl">
  6. <!-- 保存系统文档信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveSysDocumentInfo" parameterType="Map">
  8. insert into sys_document(
  9. doc_id,doc_title,doc_content,doc_code
  10. ) values (
  11. #{docId},#{docTitle},#{docContent},#{docCode}
  12. )
  13. </insert>
  14. <!-- 查询系统文档信息 add by wuxw 2018-07-03 -->
  15. <select id="getSysDocumentInfo" parameterType="Map" resultType="Map">
  16. select t.doc_id docId,t.doc_content,t.doc_content docContent,t.doc_code,t.doc_code docCode,t.status_cd,t.status_cd statusCd,
  17. t.doc_title docTitle,t.create_time createTime
  18. from sys_document t
  19. where 1 =1
  20. <if test="docContent !=null and docContent != ''">
  21. and t.doc_content= #{docContent}
  22. </if>
  23. <if test="docCode !=null and docCode != ''">
  24. and t.doc_code= #{docCode}
  25. </if>
  26. <if test="docTitle !=null and docTitle != ''">
  27. and t.doc_title like concat('%',#{docTitle},'%')
  28. </if>
  29. <if test="statusCd !=null and statusCd != ''">
  30. and t.status_cd= #{statusCd}
  31. </if>
  32. <if test="docId !=null and docId != ''">
  33. and t.doc_id= #{docId}
  34. </if>
  35. order by t.create_time desc
  36. <if test="page != -1 and page != null ">
  37. limit #{page}, #{row}
  38. </if>
  39. </select>
  40. <!-- 修改系统文档信息 add by wuxw 2018-07-03 -->
  41. <update id="updateSysDocumentInfo" parameterType="Map">
  42. update sys_document t set t.status_cd = #{statusCd}
  43. <if test="newBId != null and newBId != ''">
  44. ,t.b_id = #{newBId}
  45. </if>
  46. <if test="docContent !=null and docContent != ''">
  47. , t.doc_content= #{docContent}
  48. </if>
  49. <if test="docTitle !=null and docTitle != ''">
  50. , t.doc_title= #{docTitle}
  51. </if>
  52. <if test="docCode !=null and docCode != ''">
  53. , t.doc_code= #{docCode}
  54. </if>
  55. where 1=1
  56. <if test="docId !=null and docId != ''">
  57. and t.doc_id= #{docId}
  58. </if>
  59. </update>
  60. <!-- 查询系统文档数量 add by wuxw 2018-07-03 -->
  61. <select id="querySysDocumentsCount" parameterType="Map" resultType="Map">
  62. select count(1) count
  63. from sys_document t
  64. where 1 =1
  65. <if test="docContent !=null and docContent != ''">
  66. and t.doc_content= #{docContent}
  67. </if>
  68. <if test="docCode !=null and docCode != ''">
  69. and t.doc_code= #{docCode}
  70. </if>
  71. <if test="statusCd !=null and statusCd != ''">
  72. and t.status_cd= #{statusCd}
  73. </if>
  74. <if test="docId !=null and docId != ''">
  75. and t.doc_id= #{docId}
  76. </if>
  77. <if test="docTitle !=null and docTitle != ''">
  78. and t.doc_title like concat('%',#{docTitle},'%')
  79. </if>
  80. </select>
  81. </mapper>