MsgToMapper.xml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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.zhyc.xps.common.mapper.MsgToMapper">
  4. <!--新增Create-->
  5. <insert id="create" parameterType="com.zhyc.xps.common.entity.MsgTo">
  6. INSERT INTO msg_to
  7. <trim prefix="(" suffix=")" suffixOverrides=",">
  8. <if test="ocId != null">
  9. oc_id,
  10. </if>
  11. <if test="msgId != null">
  12. msg_id,
  13. </if>
  14. <if test="msgToId != null">
  15. msg_to_id,
  16. </if>
  17. <if test="status != null">
  18. status,
  19. </if>
  20. <if test="createdBy != null">
  21. created_by,
  22. </if>
  23. <if test="createdAt != null">
  24. created_at,
  25. </if>
  26. </trim>
  27. <trim prefix="values (" suffix=")" suffixOverrides=",">
  28. <if test="ocId != null">
  29. #{ocId ,jdbcType=BIGINT},
  30. </if>
  31. <if test="msgId != null">
  32. #{msgId ,jdbcType=BIGINT},
  33. </if>
  34. <if test="msgToId != null">
  35. #{msgToId ,jdbcType=BIGINT},
  36. </if>
  37. <if test="status != null">
  38. #{status ,jdbcType=BIGINT},
  39. </if>
  40. <if test="createdBy != null">
  41. #{createdBy ,jdbcType=BIGINT},
  42. </if>
  43. <if test="createdAt != null">
  44. #{createdAt ,jdbcType=TIMESTAMP},
  45. </if>
  46. </trim>
  47. </insert>
  48. <!--更新Update-->
  49. <update id="update" parameterType="java.util.Map">
  50. UPDATE msg_to
  51. <trim suffixOverrides=",">
  52. <set>
  53. <if test="status != null">
  54. status = #{status ,jdbcType=BIGINT},
  55. </if>
  56. <if test="updatedBy != null ">
  57. updated_by = #{updatedBy ,jdbcType=BIGINT},
  58. </if>
  59. <if test="updatedAt != null">
  60. updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
  61. </if>
  62. </set>
  63. </trim>
  64. WHERE 1 = 1
  65. <if test="ocId != null">
  66. AND oc_id = #{ocId ,jdbcType=BIGINT}
  67. </if>
  68. <if test="msgId != null">
  69. AND msg_id = #{msgId ,jdbcType=BIGINT}
  70. </if>
  71. <if test="msgToId != null">
  72. AND msg_to_id = #{msgToId ,jdbcType=BIGINT}
  73. </if>
  74. </update>
  75. <!--删除Delete-->
  76. <update id="delete" parameterType="java.util.Map">
  77. UPDATE msg_to
  78. <trim suffixOverrides=",">
  79. <set>
  80. <if test="deletedFlag != null">
  81. deleted_flag = #{deletedFlag,jdbcType=BIGINT},
  82. </if>
  83. <if test="deletedTime != null">
  84. deleted_time = #{deletedTime,jdbcType=VARCHAR},
  85. </if>
  86. <if test="deletedBy != null">
  87. deleted_by = #{deletedBy,jdbcType=BIGINT},
  88. </if>
  89. </set>
  90. </trim>
  91. WHERE 1 =1
  92. <if test="ocId != null">
  93. AND oc_id = #{ocId ,jdbcType=BIGINT}
  94. </if>
  95. <if test="msgId != null">
  96. AND msg_id = #{ocId ,jdbcType=BIGINT}
  97. </if>
  98. </update>
  99. </mapper>