6a95e27d6ea2875da757ca8b0faa25cac3fded7d.svn-base 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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="cn.com.goldenwater.dcproj.dao.ExtWeiXinMessageDao">
  4. <resultMap type="cn.com.goldenwater.dcproj.model.ExtWeiXinMessage" id="extWeiXinMessageResultMap">
  5. <result property="id" column="ID"/>
  6. <result property="wcId" column="WC_ID"/>
  7. <result property="account" column="ACCOUNT"/>
  8. <result property="messageType" column="MESSAGE_TYPE"/>
  9. <result property="fromUser" column="FROM_USER"/>
  10. <result property="fromGroup" column="FROM_GROUP"/>
  11. <result property="toUser" column="TO_USER"/>
  12. <result property="msgId" column="MSG_ID"/>
  13. <result property="newMsgId" column="NEW_MSG_ID"/>
  14. <result property="tm" column="TM"/>
  15. <result property="content" column="CONTENT"/>
  16. <result property="self" column="SELF"/>
  17. <result property="isDeal" column="IS_DEAL"/>
  18. <result property="intm" column="INTM"/>
  19. <result property="uptm" column="UPTM"/>
  20. <result property="dataStat" column="DATA_STAT"/>
  21. </resultMap>
  22. <sql id="table_columns">
  23. ID,
  24. WC_ID,
  25. ACCOUNT,
  26. MESSAGE_TYPE,
  27. FROM_USER,
  28. FROM_GROUP,
  29. TO_USER,
  30. MSG_ID,
  31. NEW_MSG_ID,
  32. TM,
  33. CONTENT,
  34. SELF,
  35. IS_DEAL,
  36. INTM,
  37. UPTM,
  38. DATA_STAT
  39. </sql>
  40. <sql id="entity_properties">
  41. #{id},
  42. #{wcId},
  43. #{account},
  44. #{messageType},
  45. #{fromUser},
  46. #{fromGroup},
  47. #{toUser},
  48. #{msgId},
  49. #{newMsgId},
  50. #{tm},
  51. #{content},
  52. #{self},
  53. #{isDeal},
  54. #{intm},
  55. #{uptm},
  56. #{dataStat}
  57. </sql>
  58. <!-- 使用like用法:columnName like concat('%',#columnName#,'%') -->
  59. <sql id="page_where">
  60. <trim prefix="where" prefixOverrides="and | or ">
  61. <if test="wcId != null and wcId != ''">and WC_ID = #{wcId}</if>
  62. <if test="account != null and account != ''">and ACCOUNT = #{account}</if>
  63. <if test="messageType != null and messageType != ''">and MESSAGE_TYPE = #{messageType}</if>
  64. <if test="fromUser != null and fromUser != ''">and FROM_USER = #{fromUser}</if>
  65. <if test="fromGroup != null and fromGroup != ''">and FROM_GROUP = #{fromGroup}</if>
  66. <if test="toUser != null and toUser != ''">and TO_USER = #{toUser}</if>
  67. <if test="msgId != null and msgId != ''">and MSG_ID = #{msgId}</if>
  68. <if test="newMsgId != null and newMsgId != ''">and NEW_MSG_ID = #{newMsgId}</if>
  69. <if test="tm != null">and TM = #{tm}</if>
  70. <if test="content != null and content != ''">and CONTENT = #{content}</if>
  71. <if test="self != null and self != ''">and SELF = #{self}</if>
  72. <if test="isDeal != null and isDeal != ''">and IS_DEAL = #{isDeal}</if>
  73. <if test="intm != null">and INTM = #{intm}</if>
  74. <if test="uptm != null">and UPTM = #{uptm}</if>
  75. <if test="dataStat != null and dataStat != ''">and DATA_STAT = #{dataStat}</if>
  76. </trim>
  77. </sql>
  78. <select id="get" resultMap="extWeiXinMessageResultMap" parameterType="String" >
  79. select <include refid="table_columns" /> from EXT_WEI_XIN_MESSAGE where ID = #{id}
  80. </select>
  81. <select id="getBy" resultMap="extWeiXinMessageResultMap">
  82. select <include refid="table_columns" /> from EXT_WEI_XIN_MESSAGE <include refid="page_where" />
  83. </select>
  84. <select id="findAll" resultMap="extWeiXinMessageResultMap">
  85. select <include refid="table_columns" /> from EXT_WEI_XIN_MESSAGE
  86. </select>
  87. <select id="findList" resultMap="extWeiXinMessageResultMap">
  88. select <include refid="table_columns" /> from EXT_WEI_XIN_MESSAGE <include refid="page_where" />
  89. </select>
  90. <select id="selectCount" resultType="int" >
  91. select count(ID) from EXT_WEI_XIN_MESSAGE <include refid="page_where" />
  92. </select>
  93. <insert id="insert" parameterType="cn.com.goldenwater.dcproj.model.ExtWeiXinMessage">
  94. insert into EXT_WEI_XIN_MESSAGE( <include refid="table_columns" /> )
  95. values ( <include refid="entity_properties" /> )
  96. </insert>
  97. <delete id="delete" parameterType="java.lang.String">
  98. update EXT_WEI_XIN_MESSAGE set DATA_STAT='9' where ID = #{id}
  99. </delete>
  100. <delete id="deleteBy" parameterType="cn.com.goldenwater.dcproj.model.ExtWeiXinMessage">
  101. delete from EXT_WEI_XIN_MESSAGE <include refid="page_where" />
  102. </delete>
  103. <update id="deleteInFlag" parameterType="java.lang.String">
  104. update EXT_WEI_XIN_MESSAGE set flag_valid = 0 where ID = #{id}
  105. </update>
  106. <update id="update" parameterType="cn.com.goldenwater.dcproj.model.ExtWeiXinMessage">
  107. update EXT_WEI_XIN_MESSAGE
  108. <trim prefix="set" suffixOverrides=",">
  109. <if test="wcId != null and wcId != ''">WC_ID = #{wcId},</if>
  110. <if test="account != null and account != ''">ACCOUNT = #{account},</if>
  111. <if test="messageType != null and messageType != ''">MESSAGE_TYPE = #{messageType},</if>
  112. <if test="fromUser != null and fromUser != ''">FROM_USER = #{fromUser},</if>
  113. <if test="fromGroup != null and fromGroup != ''">FROM_GROUP = #{fromGroup},</if>
  114. <if test="toUser != null and toUser != ''">TO_USER = #{toUser},</if>
  115. <if test="msgId != null and msgId != ''">MSG_ID = #{msgId},</if>
  116. <if test="newMsgId != null and newMsgId != ''">NEW_MSG_ID = #{newMsgId},</if>
  117. <if test="tm != null">TM = #{tm},</if>
  118. <if test="content != null and content != ''">CONTENT = #{content},</if>
  119. <if test="self != null and self != ''">SELF = #{self},</if>
  120. <if test="isDeal != null and isDeal != ''">IS_DEAL = #{isDeal},</if>
  121. <if test="intm != null">INTM = #{intm},</if>
  122. <if test="uptm != null">UPTM = #{uptm},</if>
  123. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  124. </trim>
  125. <where>ID = #{id}</where>
  126. </update>
  127. <update id="updateBy" parameterType="cn.com.goldenwater.dcproj.model.ExtWeiXinMessage">
  128. update EXT_WEI_XIN_MESSAGE
  129. <trim prefix="set" suffixOverrides=",">
  130. <if test="wcId != null and wcId != ''">WC_ID = #{wcId},</if>
  131. <if test="account != null and account != ''">ACCOUNT = #{account},</if>
  132. <if test="messageType != null and messageType != ''">MESSAGE_TYPE = #{messageType},</if>
  133. <if test="fromUser != null and fromUser != ''">FROM_USER = #{fromUser},</if>
  134. <if test="fromGroup != null and fromGroup != ''">FROM_GROUP = #{fromGroup},</if>
  135. <if test="toUser != null and toUser != ''">TO_USER = #{toUser},</if>
  136. <if test="msgId != null and msgId != ''">MSG_ID = #{msgId},</if>
  137. <if test="newMsgId != null and newMsgId != ''">NEW_MSG_ID = #{newMsgId},</if>
  138. <if test="tm != null">TM = #{tm},</if>
  139. <if test="content != null and content != ''">CONTENT = #{content},</if>
  140. <if test="self != null and self != ''">SELF = #{self},</if>
  141. <if test="isDeal != null and isDeal != ''">IS_DEAL = #{isDeal},</if>
  142. <if test="intm != null">INTM = #{intm},</if>
  143. <if test="uptm != null">UPTM = #{uptm},</if>
  144. <if test="dataStat != null and dataStat != ''">DATA_STAT = #{dataStat},</if>
  145. </trim>
  146. <include refid="page_where" />
  147. </update>
  148. <!-- 其他自定义SQL -->
  149. </mapper>