|
|
@@ -0,0 +1,80 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
+<!DOCTYPE mapper
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="com.ruoyi.interfaces.mapper.MdForecastPlanMapper">
|
|
|
+
|
|
|
+ <resultMap type="com.ruoyi.interfaces.domain.MdForecastPlan" id="MdForecastPlanResult">
|
|
|
+ <result property="planId" column="plan_id" />
|
|
|
+ <result property="mdid" column="mdid" />
|
|
|
+ <result property="planName" column="plan_name" />
|
|
|
+ <result property="remark" column="remark" />
|
|
|
+ <result property="beginTime" column="begin_time" />
|
|
|
+ <result property="endTime" column="end_time" />
|
|
|
+ <result property="basedTime" column="based_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectMdForecastPlanVo">
|
|
|
+ select plan_id, mdid, plan_name, remark, begin_time, end_time, based_time from md_forecast_plan
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectMdForecastPlanList" parameterType="com.ruoyi.interfaces.domain.MdForecastPlan" resultMap="MdForecastPlanResult">
|
|
|
+ <include refid="selectMdForecastPlanVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="mdid != null and mdid != ''"> and mdid = #{mdid}</if>
|
|
|
+ <if test="planName != null and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
|
|
|
+ <if test="beginTime != null "> and begin_time = #{beginTime}</if>
|
|
|
+ <if test="endTime != null "> and end_time = #{endTime}</if>
|
|
|
+ <if test="basedTime != null "> and based_time = #{basedTime}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectMdForecastPlanByPlanId" parameterType="Long" resultMap="MdForecastPlanResult">
|
|
|
+ <include refid="selectMdForecastPlanVo"/>
|
|
|
+ where plan_id = #{planId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertMdForecastPlan" parameterType="com.ruoyi.interfaces.domain.MdForecastPlan" useGeneratedKeys="true" keyProperty="planId">
|
|
|
+ insert into md_forecast_plan
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="mdid != null">mdid,</if>
|
|
|
+ <if test="planName != null">plan_name,</if>
|
|
|
+ <if test="remark != null">remark,</if>
|
|
|
+ <if test="beginTime != null">begin_time,</if>
|
|
|
+ <if test="endTime != null">end_time,</if>
|
|
|
+ <if test="basedTime != null">based_time,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="mdid != null">#{mdid},</if>
|
|
|
+ <if test="planName != null">#{planName},</if>
|
|
|
+ <if test="remark != null">#{remark},</if>
|
|
|
+ <if test="beginTime != null">#{beginTime},</if>
|
|
|
+ <if test="endTime != null">#{endTime},</if>
|
|
|
+ <if test="basedTime != null">#{basedTime},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateMdForecastPlan" parameterType="com.ruoyi.interfaces.domain.MdForecastPlan">
|
|
|
+ update md_forecast_plan
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="mdid != null">mdid = #{mdid},</if>
|
|
|
+ <if test="planName != null">plan_name = #{planName},</if>
|
|
|
+ <if test="remark != null">remark = #{remark},</if>
|
|
|
+ <if test="beginTime != null">begin_time = #{beginTime},</if>
|
|
|
+ <if test="endTime != null">end_time = #{endTime},</if>
|
|
|
+ <if test="basedTime != null">based_time = #{basedTime},</if>
|
|
|
+ </trim>
|
|
|
+ where plan_id = #{planId}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteMdForecastPlanByPlanId" parameterType="Long">
|
|
|
+ delete from md_forecast_plan where plan_id = #{planId}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteMdForecastPlanByPlanIds" parameterType="String">
|
|
|
+ delete from md_forecast_plan where plan_id in
|
|
|
+ <foreach item="planId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{planId}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|