TInvoiceWorkcontentMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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.invoice.mapper.TInvoiceWorkcontentMapper">
  6. <resultMap type="TInvoiceWorkcontent" id="TInvoiceWorkcontentResult">
  7. <result property="id" column="id" />
  8. <result property="delFlag" column="del_flag" />
  9. <result property="createrCode" column="creater_code" />
  10. <result property="createdate" column="createdate" />
  11. <result property="updaterCode" column="updater_code" />
  12. <result property="updatedate" column="updatedate" />
  13. <result property="workType" column="work_type" />
  14. <result property="riskLevel" column="risk_level" />
  15. <result property="workDescription" column="work_description" />
  16. <result property="workPeopleNumber" column="work_people_number" />
  17. <result property="hpjb" column="hpjb" />
  18. <result property="estimateWorktime" column="estimate_worktime" />
  19. <result property="bookingticketId" column="bookingticket_id" />
  20. <result property="deptId" column="dept_id" />
  21. <result property="deptName" column="dept_name" />
  22. <result property="reservationNumber" column="reservation_number" />
  23. <result property="whgzxkzh" column="whgzxkzh" />
  24. <result property="dhzyxkzh" column="dhzyxkzh" />
  25. <result property="xzkjxkzh" column="xzkjxkzh" />
  26. <result property="mbzyxkzh" column="mbzyxkzh" />
  27. <result property="gczyxkzh" column="gczyxkzh" />
  28. <result property="gczyjb" column="gczyjb" />
  29. <result property="tag" column="tag" />
  30. <result property="yqxkzh" column="yqxkzh" />
  31. <result property="xpxp" column="xpxp" />
  32. <result property="addStatus" column="add_status" />
  33. </resultMap>
  34. <sql id="selectTInvoiceWorkcontentVo">
  35. select d.id, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.work_type, d.risk_level, d.work_description, d.work_people_number, d.hpjb, d.estimate_worktime, d.bookingticket_id, d.dept_id ,
  36. d.whgzxkzh,d.dhzyxkzh,d.xzkjxkzh,d.mbzyxkzh,d.gczyxkzh,d.gczyjb,d.reservation_number,d.tag,d.yqxkzh,d.xpxp,d.add_status, s.dept_name from t_invoice_workcontent d
  37. left join sys_dept s on s.dept_id = d.dept_id
  38. </sql>
  39. <select id="selectTInvoiceWorkcontentList" parameterType="TInvoiceWorkcontent" resultMap="TInvoiceWorkcontentResult">
  40. <include refid="selectTInvoiceWorkcontentVo"/>
  41. <where>
  42. <if test="createrCode != null "> and creater_code = #{createrCode}</if>
  43. <if test="createdate != null "> and createdate = #{createdate}</if>
  44. <if test="updaterCode != null "> and updater_code = #{updaterCode}</if>
  45. <if test="updatedate != null "> and updatedate = #{updatedate}</if>
  46. <if test="workType != null "> and work_type = #{workType}</if>
  47. <if test="riskLevel != null "> and risk_level = #{riskLevel}</if>
  48. <if test="workDescription != null and workDescription != ''"> and work_description = #{workDescription}</if>
  49. <if test="workPeopleNumber != null "> and work_people_number = #{workPeopleNumber}</if>
  50. <if test="hpjb != null and hpjb != ''"> and hpjb = #{hpjb}</if>
  51. <if test="estimateWorktime != null and estimateWorktime != ''"> and estimate_worktime = #{estimateWorktime}</if>
  52. <if test="bookingticketId != null "> and bookingticket_id = #{bookingticketId}</if>
  53. <if test="reservationNumber != null and reservationNumber != ''"> and reservation_number = #{reservationNumber}</if>
  54. <if test="whgzxkzh != null and whgzxkzh != ''"> and whgzxkzh = #{whgzxkzh}</if>
  55. <if test="dhzyxkzh != null and dhzyxkzh != ''"> and dhzyxkzh = #{dhzyxkzh}</if>
  56. <if test="xzkjxkzh != null and xzkjxkzh != ''"> and xzkjxkzh = #{xzkjxkzh}</if>
  57. <if test="mbzyxkzh != null and mbzyxkzh != ''"> and mbzyxkzh = #{mbzyxkzh}</if>
  58. <if test="gczyxkzh != null and gczyxkzh != ''"> and gczyxkzh = #{gczyxkzh}</if>
  59. <if test="gczyjb != null and gczyjb != ''"> and gczyjb = #{gczyjb}</if>
  60. <if test="deptId != null "> and dept_id = #{deptId}</if>
  61. and d.del_flag = 0
  62. </where>
  63. <!-- 数据范围过滤 -->
  64. ${params.dataScope}
  65. </select>
  66. <select id="countXp" parameterType="TInvoiceWorkcontent" resultType="int">
  67. select count(1) from t_invoice_workcontent d
  68. left join t_invoice_bookingworkticket b on b.id = d.bookingticket_id
  69. <where>
  70. <if test="whgzxkzh != null and whgzxkzh != ''"> and d.whgzxkzh = #{whgzxkzh}</if>
  71. <if test="dhzyxkzh != null and dhzyxkzh != ''"> and d.dhzyxkzh = #{dhzyxkzh}</if>
  72. <if test="xzkjxkzh != null and xzkjxkzh != ''"> and d.xzkjxkzh = #{xzkjxkzh}</if>
  73. <if test="mbzyxkzh != null and mbzyxkzh != ''"> and d.mbzyxkzh = #{mbzyxkzh}</if>
  74. <if test="gczyxkzh != null and gczyxkzh != ''"> and d.gczyxkzh = #{gczyxkzh}</if>
  75. <if test="deptId != null "> and d.dept_id = #{deptId}</if>
  76. and d.del_flag = 0 and xpxp = 12 and b.status != 7
  77. </where>
  78. </select>
  79. <select id="selectTInvoiceWorkcontentById" parameterType="Long" resultMap="TInvoiceWorkcontentResult">
  80. <include refid="selectTInvoiceWorkcontentVo"/>
  81. where id = #{id}
  82. and d.del_flag = 0
  83. </select>
  84. <select id="selectTInvoiceWorkcontentBybookingticketId" parameterType="Long" resultMap="TInvoiceWorkcontentResult">
  85. <include refid="selectTInvoiceWorkcontentVo"/>
  86. where d.bookingticket_id = #{bookingticketId}
  87. and d.del_flag = 0
  88. </select>
  89. <insert id="insertTInvoiceWorkcontent" parameterType="TInvoiceWorkcontent">
  90. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  91. SELECT T_INVOICE_WORKCONTENT_SEQ.NEXTVAL as id FROM DUAL
  92. </selectKey>
  93. insert into t_invoice_workcontent
  94. <trim prefix="(" suffix=")" suffixOverrides=",">
  95. <if test="id != null">id,</if>
  96. <if test="delFlag != null">del_flag,</if>
  97. <if test="createrCode != null">creater_code,</if>
  98. <if test="createdate != null">createdate,</if>
  99. <if test="updaterCode != null">updater_code,</if>
  100. <if test="updatedate != null">updatedate,</if>
  101. <if test="workType != null">work_type,</if>
  102. <if test="riskLevel != null">risk_level,</if>
  103. <if test="workDescription != null">work_description,</if>
  104. <if test="workPeopleNumber != null">work_people_number,</if>
  105. <if test="hpjb != null">hpjb,</if>
  106. <if test="estimateWorktime != null">estimate_worktime,</if>
  107. <if test="bookingticketId != null">bookingticket_id,</if>
  108. <if test="deptId != null">dept_id,</if>
  109. <if test="reservationNumber != null">reservation_number,</if>
  110. <if test="whgzxkzh != null">whgzxkzh,</if>
  111. <if test="dhzyxkzh != null">dhzyxkzh,</if>
  112. <if test="xzkjxkzh != null">xzkjxkzh,</if>
  113. <if test="mbzyxkzh != null">mbzyxkzh,</if>
  114. <if test="gczyxkzh != null">gczyxkzh,</if>
  115. <if test="gczyjb != null">gczyjb,</if>
  116. <if test="xpxp != null">xpxp,</if>
  117. <if test="yqxkzh != null">yqxkzh,</if>
  118. <if test="tag != null">tag,</if>
  119. </trim>
  120. <trim prefix="values (" suffix=")" suffixOverrides=",">
  121. <if test="id != null">#{id},</if>
  122. <if test="delFlag != null">#{delFlag},</if>
  123. <if test="createrCode != null">#{createrCode},</if>
  124. <if test="createdate != null">#{createdate},</if>
  125. <if test="updaterCode != null">#{updaterCode},</if>
  126. <if test="updatedate != null">#{updatedate},</if>
  127. <if test="workType != null">#{workType},</if>
  128. <if test="riskLevel != null">#{riskLevel},</if>
  129. <if test="workDescription != null">#{workDescription},</if>
  130. <if test="workPeopleNumber != null">#{workPeopleNumber},</if>
  131. <if test="hpjb != null">#{hpjb},</if>
  132. <if test="estimateWorktime != null">#{estimateWorktime},</if>
  133. <if test="bookingticketId != null">#{bookingticketId},</if>
  134. <if test="deptId != null">#{deptId},</if>
  135. <if test="reservationNumber != null">#{reservationNumber},</if>
  136. <if test="whgzxkzh != null">#{whgzxkzh},</if>
  137. <if test="dhzyxkzh != null">#{dhzyxkzh},</if>
  138. <if test="xzkjxkzh != null">#{xzkjxkzh},</if>
  139. <if test="mbzyxkzh != null">#{mbzyxkzh},</if>
  140. <if test="gczyxkzh != null">#{gczyxkzh},</if>
  141. <if test="gczyjb != null">#{gczyjb},</if>
  142. <if test="xpxp != null">#{xpxp},</if>
  143. <if test="yqxkzh != null">#{yqxkzh},</if>
  144. <if test="tag != null">#{tag},</if>
  145. </trim>
  146. </insert>
  147. <update id="updateTInvoiceWorkcontent" parameterType="TInvoiceWorkcontent">
  148. update t_invoice_workcontent
  149. <trim prefix="SET" suffixOverrides=",">
  150. <if test="delFlag != null">del_flag = #{delFlag},</if>
  151. <if test="createrCode != null">creater_code = #{createrCode},</if>
  152. <if test="createdate != null">createdate = #{createdate},</if>
  153. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  154. <if test="updatedate != null">updatedate = #{updatedate},</if>
  155. <if test="workType != null">work_type = #{workType},</if>
  156. <if test="riskLevel != null">risk_level = #{riskLevel},</if>
  157. <if test="workDescription != null">work_description = #{workDescription},</if>
  158. <if test="workPeopleNumber != null">work_people_number = #{workPeopleNumber},</if>
  159. <if test="hpjb != null">hpjb = #{hpjb},</if>
  160. <if test="estimateWorktime != null">estimate_worktime = #{estimateWorktime},</if>
  161. <if test="bookingticketId != null">bookingticket_id = #{bookingticketId},</if>
  162. <if test="deptId != null">dept_id = #{deptId},</if>
  163. <if test="reservationNumber != null">reservation_number = #{reservationNumber},</if>
  164. <if test="whgzxkzh != null">whgzxkzh = #{whgzxkzh},</if>
  165. <if test="dhzyxkzh != null">dhzyxkzh = #{dhzyxkzh},</if>
  166. <if test="xzkjxkzh != null">xzkjxkzh = #{xzkjxkzh},</if>
  167. <if test="mbzyxkzh != null">mbzyxkzh = #{mbzyxkzh},</if>
  168. <if test="gczyxkzh != null">gczyxkzh = #{gczyxkzh},</if>
  169. <if test="gczyjb != null">gczyjb = #{gczyjb},</if>
  170. <if test="tag != null">tag = #{tag},</if>
  171. <if test="yqxkzh != null">yqxkzh = #{yqxkzh},</if>
  172. <if test="xpxp != null">xpxp = #{xpxp},</if>
  173. <if test="addStatus != null">add_status = #{addStatus},</if>
  174. </trim>
  175. where id = #{id}
  176. </update>
  177. <update id="deleteTInvoiceWorkcontentById" parameterType="Long">
  178. update t_invoice_workcontent set del_flag = 2 where id = #{id}
  179. </update>
  180. <update id="deleteTInvoiceWorkcontentByIds" parameterType="String">
  181. update t_invoice_workcontent set del_flag = 2 where id in
  182. <foreach item="id" collection="array" open="(" separator="," close=")">
  183. #{id}
  184. </foreach>
  185. </update>
  186. </mapper>