📄 merchantcustomerinfodao.java
字号:
//张建
package com.mole.struts.dao;
import java.util.ArrayList;
import java.util.Iterator;
import com.mole.struts.bean.MerchantCustomerInfoBean;
import com.mole.struts.bean.MerchantVoucherBean;
public class MerchantCustomerInfoDAO extends AbstractDAO {
// 获取用户信息
public MerchantCustomerInfoBean getCustomerInfo(String sql) {
ArrayList<Object[]> arrayList = this.executeQuery(sql);
MerchantCustomerInfoBean record = null;
Iterator<Object[]> it = arrayList.iterator();
while (it.hasNext()) {
Object[] obj = it.next();
record = new MerchantCustomerInfoBean();
record.setId(obj[0].toString());
record.setLoginName(obj[1].toString());
record.setState(obj[2].toString());
record.setNickName(obj[3].toString());
record.setName(obj[4].toString());
record.setGender(obj[5].toString());
record.setEmail(obj[6].toString());
record.setTelephone(obj[7].toString());
record.setCellphone(obj[8].toString());
record.setAddress(obj[9].toString());
record.setCompany(obj[10].toString());
record.setCreateDate(obj[11].toString().substring(0, 10));
record.setLastLogin(obj[12].toString().substring(0, 10));
}
return record;
}
// 获取用户优惠券信息
public MerchantVoucherBean[] getCustomerVoucher(String sql) {
ArrayList<Object[]> arrayList = this.executeQuery(sql);
MerchantVoucherBean[] records = new MerchantVoucherBean[arrayList
.size()];
Iterator<Object[]> it = arrayList.iterator();
int i = 0;
while (it.hasNext()) {
Object[] obj = it.next();
MerchantVoucherBean record = new MerchantVoucherBean();
record.setName(obj[0].toString());
record.setDescription(obj[1].toString());
record.setDiscount(Double.parseDouble(obj[2].toString()));
record.setAmount(Integer.parseInt(obj[3].toString()));
record.setUsedAmount(obj[4].toString());
records[i++] = record;
}
return records;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -