明晋临时用仓库程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UserWareMapper.xml 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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.th.demo.mapping.maint.UserWareMapper" >
  4. <resultMap id="BaseResultMap" type="com.th.demo.model.maint.UserWare" >
  5. <id column="id" property="id" jdbcType="VARCHAR" />
  6. <result column="user_id" property="userId" jdbcType="VARCHAR" />
  7. <result column="ware_id" property="wareId" jdbcType="VARCHAR" />
  8. <result column="add_id" property="addId" jdbcType="VARCHAR" />
  9. <result column="add_time" property="addTime" jdbcType="TIMESTAMP" />
  10. <result column="modify_id" property="modifyId" jdbcType="VARCHAR" />
  11. <result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP" />
  12. <result column="cancel_id" property="cancelId" jdbcType="VARCHAR" />
  13. <result column="cancel_time" property="cancelTime" jdbcType="TIMESTAMP" />
  14. <result column="cancel_flag" property="cancelFlag" jdbcType="VARCHAR" />
  15. <result column="belong_id" property="belongId" jdbcType="VARCHAR" />
  16. </resultMap>
  17. <sql id="Base_Column_List" >
  18. id, user_id, ware_id, add_id, add_time, modify_id, modify_time, cancel_id, cancel_time,
  19. cancel_flag, belong_id
  20. </sql>
  21. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
  22. select
  23. <include refid="Base_Column_List" />
  24. from t_maint_userware
  25. where id = #{id,jdbcType=VARCHAR}
  26. </select>
  27. <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
  28. delete from t_maint_userware
  29. where id = #{id,jdbcType=VARCHAR}
  30. </delete>
  31. <insert id="insert" parameterType="com.th.demo.model.maint.UserWare" >
  32. <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.String">
  33. SELECT REPLACE(UUID(),'-','') as id from dual
  34. </selectKey>
  35. insert into t_maint_userware (id, user_id, ware_id,
  36. add_id, add_time, modify_id,
  37. modify_time, cancel_id, cancel_time,
  38. cancel_flag, belong_id)
  39. values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{wareId,jdbcType=VARCHAR},
  40. #{addId,jdbcType=VARCHAR}, #{addTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=VARCHAR},
  41. #{modifyTime,jdbcType=TIMESTAMP}, #{cancelId,jdbcType=VARCHAR}, #{cancelTime,jdbcType=TIMESTAMP},
  42. #{cancelFlag,jdbcType=VARCHAR}, #{belongId,jdbcType=VARCHAR})
  43. </insert>
  44. <insert id="insertSelective" parameterType="com.th.demo.model.maint.UserWare" >
  45. insert into t_maint_userware
  46. <trim prefix="(" suffix=")" suffixOverrides="," >
  47. <if test="id != null" >
  48. id,
  49. </if>
  50. <if test="userId != null" >
  51. user_id,
  52. </if>
  53. <if test="wareId != null" >
  54. ware_id,
  55. </if>
  56. <if test="addId != null" >
  57. add_id,
  58. </if>
  59. <if test="addTime != null" >
  60. add_time,
  61. </if>
  62. <if test="modifyId != null" >
  63. modify_id,
  64. </if>
  65. <if test="modifyTime != null" >
  66. modify_time,
  67. </if>
  68. <if test="cancelId != null" >
  69. cancel_id,
  70. </if>
  71. <if test="cancelTime != null" >
  72. cancel_time,
  73. </if>
  74. <if test="cancelFlag != null" >
  75. cancel_flag,
  76. </if>
  77. <if test="belongId != null" >
  78. belong_id,
  79. </if>
  80. </trim>
  81. <trim prefix="values (" suffix=")" suffixOverrides="," >
  82. <if test="id != null" >
  83. #{id,jdbcType=VARCHAR},
  84. </if>
  85. <if test="userId != null" >
  86. #{userId,jdbcType=VARCHAR},
  87. </if>
  88. <if test="wareId != null" >
  89. #{wareId,jdbcType=VARCHAR},
  90. </if>
  91. <if test="addId != null" >
  92. #{addId,jdbcType=VARCHAR},
  93. </if>
  94. <if test="addTime != null" >
  95. #{addTime,jdbcType=TIMESTAMP},
  96. </if>
  97. <if test="modifyId != null" >
  98. #{modifyId,jdbcType=VARCHAR},
  99. </if>
  100. <if test="modifyTime != null" >
  101. #{modifyTime,jdbcType=TIMESTAMP},
  102. </if>
  103. <if test="cancelId != null" >
  104. #{cancelId,jdbcType=VARCHAR},
  105. </if>
  106. <if test="cancelTime != null" >
  107. #{cancelTime,jdbcType=TIMESTAMP},
  108. </if>
  109. <if test="cancelFlag != null" >
  110. #{cancelFlag,jdbcType=VARCHAR},
  111. </if>
  112. <if test="belongId != null" >
  113. #{belongId,jdbcType=VARCHAR},
  114. </if>
  115. </trim>
  116. </insert>
  117. <update id="updateByPrimaryKeySelective" parameterType="com.th.demo.model.maint.UserWare" >
  118. update t_maint_userware
  119. <set >
  120. <if test="userId != null" >
  121. user_id = #{userId,jdbcType=VARCHAR},
  122. </if>
  123. <if test="wareId != null" >
  124. ware_id = #{wareId,jdbcType=VARCHAR},
  125. </if>
  126. <if test="addId != null" >
  127. add_id = #{addId,jdbcType=VARCHAR},
  128. </if>
  129. <if test="addTime != null" >
  130. add_time = #{addTime,jdbcType=TIMESTAMP},
  131. </if>
  132. <if test="modifyId != null" >
  133. modify_id = #{modifyId,jdbcType=VARCHAR},
  134. </if>
  135. <if test="modifyTime != null" >
  136. modify_time = #{modifyTime,jdbcType=TIMESTAMP},
  137. </if>
  138. <if test="cancelId != null" >
  139. cancel_id = #{cancelId,jdbcType=VARCHAR},
  140. </if>
  141. <if test="cancelTime != null" >
  142. cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
  143. </if>
  144. <if test="cancelFlag != null" >
  145. cancel_flag = #{cancelFlag,jdbcType=VARCHAR},
  146. </if>
  147. <if test="belongId != null" >
  148. belong_id = #{belongId,jdbcType=VARCHAR},
  149. </if>
  150. </set>
  151. where id = #{id,jdbcType=VARCHAR}
  152. </update>
  153. <update id="updateByPrimaryKey" parameterType="com.th.demo.model.maint.UserWare" >
  154. update t_maint_userware
  155. set user_id = #{userId,jdbcType=VARCHAR},
  156. ware_id = #{wareId,jdbcType=VARCHAR},
  157. add_id = #{addId,jdbcType=VARCHAR},
  158. add_time = #{addTime,jdbcType=TIMESTAMP},
  159. modify_id = #{modifyId,jdbcType=VARCHAR},
  160. modify_time = #{modifyTime,jdbcType=TIMESTAMP},
  161. cancel_id = #{cancelId,jdbcType=VARCHAR},
  162. cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
  163. cancel_flag = #{cancelFlag,jdbcType=VARCHAR},
  164. belong_id = #{belongId,jdbcType=VARCHAR}
  165. where id = #{id,jdbcType=VARCHAR}
  166. </update>
  167. <select id="selectByUserIdForUserWare" resultType="java.lang.String" >
  168. select
  169. ware_id
  170. from t_maint_userware
  171. where user_id = #{param1,jdbcType=VARCHAR}
  172. and belong_id = #{param2,jdbcType=VARCHAR}
  173. </select>
  174. <delete id="deleteByUserIdBelongId" parameterType="java.lang.String" >
  175. delete from t_maint_userware
  176. where user_id = #{param1,jdbcType=VARCHAR}
  177. and belong_id = #{param2,jdbcType=VARCHAR}
  178. </delete>
  179. </mapper>