TJobticketMapper.xml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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.project.ehs.mapper.TJobticketMapper">
  6. <resultMap type="TJobticket" id="TJobticketResult">
  7. <result property="id" column="id" />
  8. <result property="plantCode" column="plant_code" />
  9. <result property="kprq" column="kprq" />
  10. <result property="qfsj" column="qfsj" />
  11. <result property="qfbz" column="qfbz" />
  12. <result property="qfr" column="qfr" />
  13. <result property="xpxp" column="xpxp" />
  14. <result property="yqxkzh" column="yqxkzh" />
  15. <result property="whgzxkzh" column="whgzxkzh" />
  16. <result property="dhzyxkzh" column="dhzyxkzh" />
  17. <result property="hpjb" column="hpjb" />
  18. <result property="xzkjxkzh" column="xzkjxkzh" />
  19. <result property="content" column="content" />
  20. <result property="byclxr" column="byclxr" />
  21. <result property="sgdw" column="sgdw" />
  22. <result property="lxr" column="lxr" />
  23. <result property="lxdh" column="lxdh" />
  24. <result property="xpsj" column="xpsj" />
  25. <result property="zypzt" column="zypzt" />
  26. <result property="jccdr" column="jccdr" />
  27. <result property="wcxxbh" column="wcxxbh" />
  28. <result property="wcxzt" column="wcxzt" />
  29. <result property="cxsj" column="cxsj" />
  30. <result property="delFlag" column="del_flag" />
  31. <result property="createrCode" column="creater_code" />
  32. <result property="createdate" column="createdate" />
  33. <result property="updaterCode" column="updater_code" />
  34. <result property="updatedate" column="updatedate" />
  35. <result property="deptId" column="dept_id" />
  36. <result property="remarks" column="remarks" />
  37. <result property="deptName" column="dept_name" />
  38. <result property="startDate" column="kprq" />
  39. <result property="endDate" column="kprq" />
  40. <result property="mbzyxkzh" column="mbzyxkzh" />
  41. <result property="gczyxkzh" column="gczyxkzh" />
  42. <result property="gczyjb" column="gczyjb" />
  43. <result property="postponeNumber" column="postpone_number" />
  44. <result property="userMg" column="user_mg" />
  45. <result property="userUnit" column="user_unit" />
  46. <result property="tag" column="tag" />
  47. </resultMap>
  48. <sql id="selectTJobticketVo">
  49. select d.id, d.plant_code, d.kprq, d.qfsj, d.qfbz, d.qfr, d.xpxp, d.yqxkzh, d.whgzxkzh, d.dhzyxkzh, d.hpjb, d.xzkjxkzh, d.content, d.byclxr, d.sgdw, d.lxr, d.lxdh, d.xpsj, d.zypzt, d.jccdr, d.wcxxbh, d.wcxzt, d.cxsj,
  50. d.mbzyxkzh,d.gczyxkzh,d.gczyjb,d.postpone_number,d.user_mg,d.user_unit, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks,d.tag ,s.dept_name from t_jobticket d
  51. left join sys_dept s on s.dept_id = d.dept_id
  52. </sql>
  53. <select id="selectTJobticketList" parameterType="TJobticket" resultMap="TJobticketResult">
  54. <include refid="selectTJobticketVo"/>
  55. <where>
  56. <if test="startDate != null ">and kprq <![CDATA[>=]]> #{startDate}</if>
  57. <if test="endDate != null">and kprq <![CDATA[<=]]>#{endDate}</if>
  58. <if test="qfbz != null and qfbz != ''"> and qfbz = #{qfbz}</if>
  59. <if test="xpxp != null and xpxp != ''"> and xpxp = #{xpxp}</if>
  60. <if test="hpjb != null and hpjb != ''"> and hpjb = #{hpjb}</if>
  61. <if test="zypzt != null and zypzt != ''"> and zypzt = #{zypzt}</if>
  62. <if test="xzkjxkzh == 'true'"> and xzkjxkzh IS NOT NULL</if>
  63. <if test="mbzyxkzh != null and mbzyxkzh != ''"> and mbzyxkzh = #{mbzyxkzh}</if>
  64. <if test="gczyxkzh != null and gczyxkzh != ''"> and gczyxkzh = #{gczyxkzh}</if>
  65. <if test="gczyjb != null and gczyjb != ''"> and gczyjb = #{gczyjb}</if>
  66. <if test="postponeNumber != null "> and postpone_number = #{postponeNumber}</if>
  67. <if test="userMg != null "> and user_mg = #{userMg}</if>
  68. <if test="userUnit != null "> and user_unit = #{userUnit}</if>
  69. <if test="tag != null and tag != '' "> and tag = #{tag}</if>
  70. and d.del_flag = 0 and xpxp = 10
  71. </where>
  72. <!-- 数据范围过滤 -->
  73. ${params.dataScope}
  74. order by d.kprq desc
  75. </select>
  76. <select id="selectTJobticketChildren" parameterType="TJobticket" resultMap="TJobticketResult">
  77. <include refid="selectTJobticketVo"/>
  78. <where>
  79. <if test="whgzxkzh != null and whgzxkzh != ''"> and whgzxkzh = #{whgzxkzh}</if>
  80. <if test="dhzyxkzh != null and dhzyxkzh != ''"> and dhzyxkzh = #{dhzyxkzh}</if>
  81. <if test="xzkjxkzh != null and xzkjxkzh != ''"> and xzkjxkzh = #{xzkjxkzh}</if>
  82. <if test="mbzyxkzh != null and mbzyxkzh != ''"> and mbzyxkzh = #{mbzyxkzh}</if>
  83. <if test="gczyxkzh != null and gczyxkzh != ''"> and gczyxkzh = #{gczyxkzh}</if>
  84. and d.del_flag = 0 and xpxp = 12
  85. </where>
  86. order by d.kprq
  87. </select>
  88. <select id="selectTJobticketById" parameterType="Long" resultMap="TJobticketResult">
  89. <include refid="selectTJobticketVo"/>
  90. where id = #{id}
  91. </select>
  92. <!-- 查询相同数据 sql-->
  93. <select id="selectTJobticketSameData" parameterType="TJobticket" resultType ="java.lang.Integer">
  94. select count(*) from t_jobticket d <where>
  95. <if test="xzkjxkzh != null and xzkjxkzh != ''"> and xzkjxkzh = #{xzkjxkzh}</if>
  96. <if test="mbzyxkzh != null and mbzyxkzh != ''"> and mbzyxkzh = #{mbzyxkzh}</if>
  97. <if test="gczyxkzh != null and gczyxkzh != ''"> and gczyxkzh = #{gczyxkzh}</if>
  98. <if test="whgzxkzh != null and whgzxkzh != ''"> and whgzxkzh = #{whgzxkzh}</if>
  99. <if test="dhzyxkzh != null and dhzyxkzh != ''"> and dhzyxkzh = #{dhzyxkzh}</if>
  100. <if test="yqxkzh != null and yqxkzh != ''"> and yqxkzh = #{yqxkzh}</if>
  101. and d.del_flag = 0
  102. and d.xpxp = #{xpxp}
  103. </where>
  104. </select>
  105. <select id="countXp" parameterType="TJobticket" resultType="int">
  106. select count(1) from t_jobticket d
  107. <where>
  108. <if test="whgzxkzh != null and whgzxkzh != ''"> and d.whgzxkzh = #{whgzxkzh}</if>
  109. <if test="dhzyxkzh != null and dhzyxkzh != ''"> and d.dhzyxkzh = #{dhzyxkzh}</if>
  110. <if test="xzkjxkzh != null and xzkjxkzh != ''"> and d.xzkjxkzh = #{xzkjxkzh}</if>
  111. <if test="mbzyxkzh != null and mbzyxkzh != ''"> and d.mbzyxkzh = #{mbzyxkzh}</if>
  112. <if test="gczyxkzh != null and gczyxkzh != ''"> and d.gczyxkzh = #{gczyxkzh}</if>
  113. <if test="deptId != null "> and d.dept_id = #{deptId}</if>
  114. and d.del_flag = 0 and d.xpxp = 12 and d.zypzt != 20
  115. </where>
  116. </select>
  117. <insert id="insertTJobticket" parameterType="TJobticket">
  118. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  119. SELECT seq_t_jobticket.NEXTVAL as id FROM DUAL
  120. </selectKey>
  121. insert into t_jobticket
  122. <trim prefix="(" suffix=")" suffixOverrides=",">
  123. <if test="id != null">id,</if>
  124. <if test="plantCode != null and plantCode != ''">plant_code,</if>
  125. <if test="kprq != null">kprq,</if>
  126. <if test="qfsj != null">qfsj,</if>
  127. <if test="qfbz != null">qfbz,</if>
  128. <if test="qfr != null">qfr,</if>
  129. <if test="xpxp != null">xpxp,</if>
  130. <if test="yqxkzh != null">yqxkzh,</if>
  131. <if test="whgzxkzh != null">whgzxkzh,</if>
  132. <if test="dhzyxkzh != null">dhzyxkzh,</if>
  133. <if test="hpjb != null">hpjb,</if>
  134. <if test="xzkjxkzh != null">xzkjxkzh,</if>
  135. <if test="content != null">content,</if>
  136. <if test="byclxr != null">byclxr,</if>
  137. <if test="sgdw != null">sgdw,</if>
  138. <if test="lxr != null">lxr,</if>
  139. <if test="lxdh != null">lxdh,</if>
  140. <if test="xpsj != null">xpsj,</if>
  141. <if test="zypzt != null">zypzt,</if>
  142. <if test="jccdr != null">jccdr,</if>
  143. <if test="wcxxbh != null">wcxxbh,</if>
  144. <if test="wcxzt != null">wcxzt,</if>
  145. <if test="cxsj != null">cxsj,</if>
  146. <if test="delFlag != null">del_flag,</if>
  147. <if test="createrCode != null">creater_code,</if>
  148. <if test="createdate != null">createdate,</if>
  149. <if test="updaterCode != null">updater_code,</if>
  150. <if test="updatedate != null">updatedate,</if>
  151. <if test="deptId != null">dept_id,</if>
  152. <if test="remarks != null">remarks,</if>
  153. <if test="mbzyxkzh != null">mbzyxkzh,</if>
  154. <if test="gczyxkzh != null">gczyxkzh,</if>
  155. <if test="gczyjb != null">gczyjb,</if>
  156. <if test="postponeNumber != null">postpone_number,</if>
  157. <if test="userMg != null">user_mg,</if>
  158. <if test="userUnit != null">user_unit,</if>
  159. <if test="tag != null">tag,</if>
  160. </trim>
  161. <trim prefix="values (" suffix=")" suffixOverrides=",">
  162. <if test="id != null">#{id},</if>
  163. <if test="plantCode != null and plantCode != ''">#{plantCode},</if>
  164. <if test="kprq != null">#{kprq},</if>
  165. <if test="qfsj != null">#{qfsj},</if>
  166. <if test="qfbz != null">#{qfbz},</if>
  167. <if test="qfr != null">#{qfr},</if>
  168. <if test="xpxp != null">#{xpxp},</if>
  169. <if test="yqxkzh != null">#{yqxkzh},</if>
  170. <if test="whgzxkzh != null">#{whgzxkzh},</if>
  171. <if test="dhzyxkzh != null">#{dhzyxkzh},</if>
  172. <if test="hpjb != null">#{hpjb},</if>
  173. <if test="xzkjxkzh != null">#{xzkjxkzh},</if>
  174. <if test="content != null">#{content},</if>
  175. <if test="byclxr != null">#{byclxr},</if>
  176. <if test="sgdw != null">#{sgdw},</if>
  177. <if test="lxr != null">#{lxr},</if>
  178. <if test="lxdh != null">#{lxdh},</if>
  179. <if test="xpsj != null">#{xpsj},</if>
  180. <if test="zypzt != null">#{zypzt},</if>
  181. <if test="jccdr != null">#{jccdr},</if>
  182. <if test="wcxxbh != null">#{wcxxbh},</if>
  183. <if test="wcxzt != null">#{wcxzt},</if>
  184. <if test="cxsj != null">#{cxsj},</if>
  185. <if test="delFlag != null">#{delFlag},</if>
  186. <if test="createrCode != null">#{createrCode},</if>
  187. <if test="createdate != null">#{createdate},</if>
  188. <if test="updaterCode != null">#{updaterCode},</if>
  189. <if test="updatedate != null">#{updatedate},</if>
  190. <if test="deptId != null">#{deptId},</if>
  191. <if test="remarks != null">#{remarks},</if>
  192. <if test="mbzyxkzh != null">#{mbzyxkzh},</if>
  193. <if test="gczyxkzh != null">#{gczyxkzh},</if>
  194. <if test="gczyjb != null">#{gczyjb},</if>
  195. <if test="postponeNumber != null">#{postponeNumber},</if>
  196. <if test="userMg != null">#{userMg},</if>
  197. <if test="userUnit != null">#{userUnit},</if>
  198. <if test="tag != null">#{tag},</if>
  199. </trim>
  200. </insert>
  201. <update id="updateTJobticket" parameterType="TJobticket">
  202. update t_jobticket
  203. <trim prefix="SET" suffixOverrides=",">
  204. <if test="plantCode != null and plantCode != ''">plant_code = #{plantCode},</if>
  205. <if test="kprq != null">kprq = #{kprq},</if>
  206. <if test="qfsj != null">qfsj = #{qfsj},</if>
  207. <if test="qfbz != null">qfbz = #{qfbz},</if>
  208. <if test="qfr != null">qfr = #{qfr},</if>
  209. <if test="xpxp != null">xpxp = #{xpxp},</if>
  210. <if test="yqxkzh != null">yqxkzh = #{yqxkzh},</if>
  211. <if test="whgzxkzh != null">whgzxkzh = #{whgzxkzh},</if>
  212. <if test="dhzyxkzh != null">dhzyxkzh = #{dhzyxkzh},</if>
  213. <if test="hpjb != null">hpjb = #{hpjb},</if>
  214. <if test="xzkjxkzh != null">xzkjxkzh = #{xzkjxkzh},</if>
  215. <if test="content != null">content = #{content},</if>
  216. <if test="byclxr != null and byclxr != ''">byclxr = #{byclxr},</if>
  217. <if test="sgdw != null">sgdw = #{sgdw},</if>
  218. <if test="lxr != null">lxr = #{lxr},</if>
  219. <if test="lxdh != null">lxdh = #{lxdh},</if>
  220. <if test="xpsj != null">xpsj = #{xpsj},</if>
  221. <if test="zypzt != null">zypzt = #{zypzt},</if>
  222. <if test="jccdr != null">jccdr = #{jccdr},</if>
  223. <if test="wcxxbh != null">wcxxbh = #{wcxxbh},</if>
  224. <if test="wcxzt != null">wcxzt = #{wcxzt},</if>
  225. <if test="cxsj != null">cxsj = #{cxsj},</if>
  226. <if test="delFlag != null">del_flag = #{delFlag},</if>
  227. <if test="createrCode != null">creater_code = #{createrCode},</if>
  228. <if test="createdate != null">createdate = #{createdate},</if>
  229. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  230. <if test="updatedate != null">updatedate = #{updatedate},</if>
  231. <if test="deptId != null">dept_id = #{deptId},</if>
  232. <if test="remarks != null">remarks = #{remarks},</if>
  233. <if test="mbzyxkzh != null">mbzyxkzh = #{mbzyxkzh},</if>
  234. <if test="gczyxkzh != null">gczyxkzh = #{gczyxkzh},</if>
  235. <if test="gczyjb != null">gczyjb = #{gczyjb},</if>
  236. <if test="postponeNumber != null">postpone_number = #{postponeNumber},</if>
  237. <if test="userMg != null">user_mg = #{userMg},</if>
  238. <if test="userUnit != null">user_unit = #{userUnit},</if>
  239. <if test="tag != null">tag = #{tag},</if>
  240. </trim>
  241. where id = #{id}
  242. </update>
  243. <update id="deleteTJobticketById" parameterType="Long">
  244. update t_jobticket set del_flag = 2 where id = #{id}
  245. </update>
  246. <update id="deleteTJobticketByIds" parameterType="String">
  247. update t_jobticket set del_flag = 2 where id in
  248. <foreach item="id" collection="array" open="(" separator="," close=")">
  249. #{id}
  250. </foreach>
  251. </update>
  252. <select id="selectFireData" resultType="com.ruoyi.project.common.domain.DataEntity">
  253. SELECT count(1) as dataNum,d.HPJB as dataName FROM t_jobticket d
  254. <where>
  255. and d.del_flag = 0
  256. </where>
  257. <!-- 数据范围过滤 -->
  258. ${params.dataScope}
  259. GROUP BY HPJB
  260. order by dataName
  261. </select>
  262. <select id="selectStatusData" resultType="com.ruoyi.project.common.domain.DataEntity">
  263. SELECT count(1) as dataNum,d.ZYPZT as dataName FROM t_jobticket d
  264. <where>
  265. and d.del_flag = 0
  266. </where>
  267. <!-- 数据范围过滤 -->
  268. ${params.dataScope}
  269. GROUP BY ZYPZT
  270. order by dataName
  271. </select>
  272. </mapper>