WorkOrderInfoMapper.xml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  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="com.ruoyi.system.mapper.WorkOrderInfoMapper">
  6. <resultMap type="WorkOrderInfo" id="WorkOrderInfoResult">
  7. <result property="orderId" column="order_id" />
  8. <result property="userId" column="user_id" />
  9. <result property="userName" column="user_name" />
  10. <result property="unitName" column="unit_name" />
  11. <result property="provinceId" column="province_id" />
  12. <result property="province" column="province" />
  13. <result property="cityId" column="city_id" />
  14. <result property="city" column="city" />
  15. <result property="regionId" column="region_id" />
  16. <result property="region" column="region" />
  17. <result property="detailedAddress" column="detailed_address" />
  18. <result property="lon" column="lon" />
  19. <result property="lat" column="lat" />
  20. <result property="personName" column="person_name" />
  21. <result property="phonenumber" column="phonenumber" />
  22. <result property="sex" column="sex" />
  23. <result property="type" column="type" />
  24. <result property="demand" column="demand" />
  25. <result property="isSignature" column="is_signature" />
  26. <result property="evaluation" column="evaluation" />
  27. <result property="evaluationContent" column="evaluation_content" />
  28. <result property="serviceProgress" column="service_progress" />
  29. <result property="serviceType" column="service_type" />
  30. <result property="orderPlacement" column="order_placement" />
  31. <result property="agency" column="agency" />
  32. <result property="responsibleId" column="responsible_id" />
  33. <result property="responsibleName" column="responsible_name" />
  34. <result property="responsiblePhone" column="responsible_phone" />
  35. <result property="takeTime" column="take_time" />
  36. <result property="projectName" column="project_name" />
  37. <result property="shelfLife" column="shelf_life" />
  38. <result property="isCharge" column="is_charge" />
  39. <result property="totalCost" column="total_cost" />
  40. <result property="totalCostDx" column="total_cost_dx" />
  41. <result property="delFlag" column="del_flag" />
  42. <result property="createBy" column="create_by" />
  43. <result property="createTime" column="create_time" />
  44. <result property="updateBy" column="update_by" />
  45. <result property="updateTime" column="update_time" />
  46. <result property="remark" column="remark" />
  47. </resultMap>
  48. <sql id="selectWorkOrderInfoVo">
  49. select order_id,user_id,user_name, unit_name, province_id, province, city_id, city, region_id, region, detailed_address, lon, lat, person_name, phonenumber, sex, type, demand, is_signature, evaluation, evaluation_content, service_progress,service_type, order_placement,agency, responsible_id, responsible_name,responsible_phone,take_time, project_name, shelf_life, is_charge, total_cost, total_cost_dx, del_flag, create_by, create_time, update_by, update_time, remark from work_order_info
  50. </sql>
  51. <select id="selectWorkOrderInfoList" parameterType="WorkOrderInfo" resultMap="WorkOrderInfoResult">
  52. <include refid="selectWorkOrderInfoVo"/>
  53. <where>
  54. <if test="userId != null and userId != ''"> and user_id = #{userId}</if>
  55. <if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
  56. <if test="unitName != null and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
  57. <if test="provinceId != null and provinceId != ''"> and province_id = #{provinceId}</if>
  58. <if test="province != null and province != ''"> and province = #{province}</if>
  59. <if test="cityId != null and cityId != ''"> and city_id = #{cityId}</if>
  60. <if test="city != null and city != ''"> and city = #{city}</if>
  61. <if test="regionId != null and regionId != ''"> and region_id = #{regionId}</if>
  62. <if test="region != null and region != ''"> and region = #{region}</if>
  63. <if test="detailedAddress != null and detailedAddress != ''"> and detailed_address = #{detailedAddress}</if>
  64. <if test="lon != null and lon != ''"> and lon = #{lon}</if>
  65. <if test="lat != null and lat != ''"> and lat = #{lat}</if>
  66. <if test="personName != null and personName != ''"> and person_name like concat('%', #{personName}, '%')</if>
  67. <if test="phonenumber != null and phonenumber != ''"> and phonenumber like concat('%', #{phonenumber}, '%')</if>
  68. <if test="sex != null and sex != ''"> and sex = #{sex}</if>
  69. <if test="type != null and type != ''"> and type = #{type}</if>
  70. <if test="demand != null and demand != ''"> and demand = #{demand}</if>
  71. <if test="isSignature != null and isSignature != ''"> and is_signature = #{isSignature}</if>
  72. <if test="evaluation != null and evaluation != ''"> and evaluation = #{evaluation}</if>
  73. <if test="evaluationContent != null and evaluationContent != ''"> and evaluation_content = #{evaluationContent}</if>
  74. <if test="serviceProgress != null and serviceProgress != ''"> and service_progress = #{serviceProgress}</if>
  75. <if test="serviceType != null and serviceType != ''"> and service_type = #{serviceType}</if>
  76. <if test="orderPlacement != null and orderPlacement != ''"> and order_placement = #{orderPlacement}</if>
  77. <if test="agency != null and agency != ''"> and agency = #{agency}</if>
  78. <if test="responsibleId != null "> and responsible_id = #{responsibleId}</if>
  79. <if test="responsibleName != null and responsibleName != ''"> and responsible_name like concat('%', #{responsibleName}, '%')</if>
  80. <if test="responsiblePhone != null and responsiblePhone != ''"> and responsible_phone = #like concat('%', #{responsiblePhone}, '%')</if>
  81. <if test="projectName != null and projectName != ''"> and project_name like concat('%', #{projectName}, '%')</if>
  82. <if test="shelfLife != null and shelfLife != ''"> and shelf_life = #{shelfLife}</if>
  83. <if test="isCharge != null and isCharge != ''"> and is_charge = #{isCharge}</if>
  84. <if test="totalCost != null and totalCost != ''"> and total_cost = #{totalCost}</if>
  85. <if test="totalCostDx != null and totalCostDx != ''"> and total_cost_dx = #{totalCostDx}</if>
  86. <if test="delFlag != null and delFlag != ''"> and del_flag = #{delFlag}</if>
  87. <if test="createTime != null and createTime != ''"><!-- 开始时间检索 -->
  88. and date_format(create_time,'%Y%m%d') = date_format(#{createTime},'%Y%m%d')
  89. </if>
  90. </where>
  91. order by create_time desc
  92. </select>
  93. <select id="selectWorkOrderInfoByOrderId" parameterType="String" resultMap="WorkOrderInfoResult">
  94. <include refid="selectWorkOrderInfoVo"/>
  95. where order_id = #{orderId}
  96. </select>
  97. <select id="selectWorkOrderInfoListBymonth" parameterType="WorkOrderInfo" resultMap="WorkOrderInfoResult">
  98. <include refid="selectWorkOrderInfoVo"/>
  99. where date_format(create_time,'%Y%m') = date_format(#{month},'%Y%m') and del_flag = 'N'
  100. </select>
  101. <select id="selectWorkOrderInfoListByTime" parameterType="WorkOrderInfo" resultMap="WorkOrderInfoResult">
  102. <include refid="selectWorkOrderInfoVo"/>
  103. where take_time &gt;= #{startDate}
  104. and take_time &lt;= #{endDate}
  105. and responsible_id = #{userId}
  106. and order_placement is not null
  107. </select>
  108. <select id="selectWorkOrderInfoListBymonthOne" parameterType="WorkOrderInfo" resultMap="WorkOrderInfoResult">
  109. <include refid="selectWorkOrderInfoVo"/>
  110. where date_format(create_time,'%Y%m') = date_format(#{month},'%Y%m') and del_flag = 'N' and responsible_id is not null
  111. </select>
  112. <select id="selectWorkOrderInfoListByYearOne" parameterType="WorkOrderInfo" resultMap="WorkOrderInfoResult">
  113. <include refid="selectWorkOrderInfoVo"/>
  114. where date_format(create_time,'%Y') = date_format(#{year},'%Y') and del_flag = 'N' and responsible_id is not null
  115. </select>
  116. <select id="selectWorkOrderInfoListByYear" parameterType="WorkOrderInfo" resultMap="WorkOrderInfoResult">
  117. <include refid="selectWorkOrderInfoVo"/>
  118. where date_format(create_time,'%Y') = date_format(#{year},'%Y') and del_flag = 'N'
  119. <if test="userId != null and userId !=0"> and responsible_id = #{userId}</if>
  120. </select>
  121. <select id="selectWorkOrderInfoListByUserList" parameterType="WorkOrderInfo" resultMap="WorkOrderInfoResult">
  122. <include refid="selectWorkOrderInfoVo"/>
  123. where date_format(create_time,'%Y') = date_format(#{year},'%Y') and del_flag = 'N'
  124. and responsible_id in
  125. <foreach item="userId" index="index" collection="userIds" open="(" separator="," close=")">
  126. #{userId}
  127. </foreach>
  128. </select>
  129. <insert id="insertWorkOrderInfo" parameterType="WorkOrderInfo">
  130. insert into work_order_info
  131. <trim prefix="(" suffix=")" suffixOverrides=",">
  132. <if test="orderId != null">order_id,</if>
  133. <if test="userId != null ">user_id,</if>
  134. <if test="userName != null ">user_name,</if>
  135. <if test="unitName != null">unit_name,</if>
  136. <if test="provinceId != null">province_id,</if>
  137. <if test="province != null">province,</if>
  138. <if test="cityId != null">city_id,</if>
  139. <if test="city != null">city,</if>
  140. <if test="regionId != null">region_id,</if>
  141. <if test="region != null">region,</if>
  142. <if test="detailedAddress != null">detailed_address,</if>
  143. <if test="lon != null">lon,</if>
  144. <if test="lat != null">lat,</if>
  145. <if test="personName != null">person_name,</if>
  146. <if test="phonenumber != null">phonenumber,</if>
  147. <if test="sex != null">sex,</if>
  148. <if test="type != null">type,</if>
  149. <if test="demand != null">demand,</if>
  150. <if test="isSignature != null">is_signature,</if>
  151. <if test="evaluation != null">evaluation,</if>
  152. <if test="evaluationContent != null">evaluation_content,</if>
  153. <if test="serviceProgress != null">service_progress,</if>
  154. <if test="serviceType != null "> service_type,</if>
  155. <if test="orderPlacement != null">order_placement,</if>
  156. <if test="agency != null ">agency,</if>
  157. <if test="responsibleId != null">responsible_id,</if>
  158. <if test="responsibleName != null">responsible_name,</if>
  159. <if test="responsiblePhone != null">responsible_phone,</if>
  160. <if test="takeTime != null">take_time,</if>
  161. <if test="projectName != null">project_name,</if>
  162. <if test="shelfLife != null">shelf_life,</if>
  163. <if test="isCharge != null">is_charge,</if>
  164. <if test="totalCost != null">total_cost,</if>
  165. <if test="totalCostDx != null">total_cost_dx,</if>
  166. <if test="delFlag != null">del_flag,</if>
  167. <if test="createBy != null">create_by,</if>
  168. <if test="createTime != null">create_time,</if>
  169. <if test="updateBy != null">update_by,</if>
  170. <if test="updateTime != null">update_time,</if>
  171. <if test="remark != null">remark,</if>
  172. </trim>
  173. <trim prefix="values (" suffix=")" suffixOverrides=",">
  174. <if test="orderId != null">#{orderId},</if>
  175. <if test="userId != null ">#{userId},</if>
  176. <if test="userName != null ">#{userName},</if>
  177. <if test="unitName != null">#{unitName},</if>
  178. <if test="provinceId != null">#{provinceId},</if>
  179. <if test="province != null">#{province},</if>
  180. <if test="cityId != null">#{cityId},</if>
  181. <if test="city != null">#{city},</if>
  182. <if test="regionId != null">#{regionId},</if>
  183. <if test="region != null">#{region},</if>
  184. <if test="detailedAddress != null">#{detailedAddress},</if>
  185. <if test="lon != null">#{lon},</if>
  186. <if test="lat != null">#{lat},</if>
  187. <if test="personName != null">#{personName},</if>
  188. <if test="phonenumber != null">#{phonenumber},</if>
  189. <if test="sex != null">#{sex},</if>
  190. <if test="type != null">#{type},</if>
  191. <if test="demand != null">#{demand},</if>
  192. <if test="isSignature != null">#{isSignature},</if>
  193. <if test="evaluation != null">#{evaluation},</if>
  194. <if test="evaluationContent != null">#{evaluationContent},</if>
  195. <if test="serviceProgress != null">#{serviceProgress},</if>
  196. <if test="serviceType != null "> #{serviceType},</if>
  197. <if test="orderPlacement != null">#{orderPlacement},</if>
  198. <if test="agency != null ">#{agency},</if>
  199. <if test="responsibleId != null">#{responsibleId},</if>
  200. <if test="responsibleName != null">#{responsibleName},</if>
  201. <if test="responsiblePhone != null">#{responsiblePhone},</if>
  202. <if test="takeTime != null">#{takeTime},</if>
  203. <if test="projectName != null">#{projectName},</if>
  204. <if test="shelfLife != null">#{shelfLife},</if>
  205. <if test="isCharge != null">#{isCharge},</if>
  206. <if test="totalCost != null">#{totalCost},</if>
  207. <if test="totalCostDx != null">#{totalCostDx},</if>
  208. <if test="delFlag != null">#{delFlag},</if>
  209. <if test="createBy != null">#{createBy},</if>
  210. <if test="createTime != null">#{createTime},</if>
  211. <if test="updateBy != null">#{updateBy},</if>
  212. <if test="updateTime != null">#{updateTime},</if>
  213. <if test="remark != null">#{remark},</if>
  214. </trim>
  215. </insert>
  216. <update id="updateWorkOrderInfo" parameterType="WorkOrderInfo">
  217. update work_order_info
  218. <trim prefix="SET" suffixOverrides=",">
  219. <if test="userId != null "> user_id = #{userId},</if>
  220. <if test="userName != null ">user_name = #{userName},</if>
  221. <if test="unitName != null">unit_name = #{unitName},</if>
  222. <if test="provinceId != null">province_id = #{provinceId},</if>
  223. <if test="province != null">province = #{province},</if>
  224. <if test="cityId != null">city_id = #{cityId},</if>
  225. <if test="city != null">city = #{city},</if>
  226. <if test="regionId != null">region_id = #{regionId},</if>
  227. <if test="region != null">region = #{region},</if>
  228. <if test="detailedAddress != null">detailed_address = #{detailedAddress},</if>
  229. <if test="lon != null">lon = #{lon},</if>
  230. <if test="lat != null">lat = #{lat},</if>
  231. <if test="personName != null">person_name = #{personName},</if>
  232. <if test="phonenumber != null">phonenumber = #{phonenumber},</if>
  233. <if test="sex != null">sex = #{sex},</if>
  234. <if test="type != null">type = #{type},</if>
  235. <if test="demand != null">demand = #{demand},</if>
  236. <if test="isSignature != null">is_signature = #{isSignature},</if>
  237. <if test="evaluation != null">evaluation = #{evaluation},</if>
  238. <if test="evaluationContent != null">evaluation_content = #{evaluationContent},</if>
  239. <if test="serviceProgress != null">service_progress = #{serviceProgress},</if>
  240. <if test="serviceType != null ">service_type = #{serviceType},</if>
  241. <if test="orderPlacement != null">order_placement = #{orderPlacement},</if>
  242. <if test="agency != null "> agency = #{agency},</if>
  243. <if test="responsibleId != null">responsible_id = #{responsibleId},</if>
  244. <if test="responsibleName != null">responsible_name = #{responsibleName},</if>
  245. <if test="responsiblePhone != null">responsible_phone = #{responsiblePhone},</if>
  246. <if test="takeTime != null">take_time = #{takeTime},</if>
  247. <if test="projectName != null">project_name = #{projectName},</if>
  248. <if test="shelfLife != null">shelf_life = #{shelfLife},</if>
  249. <if test="isCharge != null">is_charge = #{isCharge},</if>
  250. <if test="totalCost != null">total_cost = #{totalCost},</if>
  251. <if test="totalCostDx != null">total_cost_dx = #{totalCostDx},</if>
  252. <if test="delFlag != null">del_flag = #{delFlag},</if>
  253. <if test="createBy != null">create_by = #{createBy},</if>
  254. <if test="createTime != null">create_time = #{createTime},</if>
  255. <if test="updateBy != null">update_by = #{updateBy},</if>
  256. <if test="updateTime != null">update_time = #{updateTime},</if>
  257. <if test="remark != null">remark = #{remark},</if>
  258. </trim>
  259. where order_id = #{orderId}
  260. </update>
  261. <delete id="deleteWorkOrderInfoByOrderId" parameterType="String">
  262. delete from work_order_info where order_id = #{orderId}
  263. </delete>
  264. <delete id="deleteWorkOrderInfoByOrderIds" parameterType="String">
  265. delete from work_order_info where order_id in
  266. <foreach item="orderId" collection="array" open="(" separator="," close=")">
  267. #{orderId}
  268. </foreach>
  269. </delete>
  270. </mapper>