TMonthlyQualityReportS2007Mapper.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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.production.mapper.TMonthlyQualityReportS2007Mapper">
  6. <resultMap type="TMonthlyQualityReportS2007" id="TMonthlyQualityReportS2007Result">
  7. <result property="id" column="id" />
  8. <result property="locationName" column="location_name" />
  9. <result property="samplePoint" column="sample_point" />
  10. <result property="sampleDate" column="sample_date" />
  11. <result property="sampleName" column="sample_name" />
  12. <result property="viscosity" column="viscosity" />
  13. <result property="deptId" column="dept_id" />
  14. <result property="delFlag" column="del_flag" />
  15. <result property="createBy" column="create_by" />
  16. <result property="createTime" column="create_time" />
  17. <result property="updateBy" column="update_by" />
  18. <result property="updateTime" column="update_time" />
  19. <result property="deptName" column="dept_name" />
  20. <result property="startDate" column="start_date" />
  21. <result property="endDate" column="end_date" />
  22. <result property="endPoint" column="end_point" />
  23. <result property="pressureDifference" column="pressure_difference" />
  24. <result property="production" column="production" />
  25. </resultMap>
  26. <sql id="selectTMonthlyQualityReportS2007Vo">
  27. select d.id, d.end_point, d.pressure_difference, d.production, d.location_name, d.sample_point, d.sample_date, d.sample_name, d.viscosity, d.dept_id, d.del_flag, d.create_by, d.create_time, d.update_by, d.update_time ,s.dept_name from t_monthly_quality_report_s2007 d
  28. left join sys_dept s on s.dept_id = d.dept_id
  29. </sql>
  30. <select id="selectTMonthlyQualityReportS2007List" parameterType="TMonthlyQualityReportS2007" resultMap="TMonthlyQualityReportS2007Result">
  31. <include refid="selectTMonthlyQualityReportS2007Vo"/>
  32. <where>
  33. <if test="startDate != null "> and sample_date &gt;= #{startDate}</if>
  34. <if test="endDate != null "> and sample_date &lt;= #{endDate}</if>
  35. <if test="locationName != null and locationName != ''"> and location_name like concat(concat('%', #{locationName}), '%')</if>
  36. <if test="samplePoint != null and samplePoint != ''"> and sample_point = #{samplePoint}</if>
  37. <if test="sampleDate != null "> and sample_date = #{sampleDate}</if>
  38. <if test="sampleName != null and sampleName != ''"> and sample_name like concat(concat('%', #{sampleName}), '%')</if>
  39. <if test="viscosity != null and viscosity != ''"> and viscosity = #{viscosity}</if>
  40. <if test="deptId != null "> and dept_id = #{deptId}</if>
  41. <if test="endPoint != null "> and end_point = #{endPoint}</if>
  42. <if test="pressureDifference != null "> and pressure_difference = #{pressureDifference}</if>
  43. <if test="production != null "> and production = #{production}</if>
  44. and d.del_flag = 0
  45. </where>
  46. <!-- 数据范围过滤 -->
  47. ${params.dataScope}
  48. </select>
  49. <select id="selectTMonthlyQualityReportS2007ById" parameterType="Long" resultMap="TMonthlyQualityReportS2007Result">
  50. <include refid="selectTMonthlyQualityReportS2007Vo"/>
  51. where id = #{id}
  52. </select>
  53. <insert id="insertTMonthlyQualityReportS2007" parameterType="TMonthlyQualityReportS2007">
  54. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  55. SELECT seq_t_quality_report_s2007.NEXTVAL as id FROM DUAL
  56. </selectKey>
  57. insert into t_monthly_quality_report_s2007
  58. <trim prefix="(" suffix=")" suffixOverrides=",">
  59. <if test="id != null">id,</if>
  60. <if test="locationName != null">location_name,</if>
  61. <if test="samplePoint != null">sample_point,</if>
  62. <if test="sampleDate != null">sample_date,</if>
  63. <if test="sampleName != null">sample_name,</if>
  64. <if test="viscosity != null">viscosity,</if>
  65. <if test="deptId != null">dept_id,</if>
  66. <if test="delFlag != null">del_flag,</if>
  67. <if test="createBy != null">create_by,</if>
  68. <if test="createTime != null">create_time,</if>
  69. <if test="updateBy != null">update_by,</if>
  70. <if test="updateTime != null">update_time,</if>
  71. <if test="endPoint != null">end_point,</if>
  72. <if test="pressureDifference != null">pressure_difference,</if>
  73. <if test="production != null">production,</if>
  74. </trim>
  75. <trim prefix="values (" suffix=")" suffixOverrides=",">
  76. <if test="id != null">#{id},</if>
  77. <if test="locationName != null">#{locationName},</if>
  78. <if test="samplePoint != null">#{samplePoint},</if>
  79. <if test="sampleDate != null">#{sampleDate},</if>
  80. <if test="sampleName != null">#{sampleName},</if>
  81. <if test="viscosity != null">#{viscosity},</if>
  82. <if test="deptId != null">#{deptId},</if>
  83. <if test="delFlag != null">#{delFlag},</if>
  84. <if test="createBy != null">#{createBy},</if>
  85. <if test="createTime != null">#{createTime},</if>
  86. <if test="updateBy != null">#{updateBy},</if>
  87. <if test="updateTime != null">#{updateTime},</if>
  88. <if test="endPoint != null">#{endPoint},</if>
  89. <if test="pressureDifference != null">#{pressureDifference},</if>
  90. <if test="production != null">#{production},</if>
  91. </trim>
  92. </insert>
  93. <update id="updateTMonthlyQualityReportS2007" parameterType="TMonthlyQualityReportS2007">
  94. update t_monthly_quality_report_s2007
  95. <trim prefix="SET" suffixOverrides=",">
  96. <if test="locationName != null">location_name = #{locationName},</if>
  97. <if test="samplePoint != null">sample_point = #{samplePoint},</if>
  98. <if test="sampleDate != null">sample_date = #{sampleDate},</if>
  99. <if test="sampleName != null">sample_name = #{sampleName},</if>
  100. <if test="viscosity != null">viscosity = #{viscosity},</if>
  101. <if test="deptId != null">dept_id = #{deptId},</if>
  102. <if test="delFlag != null">del_flag = #{delFlag},</if>
  103. <if test="createBy != null">create_by = #{createBy},</if>
  104. <if test="createTime != null">create_time = #{createTime},</if>
  105. <if test="updateBy != null">update_by = #{updateBy},</if>
  106. <if test="updateTime != null">update_time = #{updateTime},</if>
  107. <if test="endPoint != null">end_point = #{endPoint},</if>
  108. <if test="pressureDifference != null">pressure_difference = #{pressureDifference},</if>
  109. <if test="production != null">production = #{production},</if>
  110. </trim>
  111. where id = #{id}
  112. </update>
  113. <update id="deleteTMonthlyQualityReportS2007ById" parameterType="Long">
  114. update t_monthly_quality_report_s2007 set del_flag = 2 where id = #{id}
  115. </update>
  116. <update id="deleteTMonthlyQualityReportS2007ByIds" parameterType="String">
  117. update t_monthly_quality_report_s2007 set del_flag = 2 where id in
  118. <foreach item="id" collection="array" open="(" separator="," close=")">
  119. #{id}
  120. </foreach>
  121. </update>
  122. </mapper>