BusinessPlanMapper.xml 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007
  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.chinaitop.depot.business.mapper.BusinessPlanMapper" >
  4. <resultMap id="BaseResultMap" type="com.chinaitop.depot.business.model.BusinessPlan" >
  5. <!--
  6. WARNING - @mbggenerated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Mon Jun 29 18:21:02 CST 2020.
  9. -->
  10. <id column="id" property="id" jdbcType="INTEGER" />
  11. <result column="plan_number" property="planNumber" jdbcType="VARCHAR" />
  12. <result column="plan_title" property="planTitle" jdbcType="VARCHAR" />
  13. <result column="reference_number" property="referenceNumber" jdbcType="VARCHAR" />
  14. <result column="plan_desc" property="planDesc" jdbcType="VARCHAR" />
  15. <result column="execute_type" property="executeType" jdbcType="INTEGER" />
  16. <result column="out_amount" property="outAmount" jdbcType="VARCHAR" />
  17. <result column="in_amount" property="inAmount" jdbcType="VARCHAR" />
  18. <result column="out_total_price" property="outTotalPrice" jdbcType="VARCHAR" />
  19. <result column="in_total_price" property="inTotalPrice" jdbcType="VARCHAR" />
  20. <result column="customer_plan_state" property="customerPlanState" jdbcType="VARCHAR" />
  21. <result column="plan_customer" property="planCustomer" jdbcType="VARCHAR" />
  22. <result column="audit_state" property="auditState" jdbcType="VARCHAR" />
  23. <result column="process_instance_id" property="processInstanceId" jdbcType="VARCHAR" />
  24. <result column="process_definition_id" property="processDefinitionId" jdbcType="VARCHAR" />
  25. <result column="current_approve_path" property="currentApprovePath" jdbcType="VARCHAR" />
  26. <result column="agree_time" property="agreeTime" jdbcType="TIMESTAMP" />
  27. <result column="creater_id" property="createrId" jdbcType="INTEGER" />
  28. <result column="creater" property="creater" jdbcType="VARCHAR" />
  29. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  30. <result column="create_unit" property="createUnit" jdbcType="VARCHAR" />
  31. <result column="org_id" property="orgId" jdbcType="INTEGER" />
  32. <result column="in_application" property="inApplication" jdbcType="INTEGER" />
  33. <result column="total_quantity" property="totalQuantity" jdbcType="VARCHAR" />
  34. <result column="report_date" property="reportDate" jdbcType="TIMESTAMP" />
  35. <result column="send_date" property="sendDate" jdbcType="TIMESTAMP" />
  36. <result column="province_remark" property="provinceRemark" jdbcType="VARCHAR" />
  37. <result column="enterprise_remark" property="enterpriseRemark" jdbcType="VARCHAR" />
  38. <result column="attribute_type" property="attributeType" jdbcType="INTEGER" />
  39. <result column="refuse_reason" property="refuseReason" jdbcType="VARCHAR" />
  40. <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
  41. <result column="kszxrq" property="kszxrq" jdbcType="TIMESTAMP" />
  42. <result column="jzzxrq" property="jzzxrq" jdbcType="TIMESTAMP" />
  43. <result column="jhnd" property="jhnd" jdbcType="VARCHAR" />
  44. </resultMap>
  45. <resultMap id="approvalResultMap" type="com.chinaitop.depot.business.model.vo.BusinessPlanAuditVO" extends="BaseResultMap">
  46. <result column="process_instance_id" property="processInstanceId" jdbcType="VARCHAR" />
  47. <result column="task_id" property="taskId" jdbcType="VARCHAR" />
  48. <result column="result" property="result" jdbcType="VARCHAR" />
  49. <result column="task_name" property="taskName" jdbcType="VARCHAR" />
  50. <result column="auditId" property="auditId" jdbcType="INTEGER" />
  51. <result column="applicationDate" property="applicationDate" jdbcType="VARCHAR" />
  52. <result column="acceptanceType" property="acceptanceType" jdbcType="VARCHAR" />
  53. <result column="house_id" property="houseId" jdbcType="INTEGER" />
  54. <result column="warehouse_id" property="warehouseId" jdbcType="INTEGER" />
  55. </resultMap>
  56. <sql id="Example_Where_Clause" >
  57. <!--
  58. WARNING - @mbggenerated
  59. This element is automatically generated by MyBatis Generator, do not modify.
  60. This element was generated on Mon Jun 29 18:21:02 CST 2020.
  61. -->
  62. <where >
  63. <foreach collection="oredCriteria" item="criteria" separator="or" >
  64. <if test="criteria.valid" >
  65. <trim prefix="(" suffix=")" prefixOverrides="and" >
  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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  80. #{listItem}
  81. </foreach>
  82. </when>
  83. </choose>
  84. </foreach>
  85. </trim>
  86. </if>
  87. </foreach>
  88. </where>
  89. </sql>
  90. <sql id="Update_By_Example_Where_Clause" >
  91. <!--
  92. WARNING - @mbggenerated
  93. This element is automatically generated by MyBatis Generator, do not modify.
  94. This element was generated on Mon Jun 29 18:21:02 CST 2020.
  95. -->
  96. <where >
  97. <foreach collection="example.oredCriteria" item="criteria" separator="or" >
  98. <if test="criteria.valid" >
  99. <trim prefix="(" suffix=")" prefixOverrides="and" >
  100. <foreach collection="criteria.criteria" item="criterion" >
  101. <choose >
  102. <when test="criterion.noValue" >
  103. and ${criterion.condition}
  104. </when>
  105. <when test="criterion.singleValue" >
  106. and ${criterion.condition} #{criterion.value}
  107. </when>
  108. <when test="criterion.betweenValue" >
  109. and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
  110. </when>
  111. <when test="criterion.listValue" >
  112. and ${criterion.condition}
  113. <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
  114. #{listItem}
  115. </foreach>
  116. </when>
  117. </choose>
  118. </foreach>
  119. </trim>
  120. </if>
  121. </foreach>
  122. </where>
  123. </sql>
  124. <sql id="Base_Column_List" >
  125. <!--
  126. WARNING - @mbggenerated
  127. This element is automatically generated by MyBatis Generator, do not modify.
  128. This element was generated on Mon Jun 29 18:21:02 CST 2020.
  129. -->
  130. id, plan_number, plan_title, reference_number, plan_desc, execute_type, out_amount,
  131. in_amount, out_total_price, in_total_price, customer_plan_state, plan_customer, audit_state,
  132. process_instance_id, process_definition_id, current_approve_path, agree_time, creater_id,
  133. creater, create_time, create_unit, org_id, in_application, total_quantity, report_date,
  134. send_date, province_remark, enterprise_remark, attribute_type, refuse_reason, updatetime,
  135. kszxrq, jzzxrq, jhnd
  136. </sql>
  137. <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.business.model.BusinessPlanExample" >
  138. <!--
  139. WARNING - @mbggenerated
  140. This element is automatically generated by MyBatis Generator, do not modify.
  141. This element was generated on Mon Jun 29 18:21:02 CST 2020.
  142. -->
  143. select
  144. <if test="distinct" >
  145. distinct
  146. </if>
  147. <include refid="Base_Column_List" />
  148. from business_plan
  149. <if test="_parameter != null" >
  150. <include refid="Example_Where_Clause" />
  151. </if>
  152. <if test="orderByClause != null" >
  153. order by ${orderByClause}
  154. </if>
  155. </select>
  156. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  157. <!--
  158. WARNING - @mbggenerated
  159. This element is automatically generated by MyBatis Generator, do not modify.
  160. This element was generated on Mon Jun 29 18:21:02 CST 2020.
  161. -->
  162. select
  163. <include refid="Base_Column_List" />
  164. from business_plan
  165. where id = #{id,jdbcType=INTEGER}
  166. </select>
  167. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  168. <!--
  169. WARNING - @mbggenerated
  170. This element is automatically generated by MyBatis Generator, do not modify.
  171. This element was generated on Mon Jun 29 18:21:02 CST 2020.
  172. -->
  173. delete from business_plan
  174. where id = #{id,jdbcType=INTEGER}
  175. </delete>
  176. <delete id="deleteByExample" parameterType="com.chinaitop.depot.business.model.BusinessPlanExample" >
  177. <!--
  178. WARNING - @mbggenerated
  179. This element is automatically generated by MyBatis Generator, do not modify.
  180. This element was generated on Mon Jun 29 18:21:02 CST 2020.
  181. -->
  182. delete from business_plan
  183. <if test="_parameter != null" >
  184. <include refid="Example_Where_Clause" />
  185. </if>
  186. </delete>
  187. <insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.chinaitop.depot.business.model.BusinessPlan" >
  188. <!--
  189. WARNING - @mbggenerated
  190. This element is automatically generated by MyBatis Generator, do not modify.
  191. This element was generated on Mon Jun 29 18:21:02 CST 2020.
  192. -->
  193. insert into business_plan (id, plan_number, plan_title,
  194. reference_number, plan_desc, execute_type,
  195. out_amount, in_amount, out_total_price,
  196. in_total_price, customer_plan_state, plan_customer,
  197. audit_state, process_instance_id, process_definition_id,
  198. current_approve_path, agree_time, creater_id,
  199. creater, create_time, create_unit,
  200. org_id, in_application, total_quantity,
  201. report_date, send_date, province_remark,
  202. enterprise_remark, attribute_type, refuse_reason,
  203. updatetime, kszxrq, jzzxrq,
  204. jhnd)
  205. values (#{id,jdbcType=INTEGER}, #{planNumber,jdbcType=VARCHAR}, #{planTitle,jdbcType=VARCHAR},
  206. #{referenceNumber,jdbcType=VARCHAR}, #{planDesc,jdbcType=VARCHAR}, #{executeType,jdbcType=INTEGER},
  207. #{outAmount,jdbcType=VARCHAR}, #{inAmount,jdbcType=VARCHAR}, #{outTotalPrice,jdbcType=VARCHAR},
  208. #{inTotalPrice,jdbcType=VARCHAR}, #{customerPlanState,jdbcType=VARCHAR}, #{planCustomer,jdbcType=VARCHAR},
  209. #{auditState,jdbcType=VARCHAR}, #{processInstanceId,jdbcType=VARCHAR}, #{processDefinitionId,jdbcType=VARCHAR},
  210. #{currentApprovePath,jdbcType=VARCHAR}, #{agreeTime,jdbcType=TIMESTAMP}, #{createrId,jdbcType=INTEGER},
  211. #{creater,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createUnit,jdbcType=VARCHAR},
  212. #{orgId,jdbcType=INTEGER}, #{inApplication,jdbcType=INTEGER}, #{totalQuantity,jdbcType=VARCHAR},
  213. #{reportDate,jdbcType=TIMESTAMP}, #{sendDate,jdbcType=TIMESTAMP}, #{provinceRemark,jdbcType=VARCHAR},
  214. #{enterpriseRemark,jdbcType=VARCHAR}, #{attributeType,jdbcType=INTEGER}, #{refuseReason,jdbcType=VARCHAR},
  215. #{updatetime,jdbcType=TIMESTAMP}, #{kszxrq,jdbcType=TIMESTAMP}, #{jzzxrq,jdbcType=TIMESTAMP},
  216. #{jhnd,jdbcType=VARCHAR})
  217. </insert>
  218. <insert id="insertSelective" parameterType="com.chinaitop.depot.business.model.BusinessPlan" >
  219. <!--
  220. WARNING - @mbggenerated
  221. This element is automatically generated by MyBatis Generator, do not modify.
  222. This element was generated on Mon Jun 29 18:21:02 CST 2020.
  223. -->
  224. insert into business_plan
  225. <trim prefix="(" suffix=")" suffixOverrides="," >
  226. <if test="id != null" >
  227. id,
  228. </if>
  229. <if test="planNumber != null" >
  230. plan_number,
  231. </if>
  232. <if test="planTitle != null" >
  233. plan_title,
  234. </if>
  235. <if test="referenceNumber != null" >
  236. reference_number,
  237. </if>
  238. <if test="planDesc != null" >
  239. plan_desc,
  240. </if>
  241. <if test="executeType != null" >
  242. execute_type,
  243. </if>
  244. <if test="outAmount != null" >
  245. out_amount,
  246. </if>
  247. <if test="inAmount != null" >
  248. in_amount,
  249. </if>
  250. <if test="outTotalPrice != null" >
  251. out_total_price,
  252. </if>
  253. <if test="inTotalPrice != null" >
  254. in_total_price,
  255. </if>
  256. <if test="customerPlanState != null" >
  257. customer_plan_state,
  258. </if>
  259. <if test="planCustomer != null" >
  260. plan_customer,
  261. </if>
  262. <if test="auditState != null" >
  263. audit_state,
  264. </if>
  265. <if test="processInstanceId != null" >
  266. process_instance_id,
  267. </if>
  268. <if test="processDefinitionId != null" >
  269. process_definition_id,
  270. </if>
  271. <if test="currentApprovePath != null" >
  272. current_approve_path,
  273. </if>
  274. <if test="agreeTime != null" >
  275. agree_time,
  276. </if>
  277. <if test="createrId != null" >
  278. creater_id,
  279. </if>
  280. <if test="creater != null" >
  281. creater,
  282. </if>
  283. <if test="createTime != null" >
  284. create_time,
  285. </if>
  286. <if test="createUnit != null" >
  287. create_unit,
  288. </if>
  289. <if test="orgId != null" >
  290. org_id,
  291. </if>
  292. <if test="inApplication != null" >
  293. in_application,
  294. </if>
  295. <if test="totalQuantity != null" >
  296. total_quantity,
  297. </if>
  298. <if test="reportDate != null" >
  299. report_date,
  300. </if>
  301. <if test="sendDate != null" >
  302. send_date,
  303. </if>
  304. <if test="provinceRemark != null" >
  305. province_remark,
  306. </if>
  307. <if test="enterpriseRemark != null" >
  308. enterprise_remark,
  309. </if>
  310. <if test="attributeType != null" >
  311. attribute_type,
  312. </if>
  313. <if test="refuseReason != null" >
  314. refuse_reason,
  315. </if>
  316. <if test="updatetime != null" >
  317. updatetime,
  318. </if>
  319. <if test="kszxrq != null" >
  320. kszxrq,
  321. </if>
  322. <if test="jzzxrq != null" >
  323. jzzxrq,
  324. </if>
  325. <if test="jhnd != null" >
  326. jhnd,
  327. </if>
  328. </trim>
  329. <trim prefix="values (" suffix=")" suffixOverrides="," >
  330. <if test="id != null" >
  331. #{id,jdbcType=INTEGER},
  332. </if>
  333. <if test="planNumber != null" >
  334. #{planNumber,jdbcType=VARCHAR},
  335. </if>
  336. <if test="planTitle != null" >
  337. #{planTitle,jdbcType=VARCHAR},
  338. </if>
  339. <if test="referenceNumber != null" >
  340. #{referenceNumber,jdbcType=VARCHAR},
  341. </if>
  342. <if test="planDesc != null" >
  343. #{planDesc,jdbcType=VARCHAR},
  344. </if>
  345. <if test="executeType != null" >
  346. #{executeType,jdbcType=INTEGER},
  347. </if>
  348. <if test="outAmount != null" >
  349. #{outAmount,jdbcType=VARCHAR},
  350. </if>
  351. <if test="inAmount != null" >
  352. #{inAmount,jdbcType=VARCHAR},
  353. </if>
  354. <if test="outTotalPrice != null" >
  355. #{outTotalPrice,jdbcType=VARCHAR},
  356. </if>
  357. <if test="inTotalPrice != null" >
  358. #{inTotalPrice,jdbcType=VARCHAR},
  359. </if>
  360. <if test="customerPlanState != null" >
  361. #{customerPlanState,jdbcType=VARCHAR},
  362. </if>
  363. <if test="planCustomer != null" >
  364. #{planCustomer,jdbcType=VARCHAR},
  365. </if>
  366. <if test="auditState != null" >
  367. #{auditState,jdbcType=VARCHAR},
  368. </if>
  369. <if test="processInstanceId != null" >
  370. #{processInstanceId,jdbcType=VARCHAR},
  371. </if>
  372. <if test="processDefinitionId != null" >
  373. #{processDefinitionId,jdbcType=VARCHAR},
  374. </if>
  375. <if test="currentApprovePath != null" >
  376. #{currentApprovePath,jdbcType=VARCHAR},
  377. </if>
  378. <if test="agreeTime != null" >
  379. #{agreeTime,jdbcType=TIMESTAMP},
  380. </if>
  381. <if test="createrId != null" >
  382. #{createrId,jdbcType=INTEGER},
  383. </if>
  384. <if test="creater != null" >
  385. #{creater,jdbcType=VARCHAR},
  386. </if>
  387. <if test="createTime != null" >
  388. #{createTime,jdbcType=TIMESTAMP},
  389. </if>
  390. <if test="createUnit != null" >
  391. #{createUnit,jdbcType=VARCHAR},
  392. </if>
  393. <if test="orgId != null" >
  394. #{orgId,jdbcType=INTEGER},
  395. </if>
  396. <if test="inApplication != null" >
  397. #{inApplication,jdbcType=INTEGER},
  398. </if>
  399. <if test="totalQuantity != null" >
  400. #{totalQuantity,jdbcType=VARCHAR},
  401. </if>
  402. <if test="reportDate != null" >
  403. #{reportDate,jdbcType=TIMESTAMP},
  404. </if>
  405. <if test="sendDate != null" >
  406. #{sendDate,jdbcType=TIMESTAMP},
  407. </if>
  408. <if test="provinceRemark != null" >
  409. #{provinceRemark,jdbcType=VARCHAR},
  410. </if>
  411. <if test="enterpriseRemark != null" >
  412. #{enterpriseRemark,jdbcType=VARCHAR},
  413. </if>
  414. <if test="attributeType != null" >
  415. #{attributeType,jdbcType=INTEGER},
  416. </if>
  417. <if test="refuseReason != null" >
  418. #{refuseReason,jdbcType=VARCHAR},
  419. </if>
  420. <if test="updatetime != null" >
  421. #{updatetime,jdbcType=TIMESTAMP},
  422. </if>
  423. <if test="kszxrq != null" >
  424. #{kszxrq,jdbcType=TIMESTAMP},
  425. </if>
  426. <if test="jzzxrq != null" >
  427. #{jzzxrq,jdbcType=TIMESTAMP},
  428. </if>
  429. <if test="jhnd != null" >
  430. #{jhnd,jdbcType=VARCHAR},
  431. </if>
  432. </trim>
  433. </insert>
  434. <select id="countByExample" parameterType="com.chinaitop.depot.business.model.BusinessPlanExample" resultType="java.lang.Integer" >
  435. <!--
  436. WARNING - @mbggenerated
  437. This element is automatically generated by MyBatis Generator, do not modify.
  438. This element was generated on Mon Jun 29 18:21:02 CST 2020.
  439. -->
  440. select count(*) from business_plan
  441. <if test="_parameter != null" >
  442. <include refid="Example_Where_Clause" />
  443. </if>
  444. </select>
  445. <update id="updateByExampleSelective" parameterType="map" >
  446. <!--
  447. WARNING - @mbggenerated
  448. This element is automatically generated by MyBatis Generator, do not modify.
  449. This element was generated on Mon Jun 29 18:21:02 CST 2020.
  450. -->
  451. update business_plan
  452. <set >
  453. <if test="record.id != null" >
  454. id = #{record.id,jdbcType=INTEGER},
  455. </if>
  456. <if test="record.planNumber != null" >
  457. plan_number = #{record.planNumber,jdbcType=VARCHAR},
  458. </if>
  459. <if test="record.planTitle != null" >
  460. plan_title = #{record.planTitle,jdbcType=VARCHAR},
  461. </if>
  462. <if test="record.referenceNumber != null" >
  463. reference_number = #{record.referenceNumber,jdbcType=VARCHAR},
  464. </if>
  465. <if test="record.planDesc != null" >
  466. plan_desc = #{record.planDesc,jdbcType=VARCHAR},
  467. </if>
  468. <if test="record.executeType != null" >
  469. execute_type = #{record.executeType,jdbcType=INTEGER},
  470. </if>
  471. <if test="record.outAmount != null" >
  472. out_amount = #{record.outAmount,jdbcType=VARCHAR},
  473. </if>
  474. <if test="record.inAmount != null" >
  475. in_amount = #{record.inAmount,jdbcType=VARCHAR},
  476. </if>
  477. <if test="record.outTotalPrice != null" >
  478. out_total_price = #{record.outTotalPrice,jdbcType=VARCHAR},
  479. </if>
  480. <if test="record.inTotalPrice != null" >
  481. in_total_price = #{record.inTotalPrice,jdbcType=VARCHAR},
  482. </if>
  483. <if test="record.customerPlanState != null" >
  484. customer_plan_state = #{record.customerPlanState,jdbcType=VARCHAR},
  485. </if>
  486. <if test="record.planCustomer != null" >
  487. plan_customer = #{record.planCustomer,jdbcType=VARCHAR},
  488. </if>
  489. <if test="record.auditState != null" >
  490. audit_state = #{record.auditState,jdbcType=VARCHAR},
  491. </if>
  492. <if test="record.processInstanceId != null" >
  493. process_instance_id = #{record.processInstanceId,jdbcType=VARCHAR},
  494. </if>
  495. <if test="record.processDefinitionId != null" >
  496. process_definition_id = #{record.processDefinitionId,jdbcType=VARCHAR},
  497. </if>
  498. <if test="record.currentApprovePath != null" >
  499. current_approve_path = #{record.currentApprovePath,jdbcType=VARCHAR},
  500. </if>
  501. <if test="record.agreeTime != null" >
  502. agree_time = #{record.agreeTime,jdbcType=TIMESTAMP},
  503. </if>
  504. <if test="record.createrId != null" >
  505. creater_id = #{record.createrId,jdbcType=INTEGER},
  506. </if>
  507. <if test="record.creater != null" >
  508. creater = #{record.creater,jdbcType=VARCHAR},
  509. </if>
  510. <if test="record.createTime != null" >
  511. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  512. </if>
  513. <if test="record.createUnit != null" >
  514. create_unit = #{record.createUnit,jdbcType=VARCHAR},
  515. </if>
  516. <if test="record.orgId != null" >
  517. org_id = #{record.orgId,jdbcType=INTEGER},
  518. </if>
  519. <if test="record.inApplication != null" >
  520. in_application = #{record.inApplication,jdbcType=INTEGER},
  521. </if>
  522. <if test="record.totalQuantity != null" >
  523. total_quantity = #{record.totalQuantity,jdbcType=VARCHAR},
  524. </if>
  525. <if test="record.reportDate != null" >
  526. report_date = #{record.reportDate,jdbcType=TIMESTAMP},
  527. </if>
  528. <if test="record.sendDate != null" >
  529. send_date = #{record.sendDate,jdbcType=TIMESTAMP},
  530. </if>
  531. <if test="record.provinceRemark != null" >
  532. province_remark = #{record.provinceRemark,jdbcType=VARCHAR},
  533. </if>
  534. <if test="record.enterpriseRemark != null" >
  535. enterprise_remark = #{record.enterpriseRemark,jdbcType=VARCHAR},
  536. </if>
  537. <if test="record.attributeType != null" >
  538. attribute_type = #{record.attributeType,jdbcType=INTEGER},
  539. </if>
  540. <if test="record.refuseReason != null" >
  541. refuse_reason = #{record.refuseReason,jdbcType=VARCHAR},
  542. </if>
  543. <if test="record.updatetime != null" >
  544. updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
  545. </if>
  546. <if test="record.kszxrq != null" >
  547. kszxrq = #{record.kszxrq,jdbcType=TIMESTAMP},
  548. </if>
  549. <if test="record.jzzxrq != null" >
  550. jzzxrq = #{record.jzzxrq,jdbcType=TIMESTAMP},
  551. </if>
  552. <if test="record.jhnd != null" >
  553. jhnd = #{record.jhnd,jdbcType=VARCHAR},
  554. </if>
  555. </set>
  556. <if test="_parameter != null" >
  557. <include refid="Update_By_Example_Where_Clause" />
  558. </if>
  559. </update>
  560. <update id="updateByExample" parameterType="map" >
  561. <!--
  562. WARNING - @mbggenerated
  563. This element is automatically generated by MyBatis Generator, do not modify.
  564. This element was generated on Mon Jun 29 18:21:02 CST 2020.
  565. -->
  566. update business_plan
  567. set id = #{record.id,jdbcType=INTEGER},
  568. plan_number = #{record.planNumber,jdbcType=VARCHAR},
  569. plan_title = #{record.planTitle,jdbcType=VARCHAR},
  570. reference_number = #{record.referenceNumber,jdbcType=VARCHAR},
  571. plan_desc = #{record.planDesc,jdbcType=VARCHAR},
  572. execute_type = #{record.executeType,jdbcType=INTEGER},
  573. out_amount = #{record.outAmount,jdbcType=VARCHAR},
  574. in_amount = #{record.inAmount,jdbcType=VARCHAR},
  575. out_total_price = #{record.outTotalPrice,jdbcType=VARCHAR},
  576. in_total_price = #{record.inTotalPrice,jdbcType=VARCHAR},
  577. customer_plan_state = #{record.customerPlanState,jdbcType=VARCHAR},
  578. plan_customer = #{record.planCustomer,jdbcType=VARCHAR},
  579. audit_state = #{record.auditState,jdbcType=VARCHAR},
  580. process_instance_id = #{record.processInstanceId,jdbcType=VARCHAR},
  581. process_definition_id = #{record.processDefinitionId,jdbcType=VARCHAR},
  582. current_approve_path = #{record.currentApprovePath,jdbcType=VARCHAR},
  583. agree_time = #{record.agreeTime,jdbcType=TIMESTAMP},
  584. creater_id = #{record.createrId,jdbcType=INTEGER},
  585. creater = #{record.creater,jdbcType=VARCHAR},
  586. create_time = #{record.createTime,jdbcType=TIMESTAMP},
  587. create_unit = #{record.createUnit,jdbcType=VARCHAR},
  588. org_id = #{record.orgId,jdbcType=INTEGER},
  589. in_application = #{record.inApplication,jdbcType=INTEGER},
  590. total_quantity = #{record.totalQuantity,jdbcType=VARCHAR},
  591. report_date = #{record.reportDate,jdbcType=TIMESTAMP},
  592. send_date = #{record.sendDate,jdbcType=TIMESTAMP},
  593. province_remark = #{record.provinceRemark,jdbcType=VARCHAR},
  594. enterprise_remark = #{record.enterpriseRemark,jdbcType=VARCHAR},
  595. attribute_type = #{record.attributeType,jdbcType=INTEGER},
  596. refuse_reason = #{record.refuseReason,jdbcType=VARCHAR},
  597. updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
  598. kszxrq = #{record.kszxrq,jdbcType=TIMESTAMP},
  599. jzzxrq = #{record.jzzxrq,jdbcType=TIMESTAMP},
  600. jhnd = #{record.jhnd,jdbcType=VARCHAR}
  601. <if test="_parameter != null" >
  602. <include refid="Update_By_Example_Where_Clause" />
  603. </if>
  604. </update>
  605. <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.business.model.BusinessPlan" >
  606. <!--
  607. WARNING - @mbggenerated
  608. This element is automatically generated by MyBatis Generator, do not modify.
  609. This element was generated on Mon Jun 29 18:21:02 CST 2020.
  610. -->
  611. update business_plan
  612. <set >
  613. <if test="planNumber != null" >
  614. plan_number = #{planNumber,jdbcType=VARCHAR},
  615. </if>
  616. <if test="planTitle != null" >
  617. plan_title = #{planTitle,jdbcType=VARCHAR},
  618. </if>
  619. <if test="referenceNumber != null" >
  620. reference_number = #{referenceNumber,jdbcType=VARCHAR},
  621. </if>
  622. <if test="planDesc != null" >
  623. plan_desc = #{planDesc,jdbcType=VARCHAR},
  624. </if>
  625. <if test="executeType != null" >
  626. execute_type = #{executeType,jdbcType=INTEGER},
  627. </if>
  628. <if test="outAmount != null" >
  629. out_amount = #{outAmount,jdbcType=VARCHAR},
  630. </if>
  631. <if test="inAmount != null" >
  632. in_amount = #{inAmount,jdbcType=VARCHAR},
  633. </if>
  634. <if test="outTotalPrice != null" >
  635. out_total_price = #{outTotalPrice,jdbcType=VARCHAR},
  636. </if>
  637. <if test="inTotalPrice != null" >
  638. in_total_price = #{inTotalPrice,jdbcType=VARCHAR},
  639. </if>
  640. <if test="customerPlanState != null" >
  641. customer_plan_state = #{customerPlanState,jdbcType=VARCHAR},
  642. </if>
  643. <if test="planCustomer != null" >
  644. plan_customer = #{planCustomer,jdbcType=VARCHAR},
  645. </if>
  646. <if test="auditState != null" >
  647. audit_state = #{auditState,jdbcType=VARCHAR},
  648. </if>
  649. <if test="processInstanceId != null" >
  650. process_instance_id = #{processInstanceId,jdbcType=VARCHAR},
  651. </if>
  652. <if test="processDefinitionId != null" >
  653. process_definition_id = #{processDefinitionId,jdbcType=VARCHAR},
  654. </if>
  655. <if test="currentApprovePath != null" >
  656. current_approve_path = #{currentApprovePath,jdbcType=VARCHAR},
  657. </if>
  658. <if test="agreeTime != null" >
  659. agree_time = #{agreeTime,jdbcType=TIMESTAMP},
  660. </if>
  661. <if test="createrId != null" >
  662. creater_id = #{createrId,jdbcType=INTEGER},
  663. </if>
  664. <if test="creater != null" >
  665. creater = #{creater,jdbcType=VARCHAR},
  666. </if>
  667. <if test="createTime != null" >
  668. create_time = #{createTime,jdbcType=TIMESTAMP},
  669. </if>
  670. <if test="createUnit != null" >
  671. create_unit = #{createUnit,jdbcType=VARCHAR},
  672. </if>
  673. <if test="orgId != null" >
  674. org_id = #{orgId,jdbcType=INTEGER},
  675. </if>
  676. <if test="inApplication != null" >
  677. in_application = #{inApplication,jdbcType=INTEGER},
  678. </if>
  679. <if test="totalQuantity != null" >
  680. total_quantity = #{totalQuantity,jdbcType=VARCHAR},
  681. </if>
  682. <if test="reportDate != null" >
  683. report_date = #{reportDate,jdbcType=TIMESTAMP},
  684. </if>
  685. <if test="sendDate != null" >
  686. send_date = #{sendDate,jdbcType=TIMESTAMP},
  687. </if>
  688. <if test="provinceRemark != null" >
  689. province_remark = #{provinceRemark,jdbcType=VARCHAR},
  690. </if>
  691. <if test="enterpriseRemark != null" >
  692. enterprise_remark = #{enterpriseRemark,jdbcType=VARCHAR},
  693. </if>
  694. <if test="attributeType != null" >
  695. attribute_type = #{attributeType,jdbcType=INTEGER},
  696. </if>
  697. <if test="refuseReason != null" >
  698. refuse_reason = #{refuseReason,jdbcType=VARCHAR},
  699. </if>
  700. <if test="updatetime != null" >
  701. updatetime = #{updatetime,jdbcType=TIMESTAMP},
  702. </if>
  703. <if test="kszxrq != null" >
  704. kszxrq = #{kszxrq,jdbcType=TIMESTAMP},
  705. </if>
  706. <if test="jzzxrq != null" >
  707. jzzxrq = #{jzzxrq,jdbcType=TIMESTAMP},
  708. </if>
  709. <if test="jhnd != null" >
  710. jhnd = #{jhnd,jdbcType=VARCHAR},
  711. </if>
  712. </set>
  713. where id = #{id,jdbcType=INTEGER}
  714. </update>
  715. <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.business.model.BusinessPlan" >
  716. <!--
  717. WARNING - @mbggenerated
  718. This element is automatically generated by MyBatis Generator, do not modify.
  719. This element was generated on Mon Jun 29 18:21:02 CST 2020.
  720. -->
  721. update business_plan
  722. set plan_number = #{planNumber,jdbcType=VARCHAR},
  723. plan_title = #{planTitle,jdbcType=VARCHAR},
  724. reference_number = #{referenceNumber,jdbcType=VARCHAR},
  725. plan_desc = #{planDesc,jdbcType=VARCHAR},
  726. execute_type = #{executeType,jdbcType=INTEGER},
  727. out_amount = #{outAmount,jdbcType=VARCHAR},
  728. in_amount = #{inAmount,jdbcType=VARCHAR},
  729. out_total_price = #{outTotalPrice,jdbcType=VARCHAR},
  730. in_total_price = #{inTotalPrice,jdbcType=VARCHAR},
  731. customer_plan_state = #{customerPlanState,jdbcType=VARCHAR},
  732. plan_customer = #{planCustomer,jdbcType=VARCHAR},
  733. audit_state = #{auditState,jdbcType=VARCHAR},
  734. process_instance_id = #{processInstanceId,jdbcType=VARCHAR},
  735. process_definition_id = #{processDefinitionId,jdbcType=VARCHAR},
  736. current_approve_path = #{currentApprovePath,jdbcType=VARCHAR},
  737. agree_time = #{agreeTime,jdbcType=TIMESTAMP},
  738. creater_id = #{createrId,jdbcType=INTEGER},
  739. creater = #{creater,jdbcType=VARCHAR},
  740. create_time = #{createTime,jdbcType=TIMESTAMP},
  741. create_unit = #{createUnit,jdbcType=VARCHAR},
  742. org_id = #{orgId,jdbcType=INTEGER},
  743. in_application = #{inApplication,jdbcType=INTEGER},
  744. total_quantity = #{totalQuantity,jdbcType=VARCHAR},
  745. report_date = #{reportDate,jdbcType=TIMESTAMP},
  746. send_date = #{sendDate,jdbcType=TIMESTAMP},
  747. province_remark = #{provinceRemark,jdbcType=VARCHAR},
  748. enterprise_remark = #{enterpriseRemark,jdbcType=VARCHAR},
  749. attribute_type = #{attributeType,jdbcType=INTEGER},
  750. refuse_reason = #{refuseReason,jdbcType=VARCHAR},
  751. updatetime = #{updatetime,jdbcType=TIMESTAMP},
  752. kszxrq = #{kszxrq,jdbcType=TIMESTAMP},
  753. jzzxrq = #{jzzxrq,jdbcType=TIMESTAMP},
  754. jhnd = #{jhnd,jdbcType=VARCHAR}
  755. where id = #{id,jdbcType=INTEGER}
  756. </update>
  757. <select id="getApprovalList" resultMap="approvalResultMap" parameterType="java.util.Map" >
  758. select
  759. a.id id, a.plan_number plan_number, a.reference_number reference_number, a.execute_type execute_type,
  760. a.in_amount in_amount,a.out_amount out_amount, a.create_time create_time,
  761. a.process_instance_id process_instance_id,
  762. a.process_definition_id process_definition_id,
  763. b.id auditId,
  764. b.result result, b.task_id task_id,b.task_name task_name
  765. from business_plan a, business_approval b
  766. <where>
  767. a.process_instance_id = b.process_instance_id
  768. and
  769. a.audit_state != 0
  770. <if test="operator != null">
  771. and b.operator = #{operator}
  772. </if>
  773. <if test="result != null">
  774. and b.result = #{result}
  775. </if>
  776. <if test="planNumber != null">
  777. and a.plan_number LIKE CONCAT(CONCAT('%', #{planNumber}), '%')
  778. </if>
  779. <if test="attributeType != null">
  780. and a.attribute_type = #{attributeType}
  781. </if>
  782. order by FIELD(b.result, '待审批', '同意', '驳回', '拒绝'), b.create_time desc
  783. </where>
  784. </select>
  785. <select id="selectByExampleToVO" resultMap="approvalResultMap" parameterType="com.chinaitop.depot.business.model.BusinessPlanExample" >select
  786. <if test="distinct" >
  787. distinct
  788. </if>
  789. <include refid="Base_Column_List" />
  790. from business_plan
  791. <if test="_parameter != null" >
  792. <include refid="Example_Where_Clause" />
  793. </if>
  794. <if test="orderByClause != null" >
  795. order by ${orderByClause}
  796. </if>
  797. </select>
  798. <update id="updateByStatus" parameterType="java.lang.Integer">
  799. update business_plan set customer_plan_state=1 where id=#{id};
  800. </update>
  801. <!-- 审批结束的(audit_state = 2),终止(in_application = 3),已上报的(customer_plan_state=50)的轮换计划(execute_type=3156)-->
  802. <select id="getAcceptanceList" resultMap="approvalResultMap" parameterType="java.util.Map" >
  803. SELECT
  804. a.id id,a.plan_number plan_number,a.reference_number reference_number,
  805. a.execute_type execute_type,
  806. a.customer_plan_state customer_plan_state,
  807. a.in_application in_application,
  808. detail.grain_kind grain_kind,
  809. detail.grain_attribute grain_attribute,
  810. detail.grain_annual grain_annual,
  811. detail.house_id house_id,
  812. detail.warehouse_id warehouse_id,
  813. a.create_time create_time,
  814. a.process_instance_id process_instance_id,
  815. a.process_definition_id process_definition_id,
  816. a.plan_title plan_title,
  817. acceptance.application_date applicationDate,
  818. acceptance.acceptance_type acceptanceType
  819. FROM
  820. business_plan a
  821. LEFT JOIN business_plan_acceptance acceptance ON acceptance.plan_id = a.id
  822. LEFT JOIN business_store_ware_detail detail ON detail.zid = a.id
  823. <where>
  824. a.audit_state = 2 AND a.in_application = 3 AND a.execute_type=3156 AND customer_plan_state=50
  825. <if test="planTitle != null">
  826. and a.plan_title LIKE CONCAT(CONCAT('%', #{planTitle}), '%')
  827. </if>
  828. <if test="planNumber != null">
  829. and a.plan_number LIKE CONCAT(CONCAT('%', #{planNumber}), '%')
  830. </if>
  831. order by a.create_time desc
  832. </where>
  833. </select>
  834. <insert id="addAcceptance" useGeneratedKeys="true" keyProperty="id" parameterType="java.util.Map">
  835. INSERT INTO business_plan_acceptance (plan_id, application_date, acceptance_number,acceptance_type) VALUES
  836. ${sql}
  837. </insert>
  838. <insert id="addAcceptanceDetail" parameterType="java.util.Map">
  839. INSERT INTO business_plan_acceptance_detail (acceptance_id, qualitycheck_id) VALUES
  840. ${sqlDetail}
  841. </insert>
  842. <select id="getDataByZJId" resultMap="BaseResultMap" parameterType="java.util.Map" >
  843. SELECT
  844. quality.*,house.storehouse_name storehouseName,warehouse.warehouse_name wareHouseName, acceptance.id acceptanceId
  845. FROM
  846. business_plan_acceptance acceptance
  847. INNER JOIN business_plan_acceptance_detail detail ON detail.acceptance_id = acceptance.id
  848. INNER JOIN storage_qualitycheck quality ON quality.id = detail.qualitycheck_id
  849. INNER JOIN basic_storehouse house ON house.storehouse_id = quality.house_id
  850. INNER JOIN basic_warehouse warehouse ON warehouse.warehouse_id = quality.warehouse_id
  851. where acceptance.plan_id = #{id,jdbcType=VARCHAR}
  852. </select>
  853. <select id="queryAcceptanceList" parameterType="java.util.Map" resultType="java.util.HashMap" >
  854. select * from business_plan_acceptance a left join business_plan p on a.plan_id=p.id
  855. <!-- left join business_plan_acceptance_detail pa on pa.acceptance_id = a.id -->
  856. <where>
  857. p.creater_id = #{userId} and p.org_id = #{orgId}
  858. <if test="planTitle != null">
  859. and p.plan_title LIKE CONCAT('%',#{planTitle,jdbcType=VARCHAR},'%')
  860. </if>
  861. <if test="planNumber != null">
  862. and p.plan_number LIKE CONCAT('%',#{planNumber,jdbcType=VARCHAR},'%')
  863. </if>
  864. <if test="customerPlanState != null">
  865. and p.customer_plan_state = #{customerPlanState}
  866. </if>
  867. order by p.create_time desc
  868. </where>
  869. </select>
  870. <!-- 架空期查询 -->
  871. <select id="getjkqPlanList" parameterType="java.util.Map" resultType="java.util.HashMap" >
  872. SELECT
  873. a.ch,
  874. a.hwh,
  875. a.wjh
  876. FROM
  877. lsreport_ts.data_kcgl_fcbgz_default a
  878. LEFT JOIN lsreport_ts.data_kcgl_xckc_default b ON a.DataID = b.DataID
  879. LEFT JOIN depot.business_delivery_storage_notice c ON b.tzdh = c.bill_number
  880. LEFT JOIN depot.business_plan d ON c.plan_number = d.plan_number
  881. <where>
  882. <if test="orgId != null">
  883. AND d.org_id = #{orgId}
  884. </if>
  885. <if test="executeType != null">
  886. AND d.execute_type = #{executeType}
  887. </if>
  888. <if test="cjsjA != null and cjsjB != null and cjsjA != '' and cjsjB != ''" >
  889. AND a.cjsj between #{cjsjA} and #{cjsjB}
  890. </if>
  891. <if test="rqA != null and rqB != null and rqA != '' and rqB != ''" >
  892. AND a.rq between #{rqA} and #{rqB}
  893. </if>
  894. </where>
  895. </select>
  896. <!-- 查询轮换日期 -->
  897. <select id="getjkqDayList" parameterType="java.util.Map" resultType="java.util.HashMap" >
  898. SELECT
  899. distinct
  900. a.cjsj AS modifydate,
  901. a.ch,
  902. a.hwh,
  903. a.mxpz,
  904. a.hwxz,
  905. a.zcsl,
  906. SUM(a.srsl) AS srsl,
  907. c.bill_number,
  908. c.plan_number AS jhbh,
  909. (IFNULL(d.customer_plan_state,7)) AS planSp,
  910. DATE_FORMAT(DATE_ADD(a.cjsj,INTERVAL 1 DAY),'%Y-%m-%d') AS jkqStart,
  911. DATE_FORMAT(DATE_ADD(a.cjsj,INTERVAL 1 DAY),'%Y-%m-%d') AS jkqEnd,
  912. a.rq
  913. FROM
  914. lsreport_ts.data_kcgl_fcbgz_default a
  915. LEFT JOIN lsreport_ts.data_kcgl_xckc_default b ON a.DataID = b.DataID
  916. LEFT JOIN depot.business_delivery_storage_notice c ON b.tzdh = c.bill_number
  917. LEFT JOIN depot.business_plan d ON c.plan_number = d.plan_number
  918. <where>
  919. <if test="orgId != null">
  920. AND d.org_id = #{orgId}
  921. </if>
  922. <if test="ch != null">
  923. AND a.ch = #{ch}
  924. </if>
  925. <if test="hwh != null">
  926. AND a.hwh = #{hwh}
  927. </if>
  928. <if test="wjh != null">
  929. AND c.plan_number = #{wjh}
  930. </if>
  931. <if test="executeType != null">
  932. AND d.execute_type = #{executeType}
  933. </if>
  934. <if test="cjsjA != null and cjsjB != null and cjsjA != '' and cjsjB != ''" >
  935. AND a.cjsj between #{cjsjA} and #{cjsjB}
  936. </if>
  937. <if test="rqA != null and rqB != null and rqA != '' and rqB != ''" >
  938. AND a.rq between #{rqA} and #{rqB}
  939. </if>
  940. </where>
  941. ORDER BY
  942. a.rq DESC
  943. </select>
  944. <select id="getjybjl" parameterType="java.lang.Integer" resultType="java.lang.Integer">
  945. SELECT
  946. count(1)
  947. FROM
  948. user_role
  949. WHERE
  950. role_id = (
  951. SELECT
  952. role_id
  953. FROM
  954. role_info
  955. WHERE
  956. role_name = '经营部经理'
  957. AND org_id = #{orgId}
  958. )
  959. </select>
  960. <select id="getzzbjl" parameterType="java.lang.Integer" resultType="java.lang.Integer">
  961. SELECT
  962. count(1)
  963. FROM
  964. user_role
  965. WHERE
  966. role_id = (
  967. SELECT
  968. role_id
  969. FROM
  970. role_info
  971. WHERE
  972. role_name = '中转部经理'
  973. AND org_id = #{orgId}
  974. )
  975. </select>
  976. </mapper>