List 的map配置
类
public class TrainingTask extends AbsBusinessObject {
private Topic topic=null;//实训主题
private Date startDate=null;//实训开始时间
private Date endDate=null;//实训结束时间
private int practiceCount=0;//实训实践课时数
private int theoryCount=0;//实训理论课时数
private List teachers=null;//实训导师
private List classes=null;//实训班级
private List students=null;//实训学生
xml配置
id,name,createDate,status,description,startDate,endDate,practiceCount,theoryCount,user,org,actor,topic,topicName
id,
name,
createDate,
description,
startDate,
endDate,
practiceCount,
theoryCount,
status,
topic,
user,
actor,
org,
#{id},
#{name},
#{createDate},
#{description},
#{startDate},
#{endDate},
#{practiceCount},
#{theoryCount},
#{status},
#{topic.id},
#{user.id},
#{actor.id},
#{org.id},
#{item.id},
#{item.name},
#{item.createDate},
#{item.description},
#{item.startDate},
#{item.endDate},
#{item.practiceCount},
#{item.theoryCount},
#{item.status},
#{item.topic.id},
#{item.user.id},
#{item.actor.id},
#{item.org.id},
name like '%${name}%' and
org='${org}' and
insert into trainms_trainingtask (
) values (
);
insert into trainms_trainingtask_teachers (
id,teacher,parent
) values
(
'${item.id}','${item.id}','${id}'
);
insert into trainms_trainingtask_students (
id,student,parent
) values
(
'${item.id}','${item.id}','${id}'
);
insert into trainms_trainingtask_classes (
id,class,parent
) values
(
'${item.id}','${item.id}','${id}'
);
insert into trainms_trainingtask (
) values
(
);
update trainms_trainingtask set
name=#{name},
createDate=#{createDate},
description=#{description},
startDate=#{startDate},
endDate=#{endDate},
practiceCount=#{practiceCount},
theoryCount=#{theoryCount},
status=#{status},
user=#{user.id},
actor=#{actor.id},
org=#{org.id},
where id=#{oldId,jdbcType=VARCHAR}
update trainms_trainingtask set
name=#{item.name},
createDate=#{item.createDate},
description=#{item.description},
startDate=#{item.startDate},
endDate=#{item.endDate},
practiceCount=#{item.practiceCount},
theoryCount=#{item.theoryCount},
status=#{item.status},
user=#{item.user.id},
actor=#{item.actor.id},
org=#{item.org.id},
where id=#{item.oldId,jdbcType=VARCHAR}
update trainms_trainingtask set status=#{status} where id=#{id}
delete from trainms_trainingtask where id = #{id,jdbcType=VARCHAR}
delete from trainms_trainingtask
id in
#{item,jdbcType=VARCHAR}