TAppMailMapper.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.ruoyi.bussiness.mapper.TAppMailMapper">
  6. <resultMap type="com.ruoyi.bussiness.domain.TAppMail" id="TAppMailResult">
  7. <result property="id" column="id" />
  8. <result property="userId" column="user_id" />
  9. <result property="title" column="title" />
  10. <result property="content" column="content" />
  11. <result property="type" column="type" />
  12. <result property="status" column="status" />
  13. <result property="opertorId" column="opertor_id" />
  14. <result property="createTime" column="create_time" />
  15. <result property="updateTime" column="update_time" />
  16. <result property="searchValue" column="search_value" />
  17. <result property="delFlag" column="del_flag" />
  18. </resultMap>
  19. <sql id="selectTAppMailVo">
  20. select id, user_id, title, content, type, status, opertor_id, create_time, update_time, search_value, del_flag from t_app_mail
  21. </sql>
  22. <select id="selectTAppMailList" parameterType="TAppMail" resultMap="TAppMailResult">
  23. <include refid="selectTAppMailVo"/>
  24. <where>
  25. and del_flag = '0'
  26. <if test="userId != null "> and user_id = #{userId}</if>
  27. <if test="title != null and title != ''"> and title like concat('%',#{title},'%') </if>
  28. <if test="content != null and content != ''"> and content = #{content}</if>
  29. <if test="type != null and type != ''"> and type = #{type}</if>
  30. <if test="status != null "> and status = #{status}</if>
  31. <if test="opertorId != null and opertorId != ''"> and opertor_id = #{opertorId}</if>
  32. <if test="searchValue != null and searchValue != ''"> and search_value = #{searchValue}</if>
  33. </where>
  34. order by create_time desc
  35. </select>
  36. <select id="selectTAppMailById" parameterType="Long" resultMap="TAppMailResult">
  37. <include refid="selectTAppMailVo"/>
  38. where id = #{id}
  39. </select>
  40. <insert id="insertTAppMail" parameterType="TAppMail" useGeneratedKeys="true" keyProperty="id">
  41. insert into t_app_mail
  42. <trim prefix="(" suffix=")" suffixOverrides=",">
  43. <if test="userId != null">user_id,</if>
  44. <if test="title != null and title != ''">title,</if>
  45. <if test="content != null">content,</if>
  46. <if test="type != null">type,</if>
  47. <if test="status != null">status,</if>
  48. <if test="opertorId != null">opertor_id,</if>
  49. <if test="createTime != null">create_time,</if>
  50. <if test="updateTime != null">update_time,</if>
  51. <if test="searchValue != null">search_value,</if>
  52. <if test="delFlag != null">del_flag,</if>
  53. </trim>
  54. <trim prefix="values (" suffix=")" suffixOverrides=",">
  55. <if test="userId != null">#{userId},</if>
  56. <if test="title != null and title != ''">#{title},</if>
  57. <if test="content != null">#{content},</if>
  58. <if test="type != null">#{type},</if>
  59. <if test="status != null">#{status},</if>
  60. <if test="opertorId != null">#{opertorId},</if>
  61. <if test="createTime != null">#{createTime},</if>
  62. <if test="updateTime != null">#{updateTime},</if>
  63. <if test="searchValue != null">#{searchValue},</if>
  64. <if test="delFlag != null">#{delFlag},</if>
  65. </trim>
  66. </insert>
  67. <update id="updateTAppMail" parameterType="TAppMail">
  68. update t_app_mail
  69. <trim prefix="SET" suffixOverrides=",">
  70. <if test="userId != null">user_id = #{userId},</if>
  71. <if test="title != null and title != ''">title = #{title},</if>
  72. <if test="content != null">content = #{content},</if>
  73. <if test="type != null">type = #{type},</if>
  74. <if test="status != null">status = #{status},</if>
  75. <if test="opertorId != null">opertor_id = #{opertorId},</if>
  76. <if test="createTime != null">create_time = #{createTime},</if>
  77. <if test="updateTime != null">update_time = #{updateTime},</if>
  78. <if test="searchValue != null">search_value = #{searchValue},</if>
  79. <if test="delFlag != null">del_flag = #{delFlag},</if>
  80. </trim>
  81. where id = #{id}
  82. </update>
  83. <delete id="deleteTAppMailById" parameterType="Long">
  84. update t_app_mail set del_flag = '2' where id = #{id}
  85. </delete>
  86. <delete id="deleteTAppMailByIds" parameterType="String">
  87. update t_app_mail set del_flag = '2' where id in
  88. <foreach item="id" collection="array" open="(" separator="," close=")">
  89. #{id}
  90. </foreach>
  91. </delete>
  92. </mapper>