MsgMapper.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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.jsh.erp.datasource.mappers.MsgMapper">
  4. <resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Msg">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="msg_title" jdbcType="VARCHAR" property="msgTitle" />
  7. <result column="msg_content" jdbcType="VARCHAR" property="msgContent" />
  8. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  9. <result column="type" jdbcType="VARCHAR" property="type" />
  10. <result column="user_id" jdbcType="BIGINT" property="userId" />
  11. <result column="status" jdbcType="VARCHAR" property="status" />
  12. <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
  13. <result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
  14. </resultMap>
  15. <sql id="Example_Where_Clause">
  16. <where>
  17. <foreach collection="oredCriteria" item="criteria" separator="or">
  18. <if test="criteria.valid">
  19. <trim prefix="(" prefixOverrides="and" suffix=")">
  20. <foreach collection="criteria.criteria" item="criterion">
  21. <choose>
  22. <when test="criterion.noValue">
  23. and ${criterion.condition}
  24. </when>
  25. <when test="criterion.singleValue">
  26. and ${criterion.condition} #{criterion.value}
  27. </when>
  28. <when test="criterion.betweenValue">
  29. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  30. </when>
  31. <when test="criterion.listValue">
  32. and ${criterion.condition}
  33. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  34. #{listItem}
  35. </foreach>
  36. </when>
  37. </choose>
  38. </foreach>
  39. </trim>
  40. </if>
  41. </foreach>
  42. </where>
  43. </sql>
  44. <sql id="Update_By_Example_Where_Clause">
  45. <where>
  46. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  47. <if test="criteria.valid">
  48. <trim prefix="(" prefixOverrides="and" suffix=")">
  49. <foreach collection="criteria.criteria" item="criterion">
  50. <choose>
  51. <when test="criterion.noValue">
  52. and ${criterion.condition}
  53. </when>
  54. <when test="criterion.singleValue">
  55. and ${criterion.condition} #{criterion.value}
  56. </when>
  57. <when test="criterion.betweenValue">
  58. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  59. </when>
  60. <when test="criterion.listValue">
  61. and ${criterion.condition}
  62. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  63. #{listItem}
  64. </foreach>
  65. </when>
  66. </choose>
  67. </foreach>
  68. </trim>
  69. </if>
  70. </foreach>
  71. </where>
  72. </sql>
  73. <sql id="Base_Column_List">
  74. id, msg_title, msg_content, create_time, type, user_id, status, tenant_id, delete_Flag
  75. </sql>
  76. <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.MsgExample" resultMap="BaseResultMap">
  77. select
  78. <if test="distinct">
  79. distinct
  80. </if>
  81. <include refid="Base_Column_List" />
  82. from jsh_msg
  83. <if test="_parameter != null">
  84. <include refid="Example_Where_Clause" />
  85. </if>
  86. <if test="orderByClause != null">
  87. order by ${orderByClause}
  88. </if>
  89. </select>
  90. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  91. select
  92. <include refid="Base_Column_List" />
  93. from jsh_msg
  94. where id = #{id,jdbcType=BIGINT}
  95. </select>
  96. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  97. delete from jsh_msg
  98. where id = #{id,jdbcType=BIGINT}
  99. </delete>
  100. <delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.MsgExample">
  101. delete from jsh_msg
  102. <if test="_parameter != null">
  103. <include refid="Example_Where_Clause" />
  104. </if>
  105. </delete>
  106. <insert id="insert" parameterType="com.jsh.erp.datasource.entities.Msg">
  107. insert into jsh_msg (id, msg_title, msg_content,
  108. create_time, type, user_id,
  109. status, tenant_id, delete_Flag
  110. )
  111. values (#{id,jdbcType=BIGINT}, #{msgTitle,jdbcType=VARCHAR}, #{msgContent,jdbcType=VARCHAR},
  112. #{createTime,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT},
  113. #{status,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
  114. )
  115. </insert>
  116. <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Msg">
  117. insert into jsh_msg
  118. <trim prefix="(" suffix=")" suffixOverrides=",">
  119. <if test="id != null">
  120. id,
  121. </if>
  122. <if test="msgTitle != null">
  123. msg_title,
  124. </if>
  125. <if test="msgContent != null">
  126. msg_content,
  127. </if>
  128. <if test="createTime != null">
  129. create_time,
  130. </if>
  131. <if test="type != null">
  132. type,
  133. </if>
  134. <if test="userId != null">
  135. user_id,
  136. </if>
  137. <if test="status != null">
  138. status,
  139. </if>
  140. <if test="tenantId != null">
  141. tenant_id,
  142. </if>
  143. <if test="deleteFlag != null">
  144. delete_Flag,
  145. </if>
  146. </trim>
  147. <trim prefix="values (" suffix=")" suffixOverrides=",">
  148. <if test="id != null">
  149. #{id,jdbcType=BIGINT},
  150. </if>
  151. <if test="msgTitle != null">
  152. #{msgTitle,jdbcType=VARCHAR},
  153. </if>
  154. <if test="msgContent != null">
  155. #{msgContent,jdbcType=VARCHAR},
  156. </if>
  157. <if test="createTime != null">
  158. #{createTime,jdbcType=TIMESTAMP},
  159. </if>
  160. <if test="type != null">
  161. #{type,jdbcType=VARCHAR},
  162. </if>
  163. <if test="userId != null">
  164. #{userId,jdbcType=BIGINT},
  165. </if>
  166. <if test="status != null">
  167. #{status,jdbcType=VARCHAR},
  168. </if>
  169. <if test="tenantId != null">
  170. #{tenantId,jdbcType=BIGINT},
  171. </if>
  172. <if test="deleteFlag != null">
  173. #{deleteFlag,jdbcType=VARCHAR},
  174. </if>
  175. </trim>
  176. </insert>
  177. <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.MsgExample" resultType="java.lang.Long">
  178. select count(*) from jsh_msg
  179. <if test="_parameter != null">
  180. <include refid="Example_Where_Clause" />
  181. </if>
  182. </select>
  183. <update id="updateByExampleSelective" parameterType="map">
  184. update jsh_msg
  185. <set>
  186. <if test="record.id != null">
  187. id = #{record.id,jdbcType=BIGINT},
  188. </if>
  189. <if test="record.msgTitle != null">
  190. msg_title = #{record.msgTitle,jdbcType=VARCHAR},
  191. </if>
  192. <if test="record.msgContent != null">
  193. msg_content = #{record.msgContent,jdbcType=VARCHAR},
  194. </if>
  195. <if test="record.createTime != null">
  196. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  197. </if>
  198. <if test="record.type != null">
  199. type = #{record.type,jdbcType=VARCHAR},
  200. </if>
  201. <if test="record.userId != null">
  202. user_id = #{record.userId,jdbcType=BIGINT},
  203. </if>
  204. <if test="record.status != null">
  205. status = #{record.status,jdbcType=VARCHAR},
  206. </if>
  207. <if test="record.tenantId != null">
  208. tenant_id = #{record.tenantId,jdbcType=BIGINT},
  209. </if>
  210. <if test="record.deleteFlag != null">
  211. delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
  212. </if>
  213. </set>
  214. <if test="_parameter != null">
  215. <include refid="Update_By_Example_Where_Clause" />
  216. </if>
  217. </update>
  218. <update id="updateByExample" parameterType="map">
  219. update jsh_msg
  220. set id = #{record.id,jdbcType=BIGINT},
  221. msg_title = #{record.msgTitle,jdbcType=VARCHAR},
  222. msg_content = #{record.msgContent,jdbcType=VARCHAR},
  223. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  224. type = #{record.type,jdbcType=VARCHAR},
  225. user_id = #{record.userId,jdbcType=BIGINT},
  226. status = #{record.status,jdbcType=VARCHAR},
  227. tenant_id = #{record.tenantId,jdbcType=BIGINT},
  228. delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
  229. <if test="_parameter != null">
  230. <include refid="Update_By_Example_Where_Clause" />
  231. </if>
  232. </update>
  233. <update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.Msg">
  234. update jsh_msg
  235. <set>
  236. <if test="msgTitle != null">
  237. msg_title = #{msgTitle,jdbcType=VARCHAR},
  238. </if>
  239. <if test="msgContent != null">
  240. msg_content = #{msgContent,jdbcType=VARCHAR},
  241. </if>
  242. <if test="createTime != null">
  243. create_time = #{createTime,jdbcType=TIMESTAMP},
  244. </if>
  245. <if test="type != null">
  246. type = #{type,jdbcType=VARCHAR},
  247. </if>
  248. <if test="userId != null">
  249. user_id = #{userId,jdbcType=BIGINT},
  250. </if>
  251. <if test="status != null">
  252. status = #{status,jdbcType=VARCHAR},
  253. </if>
  254. <if test="tenantId != null">
  255. tenant_id = #{tenantId,jdbcType=BIGINT},
  256. </if>
  257. <if test="deleteFlag != null">
  258. delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
  259. </if>
  260. </set>
  261. where id = #{id,jdbcType=BIGINT}
  262. </update>
  263. <update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.Msg">
  264. update jsh_msg
  265. set msg_title = #{msgTitle,jdbcType=VARCHAR},
  266. msg_content = #{msgContent,jdbcType=VARCHAR},
  267. create_time = #{createTime,jdbcType=TIMESTAMP},
  268. type = #{type,jdbcType=VARCHAR},
  269. user_id = #{userId,jdbcType=BIGINT},
  270. status = #{status,jdbcType=VARCHAR},
  271. tenant_id = #{tenantId,jdbcType=BIGINT},
  272. delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
  273. where id = #{id,jdbcType=BIGINT}
  274. </update>
  275. </mapper>