OutsourceOrganizationMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  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.goafanti.common.dao.OutsourceOrganizationMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.OutsourceOrganization">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Tue Jun 18 08:19:20 CST 2019.
  9. -->
  10. <id column="id" jdbcType="INTEGER" property="id" />
  11. <result column="name" jdbcType="VARCHAR" property="name" />
  12. <result column="contacts" jdbcType="VARCHAR" property="contacts" />
  13. <result column="contacts_mobile" jdbcType="VARCHAR" property="contactsMobile" />
  14. <result column="province" jdbcType="INTEGER" property="province" />
  15. <result column="city" jdbcType="INTEGER" property="city" />
  16. <result column="area" jdbcType="INTEGER" property="area" />
  17. <result column="address" jdbcType="VARCHAR" property="address" />
  18. <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  19. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  20. <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
  21. </resultMap>
  22. <sql id="Example_Where_Clause">
  23. <!--
  24. WARNING - @mbg.generated
  25. This element is automatically generated by MyBatis Generator, do not modify.
  26. This element was generated on Tue Jun 18 08:19:20 CST 2019.
  27. -->
  28. <where>
  29. <foreach collection="oredCriteria" item="criteria" separator="or">
  30. <if test="criteria.valid">
  31. <trim prefix="(" prefixOverrides="and" suffix=")">
  32. <foreach collection="criteria.criteria" item="criterion">
  33. <choose>
  34. <when test="criterion.noValue">
  35. and ${criterion.condition}
  36. </when>
  37. <when test="criterion.singleValue">
  38. and ${criterion.condition} #{criterion.value}
  39. </when>
  40. <when test="criterion.betweenValue">
  41. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  42. </when>
  43. <when test="criterion.listValue">
  44. and ${criterion.condition}
  45. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  46. #{listItem}
  47. </foreach>
  48. </when>
  49. </choose>
  50. </foreach>
  51. </trim>
  52. </if>
  53. </foreach>
  54. </where>
  55. </sql>
  56. <sql id="Update_By_Example_Where_Clause">
  57. <!--
  58. WARNING - @mbg.generated
  59. This element is automatically generated by MyBatis Generator, do not modify.
  60. This element was generated on Tue Jun 18 08:19:20 CST 2019.
  61. -->
  62. <where>
  63. <foreach collection="example.oredCriteria" item="criteria" separator="or">
  64. <if test="criteria.valid">
  65. <trim prefix="(" prefixOverrides="and" suffix=")">
  66. <foreach collection="criteria.criteria" item="criterion">
  67. <choose>
  68. <when test="criterion.noValue">
  69. and ${criterion.condition}
  70. </when>
  71. <when test="criterion.singleValue">
  72. and ${criterion.condition} #{criterion.value}
  73. </when>
  74. <when test="criterion.betweenValue">
  75. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  76. </when>
  77. <when test="criterion.listValue">
  78. and ${criterion.condition}
  79. <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
  80. #{listItem}
  81. </foreach>
  82. </when>
  83. </choose>
  84. </foreach>
  85. </trim>
  86. </if>
  87. </foreach>
  88. </where>
  89. </sql>
  90. <sql id="Base_Column_List">
  91. <!--
  92. WARNING - @mbg.generated
  93. This element is automatically generated by MyBatis Generator, do not modify.
  94. This element was generated on Tue Jun 18 08:19:20 CST 2019.
  95. -->
  96. id, name, contacts, contacts_mobile, province, city, area, address, remarks, create_time,
  97. order_no
  98. </sql>
  99. <select id="selectByExample" parameterType="com.goafanti.common.model.OutsourceOrganizationExample" resultMap="BaseResultMap">
  100. <!--
  101. WARNING - @mbg.generated
  102. This element is automatically generated by MyBatis Generator, do not modify.
  103. This element was generated on Tue Jun 18 08:19:20 CST 2019.
  104. -->
  105. select
  106. <if test="distinct">
  107. distinct
  108. </if>
  109. <include refid="Base_Column_List" />
  110. from outsource_organization
  111. <if test="_parameter != null">
  112. <include refid="Example_Where_Clause" />
  113. </if>
  114. <if test="orderByClause != null">
  115. order by ${orderByClause}
  116. </if>
  117. </select>
  118. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  119. <!--
  120. WARNING - @mbg.generated
  121. This element is automatically generated by MyBatis Generator, do not modify.
  122. This element was generated on Tue Jun 18 08:19:20 CST 2019.
  123. -->
  124. select
  125. <include refid="Base_Column_List" />
  126. from outsource_organization
  127. where id = #{id,jdbcType=INTEGER}
  128. </select>
  129. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  130. <!--
  131. WARNING - @mbg.generated
  132. This element is automatically generated by MyBatis Generator, do not modify.
  133. This element was generated on Tue Jun 18 08:19:20 CST 2019.
  134. -->
  135. delete from outsource_organization
  136. where id = #{id,jdbcType=INTEGER}
  137. </delete>
  138. <delete id="deleteByExample" parameterType="com.goafanti.common.model.OutsourceOrganizationExample">
  139. <!--
  140. WARNING - @mbg.generated
  141. This element is automatically generated by MyBatis Generator, do not modify.
  142. This element was generated on Tue Jun 18 08:19:20 CST 2019.
  143. -->
  144. delete from outsource_organization
  145. <if test="_parameter != null">
  146. <include refid="Example_Where_Clause" />
  147. </if>
  148. </delete>
  149. <insert id="insert" parameterType="com.goafanti.common.model.OutsourceOrganization">
  150. <!--
  151. WARNING - @mbg.generated
  152. This element is automatically generated by MyBatis Generator, do not modify.
  153. This element was generated on Tue Jun 18 08:19:20 CST 2019.
  154. -->
  155. insert into outsource_organization (id, name, contacts,
  156. contacts_mobile, province, city,
  157. area, address, remarks,
  158. create_time, order_no)
  159. values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR},
  160. #{contactsMobile,jdbcType=VARCHAR}, #{province,jdbcType=INTEGER}, #{city,jdbcType=INTEGER},
  161. #{area,jdbcType=INTEGER}, #{address,jdbcType=VARCHAR}, #{remarks,jdbcType=VARCHAR},
  162. #{createTime,jdbcType=TIMESTAMP}, #{orderNo,jdbcType=VARCHAR})
  163. </insert>
  164. <insert id="insertSelective" parameterType="com.goafanti.common.model.OutsourceOrganization">
  165. <!--
  166. WARNING - @mbg.generated
  167. This element is automatically generated by MyBatis Generator, do not modify.
  168. This element was generated on Tue Jun 18 08:19:20 CST 2019.
  169. -->
  170. insert into outsource_organization
  171. <trim prefix="(" suffix=")" suffixOverrides=",">
  172. <if test="id != null">
  173. id,
  174. </if>
  175. <if test="name != null">
  176. name,
  177. </if>
  178. <if test="contacts != null">
  179. contacts,
  180. </if>
  181. <if test="contactsMobile != null">
  182. contacts_mobile,
  183. </if>
  184. <if test="province != null">
  185. province,
  186. </if>
  187. <if test="city != null">
  188. city,
  189. </if>
  190. <if test="area != null">
  191. area,
  192. </if>
  193. <if test="address != null">
  194. address,
  195. </if>
  196. <if test="remarks != null">
  197. remarks,
  198. </if>
  199. <if test="createTime != null">
  200. create_time,
  201. </if>
  202. <if test="orderNo != null">
  203. order_no,
  204. </if>
  205. </trim>
  206. <trim prefix="values (" suffix=")" suffixOverrides=",">
  207. <if test="id != null">
  208. #{id,jdbcType=INTEGER},
  209. </if>
  210. <if test="name != null">
  211. #{name,jdbcType=VARCHAR},
  212. </if>
  213. <if test="contacts != null">
  214. #{contacts,jdbcType=VARCHAR},
  215. </if>
  216. <if test="contactsMobile != null">
  217. #{contactsMobile,jdbcType=VARCHAR},
  218. </if>
  219. <if test="province != null">
  220. #{province,jdbcType=INTEGER},
  221. </if>
  222. <if test="city != null">
  223. #{city,jdbcType=INTEGER},
  224. </if>
  225. <if test="area != null">
  226. #{area,jdbcType=INTEGER},
  227. </if>
  228. <if test="address != null">
  229. #{address,jdbcType=VARCHAR},
  230. </if>
  231. <if test="remarks != null">
  232. #{remarks,jdbcType=VARCHAR},
  233. </if>
  234. <if test="createTime != null">
  235. #{createTime,jdbcType=TIMESTAMP},
  236. </if>
  237. <if test="orderNo != null">
  238. #{orderNo,jdbcType=VARCHAR},
  239. </if>
  240. </trim>
  241. </insert>
  242. <select id="countByExample" parameterType="com.goafanti.common.model.OutsourceOrganizationExample" resultType="java.lang.Long">
  243. <!--
  244. WARNING - @mbg.generated
  245. This element is automatically generated by MyBatis Generator, do not modify.
  246. This element was generated on Tue Jun 18 08:19:20 CST 2019.
  247. -->
  248. select count(*) from outsource_organization
  249. <if test="_parameter != null">
  250. <include refid="Example_Where_Clause" />
  251. </if>
  252. </select>
  253. <update id="updateByExampleSelective" parameterType="map">
  254. <!--
  255. WARNING - @mbg.generated
  256. This element is automatically generated by MyBatis Generator, do not modify.
  257. This element was generated on Tue Jun 18 08:19:20 CST 2019.
  258. -->
  259. update outsource_organization
  260. <set>
  261. <if test="record.id != null">
  262. id = #{record.id,jdbcType=INTEGER},
  263. </if>
  264. <if test="record.name != null">
  265. name = #{record.name,jdbcType=VARCHAR},
  266. </if>
  267. <if test="record.contacts != null">
  268. contacts = #{record.contacts,jdbcType=VARCHAR},
  269. </if>
  270. <if test="record.contactsMobile != null">
  271. contacts_mobile = #{record.contactsMobile,jdbcType=VARCHAR},
  272. </if>
  273. <if test="record.province != null">
  274. province = #{record.province,jdbcType=INTEGER},
  275. </if>
  276. <if test="record.city != null">
  277. city = #{record.city,jdbcType=INTEGER},
  278. </if>
  279. <if test="record.area != null">
  280. area = #{record.area,jdbcType=INTEGER},
  281. </if>
  282. <if test="record.address != null">
  283. address = #{record.address,jdbcType=VARCHAR},
  284. </if>
  285. <if test="record.remarks != null">
  286. remarks = #{record.remarks,jdbcType=VARCHAR},
  287. </if>
  288. <if test="record.createTime != null">
  289. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  290. </if>
  291. <if test="record.orderNo != null">
  292. order_no = #{record.orderNo,jdbcType=VARCHAR},
  293. </if>
  294. </set>
  295. <if test="_parameter != null">
  296. <include refid="Update_By_Example_Where_Clause" />
  297. </if>
  298. </update>
  299. <update id="updateByExample" parameterType="map">
  300. <!--
  301. WARNING - @mbg.generated
  302. This element is automatically generated by MyBatis Generator, do not modify.
  303. This element was generated on Tue Jun 18 08:19:20 CST 2019.
  304. -->
  305. update outsource_organization
  306. set id = #{record.id,jdbcType=INTEGER},
  307. name = #{record.name,jdbcType=VARCHAR},
  308. contacts = #{record.contacts,jdbcType=VARCHAR},
  309. contacts_mobile = #{record.contactsMobile,jdbcType=VARCHAR},
  310. province = #{record.province,jdbcType=INTEGER},
  311. city = #{record.city,jdbcType=INTEGER},
  312. area = #{record.area,jdbcType=INTEGER},
  313. address = #{record.address,jdbcType=VARCHAR},
  314. remarks = #{record.remarks,jdbcType=VARCHAR},
  315. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  316. order_no = #{record.orderNo,jdbcType=VARCHAR}
  317. <if test="_parameter != null">
  318. <include refid="Update_By_Example_Where_Clause" />
  319. </if>
  320. </update>
  321. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.OutsourceOrganization">
  322. <!--
  323. WARNING - @mbg.generated
  324. This element is automatically generated by MyBatis Generator, do not modify.
  325. This element was generated on Tue Jun 18 08:19:20 CST 2019.
  326. -->
  327. update outsource_organization
  328. <set>
  329. <if test="name != null">
  330. name = #{name,jdbcType=VARCHAR},
  331. </if>
  332. <if test="contacts != null">
  333. contacts = #{contacts,jdbcType=VARCHAR},
  334. </if>
  335. <if test="contactsMobile != null">
  336. contacts_mobile = #{contactsMobile,jdbcType=VARCHAR},
  337. </if>
  338. <if test="province != null">
  339. province = #{province,jdbcType=INTEGER},
  340. </if>
  341. <if test="city != null">
  342. city = #{city,jdbcType=INTEGER},
  343. </if>
  344. <if test="area != null">
  345. area = #{area,jdbcType=INTEGER},
  346. </if>
  347. <if test="address != null">
  348. address = #{address,jdbcType=VARCHAR},
  349. </if>
  350. <if test="remarks != null">
  351. remarks = #{remarks,jdbcType=VARCHAR},
  352. </if>
  353. <if test="createTime != null">
  354. create_time = #{createTime,jdbcType=TIMESTAMP},
  355. </if>
  356. <if test="orderNo != null">
  357. order_no = #{orderNo,jdbcType=VARCHAR},
  358. </if>
  359. </set>
  360. where id = #{id,jdbcType=INTEGER}
  361. </update>
  362. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.OutsourceOrganization">
  363. <!--
  364. WARNING - @mbg.generated
  365. This element is automatically generated by MyBatis Generator, do not modify.
  366. This element was generated on Tue Jun 18 08:19:20 CST 2019.
  367. -->
  368. update outsource_organization
  369. set name = #{name,jdbcType=VARCHAR},
  370. contacts = #{contacts,jdbcType=VARCHAR},
  371. contacts_mobile = #{contactsMobile,jdbcType=VARCHAR},
  372. province = #{province,jdbcType=INTEGER},
  373. city = #{city,jdbcType=INTEGER},
  374. area = #{area,jdbcType=INTEGER},
  375. address = #{address,jdbcType=VARCHAR},
  376. remarks = #{remarks,jdbcType=VARCHAR},
  377. create_time = #{createTime,jdbcType=TIMESTAMP},
  378. order_no = #{orderNo,jdbcType=VARCHAR}
  379. where id = #{id,jdbcType=INTEGER}
  380. </update>
  381. <select id="selectOutsourceOrg" resultType="com.goafanti.order.bo.OutsourceOrganizationBo">
  382. select id, name, contacts, contacts_mobile as contactsMobile, province, city, area, address, remarks, create_time as createTime,
  383. date_format(create_time,'%Y-%m-%d %H:%i:%S') as createTimes, order_no as orderNo from outsource_organization
  384. where order_no=#{orderNo,jdbcType=VARCHAR}
  385. </select>
  386. </mapper>