//bean文件
package com.tzsw.newapps.xylr.entity;
import java.util.Date;
import java.util.List;
import com.app.common.entity.EntitySupport;
import com.tzsw.newapps.extendfield.entity.Rl03;
public class Rl01 extends EntitySupport {
private String BRL001;//协议基本信息
private String BRL002;//协议类型
private String BRL003;//委托方
private String BRL004;//服务方
private String BRL005;//签约方
private Date BRL006;//合同期限
private String BRL007;//业务经办责任人
private String BRL008;//服务内容
private String BRL009;//服务价格
private String BRL00A;//其他预定事项
private String list;//删除选项
private List list1;
private String bsc001;//机构内码
public String getBsc001() {
return bsc001;
}
public void setBsc001(String bsc001) {
this.bsc001 = bsc001;
}
public List getList1() {
return list1;
}
public void setList1(List list1) {
this.list1 = list1;
}
public String getList() {
return list;
}
public void setList(String list) {
this.list = list;
}
public String getBRL001() {
return BRL001;
}
public void setBRL001(String bRL001) {
BRL001 = bRL001;
}
public String getBRL002() {
return BRL002;
}
public void setBRL002(String bRL002) {
BRL002 = bRL002;
}
public String getBRL003() {
return BRL003;
}
public void setBRL003(String bRL003) {
BRL003 = bRL003;
}
public String getBRL004() {
return BRL004;
}
public void setBRL004(String bRL004) {
BRL004 = bRL004;
}
public String getBRL005() {
return BRL005;
}
public void setBRL005(String bRL005) {
BRL005 = bRL005;
}
public Date getBRL006() {
return BRL006;
}
public void setBRL006(Date bRL006) {
BRL006 = bRL006;
}
public String getBRL007() {
return BRL007;
}
public void setBRL007(String bRL007) {
BRL007 = bRL007;
}
public String getBRL008() {
return BRL008;
}
public void setBRL008(String bRL008) {
BRL008 = bRL008;
}
public String getBRL009() {
return BRL009;
}
public void setBRL009(String bRL009) {
BRL009 = bRL009;
}
public String getBRL00A() {
return BRL00A;
}
public void setBRL00A(String bRL00A) {
BRL00A = bRL00A;
}
}
//action 中的方法
public String delete_rl01() {
HttpServletResponse res = ServletActionContext.getResponse();
HttpServletRequest req = ServletActionContext.getRequest();
String list = req.getParameter("ids");
List<String> list1 = new ArrayList<String>();
String[] templist = list.split(",");
String id=templist[0];
StringBuffer sblist = new StringBuffer();
for (int i = 0; i < templist.length; i++) {
sblist.append("'").append(templist[i]).append("'");
if (i < (templist.length - 1)) {
sblist.append(",");
}
list1.add(templist[i]);
}
String lastlist = sblist.toString();
Rl01 rl01 = new Rl01();
if (list != null) {
rl01.setList(lastlist);
rl01.setList1(list1);
}
try {
DataMap dataMap;
dataMap = Rl01Services.delete_rl01(rl01);
Rl03 rl03=new Rl03();
String tbname="";//表名
Aa10 aa10=new Aa10();
aa10.setAaa100("BRL023");
aa10.setAaa102("1");
List<Aa10> tb=aa10Services.edit_aa10(aa10);
if(tb!=null){
tbname=tb.get(0).getAae013();
}
System.out.println(tbname+"-"+id);
rl03.setBrl034(tbname+"-"+id);
Rl03Services.delete_rl03(rl03);
PrintWriter writer = res.getWriter();
writer.print("{}");
writer.flush();
writer.close();
} catch (Exception e) {
System.out.println(e);
}
return null;
}
//mybatis配置文件
<delete id="delete_rl01" parameterType="list">
<![CDATA[
delete Rl01 where BRL001 in
]]>
<foreach collection="list1" item="ids" open="(" separator="," close=")">
#{ids}
</foreach>
</delete>
//mybatis批量修改
<update id="updatesh_ab21" parameterType="list">
update ab21 set
<include refid="updatesh_ab21_sql"/>
bab212 = #{bab212, jdbcType=VARCHAR} where bab021 in
<foreach collection="listsh" item="ids" open="(" separator="," close=")">
#{ids}
</foreach>
</update>
<sql id="updatesh_ab21_sql">
<if test="bab211!=null and bab211 != ''">
bab211 = #{bab211, jdbcType=VARCHAR},
</if>
</sql>
//批量选中
<if test="sellist!=null">
and bab021 in
<foreach collection="sellist" item="ids" open="(" separator="," close=")">
#{ids}
</foreach>
</if>