OutsourceOrganizationMapper.xml 16 KB

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