<?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.project.dc.drillPlan.mapper.DrillPlanMapper">
|
|
<resultMap type="com.ruoyi.project.dc.drillPlan.domain.DrillPlan" id="DrillPlanResult">
|
<result property="drillPlanId" column="drill_plan_id" />
|
<result property="companyId" column="company_id"/>
|
<result property="createBy" column="create_by" />
|
<result property="createUserId" column="create_user_id" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateUserId" column="update_user_id" />
|
<result property="updateTime" column="update_time" />
|
<result property="remark" column="remark" />
|
<result property="planName" column="plan_name" />
|
<result property="participants" column="participants" />
|
<result property="planStartTime" column="plan_start_time" />
|
<result property="planEndTime" column="plan_end_time" />
|
<result property="planType" column="plan_type" />
|
<result property="exerciseProject" column="exercise_project" />
|
<result property="rehearsal" column="rehearsal" />
|
<result property="organizers" column="organizers" />
|
</resultMap>
|
|
<sql id="selectDrillPlanVo">
|
select drill_plan_id,company_id, create_by, create_user_id, create_time, update_by, update_user_id, update_time, remark, plan_name, participants, plan_start_time, plan_end_time, plan_type, exercise_project, rehearsal, organizers from dc_drill_plan
|
</sql>
|
|
<select id="selectDrillPlanList" parameterType="DrillPlan" resultMap="DrillPlanResult">
|
<include refid="selectDrillPlanVo"/>
|
<where>
|
<if test="companyId != null "> and company_id = #{companyId}</if>
|
<if test="createUserId != null "> and create_user_id = #{createUserId}</if>
|
<if test="updateUserId != null "> and update_user_id = #{updateUserId}</if>
|
<if test="planName != null and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
|
<if test="participants != null and participants != ''"> and participants = #{participants}</if>
|
<if test="params.beginPlanStartTime != null and params.beginPlanStartTime != '' and params.endPlanStartTime != null and params.endPlanStartTime != ''"> and plan_start_time between #{params.beginPlanStartTime} and #{params.endPlanStartTime}</if>
|
<if test="params.beginPlanEndTime != null and params.beginPlanEndTime != '' and params.endPlanEndTime != null and params.endPlanEndTime != ''"> and plan_end_time between #{params.beginPlanEndTime} and #{params.endPlanEndTime}</if>
|
<if test="planType != null and planType != ''"> and plan_type = #{planType}</if>
|
<if test="exerciseProject != null and exerciseProject != ''"> and exercise_project = #{exerciseProject}</if>
|
<if test="rehearsal != null and rehearsal != ''"> and rehearsal = #{rehearsal}</if>
|
<if test="organizers != null and organizers != ''"> and organizers = #{organizers}</if>
|
</where>
|
</select>
|
|
<select id="selectDrillPlanById" parameterType="Long" resultMap="DrillPlanResult">
|
<include refid="selectDrillPlanVo"/>
|
where drill_plan_id = #{drillPlanId}
|
</select>
|
|
<insert id="insertDrillPlan" parameterType="DrillPlan" useGeneratedKeys="true" keyProperty="drillPlanId">
|
insert into dc_drill_plan
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="companyId != null ">company_id,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createUserId != null ">create_user_id,</if>
|
<if test="createTime != null ">create_time,</if>
|
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
<if test="updateUserId != null ">update_user_id,</if>
|
<if test="updateTime != null ">update_time,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
<if test="planName != null and planName != ''">plan_name,</if>
|
<if test="participants != null and participants != ''">participants,</if>
|
<if test="planStartTime != null ">plan_start_time,</if>
|
<if test="planEndTime != null ">plan_end_time,</if>
|
<if test="planType != null and planType != ''">plan_type,</if>
|
<if test="exerciseProject != null and exerciseProject != ''">exercise_project,</if>
|
<if test="rehearsal != null and rehearsal != ''">rehearsal,</if>
|
<if test="organizers != null and organizers != ''">organizers,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="companyId != null ">#{companyId},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createUserId != null ">#{createUserId},</if>
|
<if test="createTime != null ">#{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
<if test="updateUserId != null ">#{updateUserId},</if>
|
<if test="updateTime != null ">#{updateTime},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
<if test="planName != null and planName != ''">#{planName},</if>
|
<if test="participants != null and participants != ''">#{participants},</if>
|
<if test="planStartTime != null ">#{planStartTime},</if>
|
<if test="planEndTime != null ">#{planEndTime},</if>
|
<if test="planType != null and planType != ''">#{planType},</if>
|
<if test="exerciseProject != null and exerciseProject != ''">#{exerciseProject},</if>
|
<if test="rehearsal != null and rehearsal != ''">#{rehearsal},</if>
|
<if test="organizers != null and organizers != ''">#{organizers},</if>
|
</trim>
|
</insert>
|
|
<update id="updateDrillPlan" parameterType="DrillPlan">
|
update dc_drill_plan
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="companyId != null ">company_id = #{companyId},</if>
|
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
<if test="createUserId != null ">create_user_id = #{createUserId},</if>
|
<if test="createTime != null ">create_time = #{createTime},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="updateUserId != null ">update_user_id = #{updateUserId},</if>
|
<if test="updateTime != null ">update_time = #{updateTime},</if>
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
<if test="planName != null and planName != ''">plan_name = #{planName},</if>
|
<if test="participants != null and participants != ''">participants = #{participants},</if>
|
<if test="planStartTime != null ">plan_start_time = #{planStartTime},</if>
|
<if test="planEndTime != null ">plan_end_time = #{planEndTime},</if>
|
<if test="planType != null and planType != ''">plan_type = #{planType},</if>
|
<if test="exerciseProject != null and exerciseProject != ''">exercise_project = #{exerciseProject},</if>
|
<if test="rehearsal != null and rehearsal != ''">rehearsal = #{rehearsal},</if>
|
<if test="organizers != null and organizers != ''">organizers = #{organizers},</if>
|
</trim>
|
where drill_plan_id = #{drillPlanId}
|
</update>
|
|
<delete id="deleteDrillPlanById" parameterType="Long">
|
delete from dc_drill_plan where drill_plan_id = #{drillPlanId}
|
</delete>
|
|
<delete id="deleteDrillPlanByIds" parameterType="String">
|
delete from dc_drill_plan where drill_plan_id in
|
<foreach item="drillPlanId" collection="array" open="(" separator="," close=")">
|
#{drillPlanId}
|
</foreach>
|
</delete>
|
|
</mapper>
|