PdmReportPlanWeekMapper.xml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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.powerdistribution.mapper.PdmReportPlanWeekMapper">
  6. <resultMap type="PdmReportPlanWeek" id="PdmReportPlanWeekResult">
  7. <result property="id" column="id" />
  8. <result property="company" column="company" />
  9. <result property="reportDate" column="report_date" />
  10. <result property="reportEndDate" column="report_end_date" />
  11. <result property="total" column="total" />
  12. <result property="weekSum" column="week_sum" />
  13. <result property="weekCancelSum" column="week_cancel_sum" />
  14. <result property="weekRatio" column="week_ratio" />
  15. <result property="temporarySum" column="temporary_sum" />
  16. <result property="temporaryCancelSum" column="temporary_cancel_sum" />
  17. <result property="temporaryRatio" column="temporary_ratio" />
  18. <result property="temporaryPlanRatio" column="temporary_plan_ratio" />
  19. <result property="createBy" column="create_by" />
  20. <result property="createTime" column="create_time" />
  21. <result property="updateBy" column="update_by" />
  22. <result property="updateTime" column="update_time" />
  23. </resultMap>
  24. <sql id="selectPdmReportPlanWeekVo">
  25. select id, company, report_date, report_end_date, total, week_sum, week_cancel_sum, week_ratio, temporary_sum, temporary_cancel_sum, temporary_ratio, temporary_plan_ratio, create_by, create_time, update_by, update_time from pdm_report_plan_week
  26. </sql>
  27. <select id="selectPdmReportPlanWeekList" parameterType="PdmReportPlanWeek" resultMap="PdmReportPlanWeekResult">
  28. <include refid="selectPdmReportPlanWeekVo"/>
  29. <where>
  30. <if test="company != null and company != ''"> and company = #{company}</if>
  31. <if test="reportDate != null and reportDate != ''"> and report_date = #{reportDate}</if>
  32. <if test="reportEndDate != null and reportEndDate != ''"> and report_end_date = #{reportEndDate}</if>
  33. <if test="total != null "> and total = #{total}</if>
  34. <if test="weekSum != null "> and week_sum = #{weekSum}</if>
  35. <if test="weekCancelSum != null "> and week_cancel_sum = #{weekCancelSum}</if>
  36. <if test="weekRatio != null and weekRatio != ''"> and week_ratio = #{weekRatio}</if>
  37. <if test="temporarySum != null "> and temporary_sum = #{temporarySum}</if>
  38. <if test="temporaryCancelSum != null "> and temporary_cancel_sum = #{temporaryCancelSum}</if>
  39. <if test="temporaryRatio != null and temporaryRatio != ''"> and temporary_ratio = #{temporaryRatio}</if>
  40. <if test="temporaryPlanRatio != null and temporaryPlanRatio != ''"> and temporary_plan_ratio = #{temporaryPlanRatio}</if>
  41. </where>
  42. </select>
  43. <select id="selectPdmReportPlanWeekById" parameterType="Long" resultMap="PdmReportPlanWeekResult">
  44. <include refid="selectPdmReportPlanWeekVo"/>
  45. where id = #{id}
  46. </select>
  47. <insert id="insertPdmReportPlanWeek" parameterType="PdmReportPlanWeek" useGeneratedKeys="true" keyProperty="id">
  48. insert into pdm_report_plan_week
  49. <trim prefix="(" suffix=")" suffixOverrides=",">
  50. <if test="company != null">company,</if>
  51. <if test="reportDate != null">report_date,</if>
  52. <if test="reportEndDate != null">report_end_date,</if>
  53. <if test="total != null">total,</if>
  54. <if test="weekSum != null">week_sum,</if>
  55. <if test="weekCancelSum != null">week_cancel_sum,</if>
  56. <if test="weekRatio != null">week_ratio,</if>
  57. <if test="temporarySum != null">temporary_sum,</if>
  58. <if test="temporaryCancelSum != null">temporary_cancel_sum,</if>
  59. <if test="temporaryRatio != null">temporary_ratio,</if>
  60. <if test="temporaryPlanRatio != null">temporary_plan_ratio,</if>
  61. <if test="createBy != null">create_by,</if>
  62. <if test="createTime != null">create_time,</if>
  63. <if test="updateBy != null">update_by,</if>
  64. <if test="updateTime != null">update_time,</if>
  65. </trim>
  66. <trim prefix="values (" suffix=")" suffixOverrides=",">
  67. <if test="company != null">#{company},</if>
  68. <if test="reportDate != null">#{reportDate},</if>
  69. <if test="reportEndDate != null">#{reportEndDate},</if>
  70. <if test="total != null">#{total},</if>
  71. <if test="weekSum != null">#{weekSum},</if>
  72. <if test="weekCancelSum != null">#{weekCancelSum},</if>
  73. <if test="weekRatio != null">#{weekRatio},</if>
  74. <if test="temporarySum != null">#{temporarySum},</if>
  75. <if test="temporaryCancelSum != null">#{temporaryCancelSum},</if>
  76. <if test="temporaryRatio != null">#{temporaryRatio},</if>
  77. <if test="temporaryPlanRatio != null">#{temporaryPlanRatio},</if>
  78. <if test="createBy != null">#{createBy},</if>
  79. <if test="createTime != null">#{createTime},</if>
  80. <if test="updateBy != null">#{updateBy},</if>
  81. <if test="updateTime != null">#{updateTime},</if>
  82. </trim>
  83. </insert>
  84. <update id="updatePdmReportPlanWeek" parameterType="PdmReportPlanWeek">
  85. update pdm_report_plan_week
  86. <trim prefix="SET" suffixOverrides=",">
  87. <if test="company != null">company = #{company},</if>
  88. <if test="reportDate != null">report_date = #{reportDate},</if>
  89. <if test="reportEndDate != null">report_end_date = #{reportEndDate},</if>
  90. <if test="total != null">total = #{total},</if>
  91. <if test="weekSum != null">week_sum = #{weekSum},</if>
  92. <if test="weekCancelSum != null">week_cancel_sum = #{weekCancelSum},</if>
  93. <if test="weekRatio != null">week_ratio = #{weekRatio},</if>
  94. <if test="temporarySum != null">temporary_sum = #{temporarySum},</if>
  95. <if test="temporaryCancelSum != null">temporary_cancel_sum = #{temporaryCancelSum},</if>
  96. <if test="temporaryRatio != null">temporary_ratio = #{temporaryRatio},</if>
  97. <if test="temporaryPlanRatio != null">temporary_plan_ratio = #{temporaryPlanRatio},</if>
  98. <if test="createBy != null">create_by = #{createBy},</if>
  99. <if test="createTime != null">create_time = #{createTime},</if>
  100. <if test="updateBy != null">update_by = #{updateBy},</if>
  101. <if test="updateTime != null">update_time = #{updateTime},</if>
  102. </trim>
  103. where id = #{id}
  104. </update>
  105. <delete id="deletePdmReportPlanWeekById" parameterType="Long">
  106. delete from pdm_report_plan_week where id = #{id}
  107. </delete>
  108. <delete id="deletePdmReportPlanWeekByIds" parameterType="String">
  109. delete from pdm_report_plan_week where id in
  110. <foreach item="id" collection="array" open="(" separator="," close=")">
  111. #{id}
  112. </foreach>
  113. </delete>
  114. </mapper>