OaWorkflowFormServiceDaoImplMapper.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="oaWorkflowFormServiceDaoImpl">
  6. <!-- 保存OA表单信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveOaWorkflowFormInfo" parameterType="Map">
  8. insert into oa_workflow_form(
  9. form_id,form_json,store_id,flow_id,version,table_name
  10. ) values (
  11. #{formId},#{formJson},#{storeId},#{flowId},#{version},#{tableName}
  12. )
  13. </insert>
  14. <!-- 查询OA表单信息 add by wuxw 2018-07-03 -->
  15. <select id="getOaWorkflowFormInfo" parameterType="Map" resultType="Map">
  16. select t.form_id,t.form_id formId,t.status_cd,t.status_cd statusCd,t.form_json,t.form_json
  17. formJson,t.store_id,t.store_id storeId,t.flow_id,t.flow_id flowId,t.version,t.table_name,t.table_name tableName
  18. from oa_workflow_form t
  19. where 1 =1
  20. <if test="formId !=null and formId != ''">
  21. and t.form_id= #{formId}
  22. </if>
  23. <if test="statusCd !=null and statusCd != ''">
  24. and t.status_cd= #{statusCd}
  25. </if>
  26. <if test="formJson !=null and formJson != ''">
  27. and t.form_json= #{formJson}
  28. </if>
  29. <if test="storeId !=null and storeId != ''">
  30. and t.store_id= #{storeId}
  31. </if>
  32. <if test="flowId !=null and flowId != ''">
  33. and t.flow_id= #{flowId}
  34. </if>
  35. <if test="version !=null and version != ''">
  36. and t.version= #{version}
  37. </if>
  38. <if test="tableName !=null and tableName != ''">
  39. and t.table_name= #{tableName}
  40. </if>
  41. order by t.create_time desc
  42. <if test="page != -1 and page != null ">
  43. limit #{page}, #{row}
  44. </if>
  45. </select>
  46. <!-- 修改OA表单信息 add by wuxw 2018-07-03 -->
  47. <update id="updateOaWorkflowFormInfo" parameterType="Map">
  48. update oa_workflow_form t set t.status_cd = #{statusCd}
  49. <if test="newBId != null and newBId != ''">
  50. ,t.b_id = #{newBId}
  51. </if>
  52. <if test="formJson !=null and formJson != ''">
  53. , t.form_json= #{formJson}
  54. </if>
  55. <if test="storeId !=null and storeId != ''">
  56. , t.store_id= #{storeId}
  57. </if>
  58. <if test="flowId !=null and flowId != ''">
  59. , t.flow_id= #{flowId}
  60. </if>
  61. <if test="version !=null and version != ''">
  62. , t.version= #{version}
  63. </if>
  64. <if test="tableName !=null and tableName != ''">
  65. , t.table_name= #{tableName}
  66. </if>
  67. where 1=1
  68. and t.form_id= #{formId}
  69. </update>
  70. <!-- 查询OA表单数量 add by wuxw 2018-07-03 -->
  71. <select id="queryOaWorkflowFormsCount" parameterType="Map" resultType="Map">
  72. select count(1) count
  73. from oa_workflow_form t
  74. where 1 =1
  75. <if test="formId !=null and formId != ''">
  76. and t.form_id= #{formId}
  77. </if>
  78. <if test="statusCd !=null and statusCd != ''">
  79. and t.status_cd= #{statusCd}
  80. </if>
  81. <if test="formJson !=null and formJson != ''">
  82. and t.form_json= #{formJson}
  83. </if>
  84. <if test="storeId !=null and storeId != ''">
  85. and t.store_id= #{storeId}
  86. </if>
  87. <if test="flowId !=null and flowId != ''">
  88. and t.flow_id= #{flowId}
  89. </if>
  90. <if test="version !=null and version != ''">
  91. and t.version= #{version}
  92. </if>
  93. <if test="tableName !=null and tableName != ''">
  94. and t.table_name= #{tableName}
  95. </if>
  96. </select>
  97. <!-- 查询OA表单数量 add by wuxw 2018-07-03 -->
  98. <select id="hasTable" parameterType="Map" resultType="Map">
  99. select * from information_schema.tables where table_name = #{tableName}
  100. </select>
  101. <update id="createTable" parameterType="Map">
  102. ${sql}
  103. </update>
  104. <!-- 查询OA表单数量 add by wuxw 2018-07-03 -->
  105. <select id="queryOaWorkflowFormDataCount" parameterType="Map" resultType="Map">
  106. select count(1) count
  107. from ${tableName} t
  108. where 1 =1
  109. and t.store_id = #{storeId}
  110. and t.status_cd= '0'
  111. <if test="startTime !=null and startTime != ''">
  112. and t.create_time &gt; #{startTime}
  113. </if>
  114. <if test="endTime !=null and endTime != ''">
  115. and t.create_time &lt; #{endTime}
  116. </if>
  117. <if test="id !=null and id != ''">
  118. and t.id = #{id}
  119. </if>
  120. <if test="createUserName !=null and createUserName != ''">
  121. and t.create_user_name = #{createUserName}
  122. </if>
  123. </select>
  124. <!-- 查询OA表单数量 add by wuxw 2018-07-03 -->
  125. <select id="queryOaWorkflowFormDatas" parameterType="Map" resultType="Map">
  126. select t.*
  127. from ${tableName} t
  128. where 1 =1
  129. and t.store_id = #{storeId}
  130. and t.status_cd= '0'
  131. <if test="startTime !=null and startTime != ''">
  132. and t.create_time &gt; #{startTime}
  133. </if>
  134. <if test="endTime !=null and endTime != ''">
  135. and t.create_time &lt; #{endTime}
  136. </if>
  137. <if test="id !=null and id != ''">
  138. and t.id = #{id}
  139. </if>
  140. <if test="ids != null">
  141. and t.id in
  142. <foreach collection="ids" item="item" open="(" close=")" separator=",">
  143. #{item}
  144. </foreach>
  145. </if>
  146. <if test="createUserName !=null and createUserName != ''">
  147. and t.create_user_name = #{createUserName}
  148. </if>
  149. order by t.create_time desc
  150. <if test="page != -1 and page != null ">
  151. limit #{page}, #{row}
  152. </if>
  153. </select>
  154. <!-- 保存表单数据 -->
  155. <insert id="saveOaWorkflowFormDataInfo" parameterType="Map">
  156. insert into ${tableName} (
  157. <foreach collection="columns" item="item" separator=",">
  158. ${item}
  159. </foreach>
  160. id,create_user_id,create_user_name,state
  161. )values(
  162. <foreach collection="values" item="valueItem" separator=",">
  163. #{valueItem}
  164. </foreach>,
  165. #{id},#{state},#{createUserId},#{createUserName}
  166. )
  167. </insert>
  168. </mapper>