SystemRemindMapper.xml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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.usoftchina.saas.commons.mapper.SystemRemindMapper">
  4. <resultMap id="BaseResultMap" type="com.usoftchina.saas.commons.dto.AddApplyDTO">
  5. <result column="re_id" jdbcType="INTEGER" property="id" />
  6. <result column="re_applyname" jdbcType="VARCHAR" property="username" />
  7. <result column="re_applymobile" jdbcType="VARCHAR" property="mobile" />
  8. <result column="re_status" jdbcType="VARCHAR" property="status" />
  9. <result column="creatorId" jdbcType="INTEGER" property="creatorId" />
  10. <result column="creatorName" jdbcType="VARCHAR" property="creatorName" />
  11. <result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
  12. </resultMap>
  13. <select id="getApplyList" resultMap="BaseResultMap">
  14. SELECT * FROM REMIND
  15. <where>
  16. <if test="condition != null">
  17. ${condition}
  18. </if>
  19. <if test="companyId != null">
  20. AND COMPANYID = #{companyId}
  21. </if>
  22. </where>
  23. ORDER BY RE_STATUS DESC,RE_ID DESC
  24. </select>
  25. <update id="confirmApply">
  26. UPDATE REMIND SET RE_STATUS = #{status}, updateTime = now(), updaterId = #{updaterId}
  27. where re_id = #{id}
  28. </update>
  29. <insert id="insertSelective" parameterType="com.usoftchina.saas.commons.po.AddApply">
  30. <selectKey resultType="java.lang.Long" keyProperty="id">
  31. SELECT LAST_INSERT_ID() AS ID
  32. </selectKey>
  33. insert into remind
  34. <trim prefix="(" suffix=")" suffixOverrides=",">
  35. <if test="username != null">
  36. re_applyname,
  37. </if>
  38. <if test="mobile != null">
  39. re_applymobile,
  40. </if>
  41. <if test="creatorId != null">
  42. creatorId,
  43. </if>
  44. <if test="creatorName != null">
  45. creatorName,
  46. </if>
  47. <if test="createTime != null">
  48. createTime,
  49. </if>
  50. <if test="companyId != null">
  51. companyId,
  52. </if>
  53. <if test="status != null">
  54. re_status
  55. </if>
  56. </trim>
  57. <trim prefix="values (" suffix=")" suffixOverrides=",">
  58. <if test="username != null">
  59. #{username, jdbcType=VARCHAR},
  60. </if>
  61. <if test="mobile != null">
  62. #{mobile, jdbcType=VARCHAR},
  63. </if>
  64. <if test="creatorId != null">
  65. #{creatorId, jdbcType=INTEGER},
  66. </if>
  67. <if test="creatorName != null">
  68. #{creatorName, jdbcType=VARCHAR},
  69. </if>
  70. <if test="createTime != null">
  71. #{createTime, jdbcType=TIMESTAMP},
  72. </if>
  73. <if test="companyId != null">
  74. #{companyId, jdbcType=TIMESTAMP},
  75. </if>
  76. <if test="status != null">
  77. #{status, jdbcType=TIMESTAMP}
  78. </if>
  79. </trim>
  80. </insert>
  81. </mapper>