MailMapper.xml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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.jeeplus.modules.iim.mapper.MailMapper">
  4. <sql id="mailColumns">
  5. a.id AS "id",
  6. a.title AS "title",
  7. a.overview AS "overview",
  8. a.content AS "content"
  9. </sql>
  10. <sql id="mailJoins">
  11. </sql>
  12. <select id="get" resultType="Mail">
  13. SELECT
  14. <include refid="mailColumns"/>
  15. FROM iim_mail a
  16. <include refid="mailJoins"/>
  17. WHERE a.id = #{id}
  18. </select>
  19. <select id="findList" resultType="Mail">
  20. SELECT
  21. <include refid="mailColumns"/>
  22. FROM iim_mail a
  23. <include refid="mailJoins"/>
  24. <where>
  25. <if test="title != null and title != ''">
  26. AND a.title LIKE
  27. <if test="dbName == 'oracle'">'%'||#{title}||'%'</if>
  28. <if test="dbName == 'mssql'">'%'+#{title}+'%'</if>
  29. <if test="dbName == 'mysql'">concat('%',#{title},'%')</if>
  30. </if>
  31. </where>
  32. <choose>
  33. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  34. ORDER BY ${page.orderBy}
  35. </when>
  36. <otherwise>
  37. </otherwise>
  38. </choose>
  39. </select>
  40. <select id="findAllList" resultType="Mail">
  41. SELECT
  42. <include refid="mailColumns"/>
  43. FROM iim_mail a
  44. <include refid="mailJoins"/>
  45. <where>
  46. </where>
  47. <choose>
  48. <when test="page !=null and page.orderBy != null and page.orderBy != ''">
  49. ORDER BY ${page.orderBy}
  50. </when>
  51. <otherwise>
  52. </otherwise>
  53. </choose>
  54. </select>
  55. <insert id="insert">
  56. INSERT INTO iim_mail(
  57. id,
  58. title,
  59. overview,
  60. content
  61. ) VALUES (
  62. #{id},
  63. #{title},
  64. #{overview},
  65. #{content}
  66. )
  67. </insert>
  68. <update id="update">
  69. UPDATE iim_mail SET
  70. title = #{title},
  71. overview = #{overview},
  72. content = #{content}
  73. WHERE id = #{id}
  74. </update>
  75. <update id="delete">
  76. DELETE FROM iim_mail
  77. WHERE id = #{id}
  78. </update>
  79. <!-- <update id="deleteByLogic">
  80. DELETE FROM iim_mail
  81. WHERE id = #{id}
  82. </update>-->
  83. </mapper>