@ -5,116 +5,142 @@
<mapper namespace= "com.aucma.production.mapper.CalendarInfoMapper" >
<mapper namespace= "com.aucma.production.mapper.CalendarInfoMapper" >
<resultMap type= "CalendarInfo" id= "CalendarInfoResult" >
<resultMap type= "CalendarInfo" id= "CalendarInfoResult" >
<result property= "objId" column= "obj_id" />
<result property= "objId" column= "obj_id" />
<result property= "sapPlanCode" column= "sap_plan_code" />
<result property= "sapPlanCode" column= "sap_plan_code" />
<result property= "materialCode" column= "material_code" />
<result property= "materialCode" column= "material_code" />
<result property= "materialName" column= "material_name" />
<result property= "materialName" column= "material_name" />
<result property= "planStartDate" column= "plan_start_date" />
<result property= "planStartDate" column= "plan_start_date" />
<result property= "planEndDate" column= "plan_end_date" />
<result property= "planEndDate" column= "plan_end_date" />
<result property= "planAmount" column= "plan_amount" />
<result property= "planAmount" column= "plan_amount" />
<result property= "schedulingDate" column= "scheduling_date" />
<result property= "schedulingDate" column= "scheduling_date" />
<result property= "isScheduling" column= "is_scheduling" />
<result property= "isScheduling" column= "is_scheduling" />
<result property= "schedulingTeam" column= "scheduling_team" />
<result property= "schedulingTeam" column= "scheduling_team" />
<result property= "isFlag" column= "is_flag" />
<result property= "isFlag" column= "is_flag" />
<result property= "createdBy" column= "created_by" />
<result property= "createdBy" column= "created_by" />
<result property= "createdTime" column= "created_time" />
<result property= "createdTime" column= "created_time" />
<result property= "updatedBy" column= "updated_by" />
<result property= "updatedBy" column= "updated_by" />
<result property= "updatedTime" column= "updated_time" />
<result property= "updatedTime" column= "updated_time" />
</resultMap>
</resultMap>
<sql id= "selectCalendarInfoVo" >
<sql id= "selectCalendarInfoVo" >
select obj_id, sap_plan_code, material_code, material_name, plan_start_date, plan_end_date, plan_amount, scheduling_date, is_scheduling, scheduling_team, is_flag, created_by, created_time, updated_by, updated_time from product_calendar_info
select obj_id,
sap_plan_code,
material_code,
material_name,
plan_start_date,
plan_end_date,
plan_amount,
scheduling_date,
is_scheduling,
scheduling_team,
is_flag,
created_by,
created_time,
updated_by,
updated_time
from product_calendar_info
</sql>
</sql>
<select id= "selectCalendarInfoList" parameterType= "CalendarInfo" resultMap= "CalendarInfoResult" >
<select id= "selectCalendarInfoList" parameterType= "CalendarInfo" resultMap= "CalendarInfoResult" >
<include refid= "selectCalendarInfoVo" />
<include refid= "selectCalendarInfoVo" />
<where >
<where >
<if test= "sapPlanCode != null and sapPlanCode != ''" > and sap_plan_code = #{sapPlanCode}</if>
material_code like concat('90', '%')
<if test= "materialCode != null and materialCode != ''" > and material_code = #{materialCode}</if>
<if test= "sapPlanCode != null and sapPlanCode != ''" > and sap_plan_code = #{sapPlanCode}</if>
<if test= "materialName != null and materialName != ''" > and material_name like concat(concat('%', #{materialName}), '%')</if>
<if test= "materialCode != null and materialCode != ''" > and material_code = #{materialCode}</if>
<if test= "params.beginPlanStartDate != null and params.beginPlanStartDate != '' and params.endPlanStartDate != null and params.endPlanStartDate != ''" > and plan_start_date between to_date(#{params.beginPlanStartDate}, 'yyyy-mm-dd hh24:mi:ss') and to_date(#{params.endPlanStartDate}, 'yyyy-mm-dd hh24:mi:ss')</if>
<if test= "materialName != null and materialName != ''" > and material_name like concat(concat('%',
<if test= "planEndDate != null " > and plan_end_date = #{planEndDate}</if>
#{materialName}), '%')
<if test= "planAmount != null " > and plan_amount = #{planAmount}</if>
</if>
<if test= "params.beginSchedulingDate != null and params.beginSchedulingDate != '' and params.endSchedulingDate != null and params.endSchedulingDate != ''" > and scheduling_date between to_date(#{params.beginSchedulingDate}, 'yyyy-mm-dd hh24:mi:ss') and to_date(#{params.endSchedulingDate}, 'yyyy-mm-dd hh24:mi:ss')</if>
<if test= "params.beginPlanStartDate != null and params.beginPlanStartDate != '' and params.endPlanStartDate != null and params.endPlanStartDate != ''" >
<if test= "isScheduling != null " > and is_scheduling = #{isScheduling}</if>
and plan_start_date between to_date(#{params.beginPlanStartDate}, 'yyyy-mm-dd hh24:mi:ss') and
<if test= "schedulingTeam != null and schedulingTeam != ''" > and scheduling_team = #{schedulingTeam}</if>
to_date(#{params.endPlanStartDate}, 'yyyy-mm-dd hh24:mi:ss')
<if test= "isFlag != null " > and is_flag = #{isFlag}</if>
</if>
<if test= "createdBy != null and createdBy != ''" > and created_by = #{createdBy}</if>
<if test= "planEndDate != null " > and plan_end_date = #{planEndDate}</if>
<if test= "createdTime != null " > and created_time = #{createdTime}</if>
<if test= "planAmount != null " > and plan_amount = #{planAmount}</if>
<if test= "updatedBy != null and updatedBy != ''" > and updated_by = #{updatedBy}</if>
<if test= "params.beginSchedulingDate != null and params.beginSchedulingDate != '' and params.endSchedulingDate != null and params.endSchedulingDate != ''" >
<if test= "updatedTime != null " > and updated_time = #{updatedTime}</if>
and scheduling_date between to_date(#{params.beginSchedulingDate}, 'yyyy-mm-dd hh24:mi:ss') and
to_date(#{params.endSchedulingDate}, 'yyyy-mm-dd hh24:mi:ss')
</if>
<if test= "isScheduling != null " > and is_scheduling = #{isScheduling}</if>
<if test= "schedulingTeam != null and schedulingTeam != ''" > and scheduling_team = #{schedulingTeam}</if>
<if test= "isFlag != null " > and is_flag = #{isFlag}</if>
<if test= "createdBy != null and createdBy != ''" > and created_by = #{createdBy}</if>
<if test= "createdTime != null " > and created_time = #{createdTime}</if>
<if test= "updatedBy != null and updatedBy != ''" > and updated_by = #{updatedBy}</if>
<if test= "updatedTime != null " > and updated_time = #{updatedTime}</if>
</where>
</where>
</select>
</select>
<select id= "selectCalendarInfoByObjId" parameterType= "Long" resultMap= "CalendarInfoResult" >
<select id= "selectCalendarInfoByObjId" parameterType= "Long" resultMap= "CalendarInfoResult" >
<include refid= "selectCalendarInfoVo" />
<include refid= "selectCalendarInfoVo" />
where obj_id = #{objId}
where obj_id = #{objId}
</select>
</select>
<insert id= "insertCalendarInfo" parameterType= "CalendarInfo" >
<insert id= "insertCalendarInfo" parameterType= "CalendarInfo" >
<selectKey keyProperty= "objId" resultType= "long" order= "BEFORE" >
<selectKey keyProperty= "objId" resultType= "long" order= "BEFORE" >
SELECT seq_product_calendar_info.NEXTVAL as objId FROM DUAL
SELECT seq_product_calendar_info.NEXTVAL as objId FROM DUAL
</selectKey>
</selectKey>
insert into product_calendar_info
insert into product_calendar_info
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "objId != null" > obj_id,</if>
<if test= "objId != null" > obj_id,</if>
<if test= "sapPlanCode != null" > sap_plan_code,</if>
<if test= "sapPlanCode != null" > sap_plan_code,</if>
<if test= "materialCode != null" > material_code,</if>
<if test= "materialCode != null" > material_code,</if>
<if test= "materialName != null" > material_name,</if>
<if test= "materialName != null" > material_name,</if>
<if test= "planStartDate != null" > plan_start_date,</if>
<if test= "planStartDate != null" > plan_start_date,</if>
<if test= "planEndDate != null" > plan_end_date,</if>
<if test= "planEndDate != null" > plan_end_date,</if>
<if test= "planAmount != null" > plan_amount,</if>
<if test= "planAmount != null" > plan_amount,</if>
<if test= "schedulingDate != null" > scheduling_date,</if>
<if test= "schedulingDate != null" > scheduling_date,</if>
<if test= "isScheduling != null" > is_scheduling,</if>
<if test= "isScheduling != null" > is_scheduling,</if>
<if test= "schedulingTeam != null" > scheduling_team,</if>
<if test= "schedulingTeam != null" > scheduling_team,</if>
<if test= "isFlag != null" > is_flag,</if>
<if test= "isFlag != null" > is_flag,</if>
<if test= "createdBy != null" > created_by,</if>
<if test= "createdBy != null" > created_by,</if>
<if test= "createdTime != null" > created_time,</if>
<if test= "createdTime != null" > created_time,</if>
<if test= "updatedBy != null" > updated_by,</if>
<if test= "updatedBy != null" > updated_by,</if>
<if test= "updatedTime != null" > updated_time,</if>
<if test= "updatedTime != null" > updated_time,</if>
</trim>
</trim>
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<if test= "objId != null" > #{objId},</if>
<if test= "objId != null" > #{objId},</if>
<if test= "sapPlanCode != null" > #{sapPlanCode},</if>
<if test= "sapPlanCode != null" > #{sapPlanCode},</if>
<if test= "materialCode != null" > #{materialCode},</if>
<if test= "materialCode != null" > #{materialCode},</if>
<if test= "materialName != null" > #{materialName,jdbcType=NVARCHAR},</if>
<if test= "materialName != null" > #{materialName,jdbcType=NVARCHAR},</if>
<if test= "planStartDate != null" > #{planStartDate},</if>
<if test= "planStartDate != null" > #{planStartDate},</if>
<if test= "planEndDate != null" > #{planEndDate},</if>
<if test= "planEndDate != null" > #{planEndDate},</if>
<if test= "planAmount != null" > #{planAmount},</if>
<if test= "planAmount != null" > #{planAmount},</if>
<if test= "schedulingDate != null" > #{schedulingDate},</if>
<if test= "schedulingDate != null" > #{schedulingDate},</if>
<if test= "isScheduling != null" > #{isScheduling},</if>
<if test= "isScheduling != null" > #{isScheduling},</if>
<if test= "schedulingTeam != null" > #{schedulingTeam},</if>
<if test= "schedulingTeam != null" > #{schedulingTeam},</if>
<if test= "isFlag != null" > #{isFlag},</if>
<if test= "isFlag != null" > #{isFlag},</if>
<if test= "createdBy != null" > #{createdBy},</if>
<if test= "createdBy != null" > #{createdBy},</if>
<if test= "createdTime != null" > #{createdTime},</if>
<if test= "createdTime != null" > #{createdTime},</if>
<if test= "updatedBy != null" > #{updatedBy},</if>
<if test= "updatedBy != null" > #{updatedBy},</if>
<if test= "updatedTime != null" > #{updatedTime},</if>
<if test= "updatedTime != null" > #{updatedTime},</if>
</trim>
</trim>
</insert>
</insert>
<update id= "updateCalendarInfo" parameterType= "CalendarInfo" >
<update id= "updateCalendarInfo" parameterType= "CalendarInfo" >
update product_calendar_info
update product_calendar_info
<trim prefix= "SET" suffixOverrides= "," >
<trim prefix= "SET" suffixOverrides= "," >
<if test= "sapPlanCode != null" > sap_plan_code = #{sapPlanCode},</if>
<if test= "sapPlanCode != null" > sap_plan_code = #{sapPlanCode},</if>
<if test= "materialCode != null" > material_code = #{materialCode},</if>
<if test= "materialCode != null" > material_code = #{materialCode},</if>
<if test= "materialName != null" > material_name = #{materialName,jdbcType=NVARCHAR},</if>
<if test= "materialName != null" > material_name = #{materialName,jdbcType=NVARCHAR},</if>
<if test= "planStartDate != null" > plan_start_date = #{planStartDate},</if>
<if test= "planStartDate != null" > plan_start_date = #{planStartDate},</if>
<if test= "planEndDate != null" > plan_end_date = #{planEndDate},</if>
<if test= "planEndDate != null" > plan_end_date = #{planEndDate},</if>
<if test= "planAmount != null" > plan_amount = #{planAmount},</if>
<if test= "planAmount != null" > plan_amount = #{planAmount},</if>
<if test= "schedulingDate != null" > scheduling_date = #{schedulingDate},</if>
<if test= "schedulingDate != null" > scheduling_date = #{schedulingDate},</if>
<if test= "isScheduling != null" > is_scheduling = #{isScheduling},</if>
<if test= "isScheduling != null" > is_scheduling = #{isScheduling},</if>
<if test= "schedulingTeam != null" > scheduling_team = #{schedulingTeam},</if>
<if test= "schedulingTeam != null" > scheduling_team = #{schedulingTeam},</if>
<if test= "isFlag != null" > is_flag = #{isFlag},</if>
<if test= "isFlag != null" > is_flag = #{isFlag},</if>
<if test= "createdBy != null" > created_by = #{createdBy},</if>
<if test= "createdBy != null" > created_by = #{createdBy},</if>
<if test= "createdTime != null" > created_time = #{createdTime},</if>
<if test= "createdTime != null" > created_time = #{createdTime},</if>
<if test= "updatedBy != null" > updated_by = #{updatedBy},</if>
<if test= "updatedBy != null" > updated_by = #{updatedBy},</if>
<if test= "updatedTime != null" > updated_time = #{updatedTime},</if>
<if test= "updatedTime != null" > updated_time = #{updatedTime},</if>
</trim>
</trim>
where obj_id = #{objId}
where obj_id = #{objId}
</update>
</update>
<delete id= "deleteCalendarInfoByObjId" parameterType= "Long" >
<delete id= "deleteCalendarInfoByObjId" parameterType= "Long" >
delete from product_calendar_info where obj_id = #{objId}
delete
from product_calendar_info
where obj_id = #{objId}
</delete>
</delete>
<delete id= "deleteCalendarInfoByObjIds" parameterType= "String" >
<delete id= "deleteCalendarInfoByObjIds" parameterType= "String" >