TInvoiceWorkcontentMapper.xml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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. </resultMap>
  30. <sql id="selectTInvoiceWorkcontentVo">
  31. 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 ,
  32. d.whgzxkzh,d.dhzyxkzh,d.xzkjxkzh,d.mbzyxkzh,d.gczyxkzh,d.gczyjb,d.reservation_number,s.dept_name from t_invoice_workcontent d
  33. left join sys_dept s on s.dept_id = d.dept_id
  34. </sql>
  35. <select id="selectTInvoiceWorkcontentList" parameterType="TInvoiceWorkcontent" resultMap="TInvoiceWorkcontentResult">
  36. <include refid="selectTInvoiceWorkcontentVo"/>
  37. <where>
  38. <if test="createrCode != null "> and creater_code = #{createrCode}</if>
  39. <if test="createdate != null "> and createdate = #{createdate}</if>
  40. <if test="updaterCode != null "> and updater_code = #{updaterCode}</if>
  41. <if test="updatedate != null "> and updatedate = #{updatedate}</if>
  42. <if test="workType != null "> and work_type = #{workType}</if>
  43. <if test="riskLevel != null "> and risk_level = #{riskLevel}</if>
  44. <if test="workDescription != null and workDescription != ''"> and work_description = #{workDescription}</if>
  45. <if test="workPeopleNumber != null "> and work_people_number = #{workPeopleNumber}</if>
  46. <if test="hpjb != null and hpjb != ''"> and hpjb = #{hpjb}</if>
  47. <if test="estimateWorktime != null and estimateWorktime != ''"> and estimate_worktime = #{estimateWorktime}</if>
  48. <if test="bookingticketId != null "> and bookingticket_id = #{bookingticketId}</if>
  49. <if test="reservationNumber != null and reservationNumber != ''"> and reservation_number = #{reservationNumber}</if>
  50. <if test="whgzxkzh != null and whgzxkzh != ''"> and whgzxkzh = #{whgzxkzh}</if>
  51. <if test="dhzyxkzh != null and dhzyxkzh != ''"> and dhzyxkzh = #{dhzyxkzh}</if>
  52. <if test="xzkjxkzh != null and xzkjxkzh != ''"> and xzkjxkzh = #{xzkjxkzh}</if>
  53. <if test="mbzyxkzh != null and mbzyxkzh != ''"> and mbzyxkzh = #{mbzyxkzh}</if>
  54. <if test="gczyxkzh != null and gczyxkzh != ''"> and gczyxkzh = #{gczyxkzh}</if>
  55. <if test="gczyjb != null and gczyjb != ''"> and gczyjb = #{gczyjb}</if>
  56. <if test="deptId != null "> and dept_id = #{deptId}</if>
  57. and d.del_flag = 0
  58. </where>
  59. <!-- 数据范围过滤 -->
  60. ${params.dataScope}
  61. </select>
  62. <select id="selectTInvoiceWorkcontentById" parameterType="Long" resultMap="TInvoiceWorkcontentResult">
  63. <include refid="selectTInvoiceWorkcontentVo"/>
  64. where id = #{id}
  65. and d.del_flag = 0
  66. </select>
  67. <select id="selectTInvoiceWorkcontentBybookingticketId" parameterType="Long" resultMap="TInvoiceWorkcontentResult">
  68. <include refid="selectTInvoiceWorkcontentVo"/>
  69. where d.bookingticket_id = #{bookingticketId}
  70. and d.del_flag = 0
  71. </select>
  72. <insert id="insertTInvoiceWorkcontent" parameterType="TInvoiceWorkcontent">
  73. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  74. SELECT T_INVOICE_WORKCONTENT_SEQ.NEXTVAL as id FROM DUAL
  75. </selectKey>
  76. insert into t_invoice_workcontent
  77. <trim prefix="(" suffix=")" suffixOverrides=",">
  78. <if test="id != null">id,</if>
  79. <if test="delFlag != null">del_flag,</if>
  80. <if test="createrCode != null">creater_code,</if>
  81. <if test="createdate != null">createdate,</if>
  82. <if test="updaterCode != null">updater_code,</if>
  83. <if test="updatedate != null">updatedate,</if>
  84. <if test="workType != null">work_type,</if>
  85. <if test="riskLevel != null">risk_level,</if>
  86. <if test="workDescription != null">work_description,</if>
  87. <if test="workPeopleNumber != null">work_people_number,</if>
  88. <if test="hpjb != null">hpjb,</if>
  89. <if test="estimateWorktime != null">estimate_worktime,</if>
  90. <if test="bookingticketId != null">bookingticket_id,</if>
  91. <if test="deptId != null">dept_id,</if>
  92. <if test="reservationNumber != null">reservation_number,</if>
  93. <if test="whgzxkzh != null">whgzxkzh,</if>
  94. <if test="dhzyxkzh != null">dhzyxkzh,</if>
  95. <if test="xzkjxkzh != null">xzkjxkzh,</if>
  96. <if test="mbzyxkzh != null">mbzyxkzh,</if>
  97. <if test="gczyxkzh != null">gczyxkzh,</if>
  98. <if test="gczyjb != null">gczyjb,</if>
  99. </trim>
  100. <trim prefix="values (" suffix=")" suffixOverrides=",">
  101. <if test="id != null">#{id},</if>
  102. <if test="delFlag != null">#{delFlag},</if>
  103. <if test="createrCode != null">#{createrCode},</if>
  104. <if test="createdate != null">#{createdate},</if>
  105. <if test="updaterCode != null">#{updaterCode},</if>
  106. <if test="updatedate != null">#{updatedate},</if>
  107. <if test="workType != null">#{workType},</if>
  108. <if test="riskLevel != null">#{riskLevel},</if>
  109. <if test="workDescription != null">#{workDescription},</if>
  110. <if test="workPeopleNumber != null">#{workPeopleNumber},</if>
  111. <if test="hpjb != null">#{hpjb},</if>
  112. <if test="estimateWorktime != null">#{estimateWorktime},</if>
  113. <if test="bookingticketId != null">#{bookingticketId},</if>
  114. <if test="deptId != null">#{deptId},</if>
  115. <if test="reservationNumber != null">#{reservationNumber},</if>
  116. <if test="whgzxkzh != null">#{whgzxkzh},</if>
  117. <if test="dhzyxkzh != null">#{dhzyxkzh},</if>
  118. <if test="xzkjxkzh != null">#{xzkjxkzh},</if>
  119. <if test="mbzyxkzh != null">#{mbzyxkzh},</if>
  120. <if test="gczyxkzh != null">#{gczyxkzh},</if>
  121. <if test="gczyjb != null">#{gczyjb},</if>
  122. </trim>
  123. </insert>
  124. <update id="updateTInvoiceWorkcontent" parameterType="TInvoiceWorkcontent">
  125. update t_invoice_workcontent
  126. <trim prefix="SET" suffixOverrides=",">
  127. <if test="delFlag != null">del_flag = #{delFlag},</if>
  128. <if test="createrCode != null">creater_code = #{createrCode},</if>
  129. <if test="createdate != null">createdate = #{createdate},</if>
  130. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  131. <if test="updatedate != null">updatedate = #{updatedate},</if>
  132. <if test="workType != null">work_type = #{workType},</if>
  133. <if test="riskLevel != null">risk_level = #{riskLevel},</if>
  134. <if test="workDescription != null">work_description = #{workDescription},</if>
  135. <if test="workPeopleNumber != null">work_people_number = #{workPeopleNumber},</if>
  136. <if test="hpjb != null">hpjb = #{hpjb},</if>
  137. <if test="estimateWorktime != null">estimate_worktime = #{estimateWorktime},</if>
  138. <if test="bookingticketId != null">bookingticket_id = #{bookingticketId},</if>
  139. <if test="deptId != null">dept_id = #{deptId},</if>
  140. <if test="reservationNumber != null">reservation_number = #{reservationNumber},</if>
  141. <if test="whgzxkzh != null">whgzxkzh = #{whgzxkzh},</if>
  142. <if test="dhzyxkzh != null">dhzyxkzh = #{dhzyxkzh},</if>
  143. <if test="xzkjxkzh != null">xzkjxkzh = #{xzkjxkzh},</if>
  144. <if test="mbzyxkzh != null">mbzyxkzh = #{mbzyxkzh},</if>
  145. <if test="gczyxkzh != null">gczyxkzh = #{gczyxkzh},</if>
  146. <if test="gczyjb != null">gczyjb = #{gczyjb},</if>
  147. </trim>
  148. where id = #{id}
  149. </update>
  150. <update id="deleteTInvoiceWorkcontentById" parameterType="Long">
  151. update t_invoice_workcontent set del_flag = 2 where id = #{id}
  152. </update>
  153. <update id="deleteTInvoiceWorkcontentByIds" parameterType="String">
  154. update t_invoice_workcontent set del_flag = 2 where id in
  155. <foreach item="id" collection="array" open="(" separator="," close=")">
  156. #{id}
  157. </foreach>
  158. </update>
  159. </mapper>