package cn.ksource.beans;
|
|
import java.sql.ResultSet;
|
import java.sql.SQLException;
|
import java.util.HashMap;
|
import java.util.Iterator;
|
import java.util.List;
|
import java.util.Map;
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import cn.ksource.core.dao.BaseBean;
|
import cn.ksource.core.util.ConvertUtil;
|
import cn.ksource.core.util.StringUtil;
|
|
/**
|
* 厂商联系资料
|
*/
|
public class CMDB_MAINUFACTURER_CONTACTS extends BaseBean{
|
|
public final static Map<String, String> KEYS = new HashMap<String, String>();
|
private Map BEAN_VALUES = null;
|
|
static {
|
KEYS.put("id", "String");
|
KEYS.put("mainufactureerid", "String");
|
KEYS.put("contacts", "String");
|
KEYS.put("telphone", "String");
|
KEYS.put("mobile", "String");
|
KEYS.put("companyaddress", "String");
|
KEYS.put("job", "String");
|
KEYS.put("customer_id", "String");
|
KEYS.put("level", "Integer");
|
KEYS.put("project_link_introduce", "String");
|
KEYS.put("create_time", "Long");
|
KEYS.put("user_id", "String");
|
KEYS.put("user_name", "String");
|
KEYS.put("del_flag", "Integer");
|
KEYS.put("flow_id", "String");
|
KEYS.put("name_pinyin", "String");
|
}
|
public Map getColumnMap(){
|
return KEYS;
|
}
|
|
private String id;
|
private Boolean isSetted_id = false;;
|
|
private String mainufactureerid;
|
private Boolean isSetted_mainufactureerid = false;
|
private String contacts;
|
private Boolean isSetted_contacts = false;
|
private String telphone;
|
private Boolean isSetted_telphone = false;
|
private String mobile;
|
private Boolean isSetted_mobile = false;
|
private String companyaddress;
|
private Boolean isSetted_companyaddress = false;
|
private String job;
|
private Boolean isSetted_job = false;
|
private String customer_id;
|
private Boolean isSetted_customer_id = false;
|
private Integer level;
|
private Boolean isSetted_level = false;
|
private String project_link_introduce;
|
private Boolean isSetted_project_link_introduce = false;
|
private Long create_time;
|
private Boolean isSetted_create_time = false;
|
private String user_id;
|
private Boolean isSetted_user_id = false;
|
private String user_name;
|
private Boolean isSetted_user_name = false;
|
private Integer del_flag;
|
private Boolean isSetted_del_flag = false;
|
private String flow_id;
|
private Boolean isSetted_flow_id = false;
|
private String name_pinyin;
|
private Boolean isSetted_name_pinyin = false;
|
|
private void initBeanValues(){
|
BEAN_VALUES = new HashMap<String, Object>();
|
BEAN_VALUES.put("id",id);
|
BEAN_VALUES.put("mainufactureerid", null);
|
BEAN_VALUES.put("contacts", null);
|
BEAN_VALUES.put("telphone", null);
|
BEAN_VALUES.put("mobile", null);
|
BEAN_VALUES.put("companyaddress", null);
|
BEAN_VALUES.put("job", null);
|
BEAN_VALUES.put("customer_id", null);
|
BEAN_VALUES.put("level", null);
|
BEAN_VALUES.put("project_link_introduce", null);
|
BEAN_VALUES.put("create_time", null);
|
BEAN_VALUES.put("user_id", null);
|
BEAN_VALUES.put("user_name", null);
|
BEAN_VALUES.put("del_flag", null);
|
BEAN_VALUES.put("flow_id", null);
|
BEAN_VALUES.put("name_pinyin", null);
|
}
|
|
public CMDB_MAINUFACTURER_CONTACTS() {
|
initBeanValues();
|
}
|
|
public CMDB_MAINUFACTURER_CONTACTS(String id) {
|
super();
|
this.id = id;
|
initBeanValues();
|
BEAN_VALUES.put("id",id);
|
}
|
|
/**
|
* 获取ID
|
*/
|
public String getId() {
|
return this.id;
|
}
|
/**
|
* 设置ID
|
*/
|
public CMDB_MAINUFACTURER_CONTACTS setId(String id) {
|
this.id = id;
|
this.isSetted_id = true;
|
BEAN_VALUES.put("id",id);
|
return this;
|
}
|
|
@Override
|
public String getUpdateSql() {
|
StringBuffer sBuffer = new StringBuffer("update CMDB_MAINUFACTURER_CONTACTS set ");
|
if (isSetted_mainufactureerid) {
|
sBuffer.append("mainufactureerid=:mainufactureerid,");
|
}
|
if (isSetted_contacts) {
|
sBuffer.append("contacts=:contacts,");
|
}
|
if (isSetted_telphone) {
|
sBuffer.append("telphone=:telphone,");
|
}
|
if (isSetted_mobile) {
|
sBuffer.append("mobile=:mobile,");
|
}
|
if (isSetted_companyaddress) {
|
sBuffer.append("companyaddress=:companyaddress,");
|
}
|
if (isSetted_job) {
|
sBuffer.append("job=:job,");
|
}
|
if (isSetted_customer_id) {
|
sBuffer.append("customer_id=:customer_id,");
|
}
|
if (isSetted_level) {
|
sBuffer.append("level=:level,");
|
}
|
if (isSetted_project_link_introduce) {
|
sBuffer.append("project_link_introduce=:project_link_introduce,");
|
}
|
if (isSetted_create_time) {
|
sBuffer.append("create_time=:create_time,");
|
}
|
if (isSetted_user_id) {
|
sBuffer.append("user_id=:user_id,");
|
}
|
if (isSetted_user_name) {
|
sBuffer.append("user_name=:user_name,");
|
}
|
if (isSetted_del_flag) {
|
sBuffer.append("del_flag=:del_flag,");
|
}
|
if (isSetted_flow_id) {
|
sBuffer.append("flow_id=:flow_id,");
|
}
|
if (isSetted_name_pinyin) {
|
sBuffer.append("name_pinyin=:name_pinyin,");
|
}
|
String sql = sBuffer.toString();
|
return StringUtils.removeEnd(sql, ",") + " where id=:id";
|
}
|
|
|
@Override
|
public String getInsertSql() {
|
StringBuffer sBuffer = new StringBuffer("insert into CMDB_MAINUFACTURER_CONTACTS(");
|
StringBuffer fileds = new StringBuffer("id,");
|
StringBuffer values = new StringBuffer(":id,");
|
fileds.append("mainufactureerid,");
|
values.append(":mainufactureerid,");
|
fileds.append("contacts,");
|
values.append(":contacts,");
|
fileds.append("telphone,");
|
values.append(":telphone,");
|
fileds.append("mobile,");
|
values.append(":mobile,");
|
fileds.append("companyaddress,");
|
values.append(":companyaddress,");
|
fileds.append("job,");
|
values.append(":job,");
|
fileds.append("customer_id,");
|
values.append(":customer_id,");
|
fileds.append("level,");
|
values.append(":level,");
|
fileds.append("project_link_introduce,");
|
values.append(":project_link_introduce,");
|
fileds.append("create_time,");
|
values.append(":create_time,");
|
fileds.append("user_id,");
|
values.append(":user_id,");
|
fileds.append("user_name,");
|
values.append(":user_name,");
|
fileds.append("del_flag,");
|
values.append(":del_flag,");
|
fileds.append("flow_id,");
|
values.append(":flow_id,");
|
fileds.append("name_pinyin,");
|
values.append(":name_pinyin,");
|
sBuffer.append(StringUtils.removeEnd(fileds.toString(), ",") + ") values("+StringUtils.removeEnd(values.toString(), ",")+")");
|
return sBuffer.toString();
|
}
|
|
|
/**
|
* 获取厂商编号<BR/>
|
* 䣺2016-13-04 hh:07
|
*/
|
public String getMainufactureerid() {
|
return mainufactureerid;
|
}
|
/**
|
* 设置厂商编号<BR/>
|
* 2016-13-04 hh:07
|
*/
|
public CMDB_MAINUFACTURER_CONTACTS setMainufactureerid(String mainufactureerid) {
|
this.mainufactureerid = mainufactureerid;
|
this.isSetted_mainufactureerid = true;
|
BEAN_VALUES.put("mainufactureerid",mainufactureerid);
|
return this;
|
}
|
/**
|
* 获取联系人<BR/>
|
* 䣺2016-13-04 hh:07
|
*/
|
public String getContacts() {
|
return contacts;
|
}
|
/**
|
* 设置联系人<BR/>
|
* 2016-13-04 hh:07
|
*/
|
public CMDB_MAINUFACTURER_CONTACTS setContacts(String contacts) {
|
this.contacts = contacts;
|
this.isSetted_contacts = true;
|
BEAN_VALUES.put("contacts",contacts);
|
return this;
|
}
|
/**
|
* 获取联系电话<BR/>
|
* 䣺2016-13-04 hh:07
|
*/
|
public String getTelphone() {
|
return telphone;
|
}
|
/**
|
* 设置联系电话<BR/>
|
* 2016-13-04 hh:07
|
*/
|
public CMDB_MAINUFACTURER_CONTACTS setTelphone(String telphone) {
|
this.telphone = telphone;
|
this.isSetted_telphone = true;
|
BEAN_VALUES.put("telphone",telphone);
|
return this;
|
}
|
/**
|
* 获取手机号码<BR/>
|
* 䣺2016-13-04 hh:07
|
*/
|
public String getMobile() {
|
return mobile;
|
}
|
/**
|
* 设置手机号码<BR/>
|
* 2016-13-04 hh:07
|
*/
|
public CMDB_MAINUFACTURER_CONTACTS setMobile(String mobile) {
|
this.mobile = mobile;
|
this.isSetted_mobile = true;
|
BEAN_VALUES.put("mobile",mobile);
|
return this;
|
}
|
/**
|
* 获取公司地址<BR/>
|
* 䣺2016-13-04 hh:07
|
*/
|
public String getCompanyaddress() {
|
return companyaddress;
|
}
|
/**
|
* 设置公司地址<BR/>
|
* 2016-13-04 hh:07
|
*/
|
public CMDB_MAINUFACTURER_CONTACTS setCompanyaddress(String companyaddress) {
|
this.companyaddress = companyaddress;
|
this.isSetted_companyaddress = true;
|
BEAN_VALUES.put("companyaddress",companyaddress);
|
return this;
|
}
|
/**
|
* 获取职务<BR/>
|
* 䣺2016-13-04 hh:07
|
*/
|
public String getJob() {
|
return job;
|
}
|
/**
|
* 设置职务<BR/>
|
* 2016-13-04 hh:07
|
*/
|
public CMDB_MAINUFACTURER_CONTACTS setJob(String job) {
|
this.job = job;
|
this.isSetted_job = true;
|
BEAN_VALUES.put("job",job);
|
return this;
|
}
|
/**
|
* 获取客户编号<BR/>
|
* 䣺2016-13-04 hh:07
|
*/
|
public String getCustomer_id() {
|
return customer_id;
|
}
|
/**
|
* 设置客户编号<BR/>
|
* 2016-13-04 hh:07
|
*/
|
public CMDB_MAINUFACTURER_CONTACTS setCustomer_id(String customer_id) {
|
this.customer_id = customer_id;
|
this.isSetted_customer_id = true;
|
BEAN_VALUES.put("customer_id",customer_id);
|
return this;
|
}
|
/**
|
* 获取重要等级【1:高 2:中 3:低】<BR/>
|
* 䣺2016-13-04 hh:07
|
*/
|
public Integer getLevel() {
|
return level;
|
}
|
/**
|
* 设置重要等级【1:高 2:中 3:低】<BR/>
|
* 2016-13-04 hh:07
|
*/
|
public CMDB_MAINUFACTURER_CONTACTS setLevel(Integer level) {
|
this.level = level;
|
this.isSetted_level = true;
|
BEAN_VALUES.put("level",level);
|
return this;
|
}
|
/**
|
* 获取项目干系介绍<BR/>
|
* 䣺2016-13-04 hh:07
|
*/
|
public String getProject_link_introduce() {
|
return project_link_introduce;
|
}
|
/**
|
* 设置项目干系介绍<BR/>
|
* 2016-13-04 hh:07
|
*/
|
public CMDB_MAINUFACTURER_CONTACTS setProject_link_introduce(String project_link_introduce) {
|
this.project_link_introduce = project_link_introduce;
|
this.isSetted_project_link_introduce = true;
|
BEAN_VALUES.put("project_link_introduce",project_link_introduce);
|
return this;
|
}
|
/**
|
* 获取添加时间<BR/>
|
* 䣺2016-13-04 hh:07
|
*/
|
public Long getCreate_time() {
|
return create_time;
|
}
|
/**
|
* 设置添加时间<BR/>
|
* 2016-13-04 hh:07
|
*/
|
public CMDB_MAINUFACTURER_CONTACTS setCreate_time(Long create_time) {
|
this.create_time = create_time;
|
this.isSetted_create_time = true;
|
BEAN_VALUES.put("create_time",create_time);
|
return this;
|
}
|
/**
|
* 获取添加人<BR/>
|
* 䣺2016-13-04 hh:07
|
*/
|
public String getUser_id() {
|
return user_id;
|
}
|
/**
|
* 设置添加人<BR/>
|
* 2016-13-04 hh:07
|
*/
|
public CMDB_MAINUFACTURER_CONTACTS setUser_id(String user_id) {
|
this.user_id = user_id;
|
this.isSetted_user_id = true;
|
BEAN_VALUES.put("user_id",user_id);
|
return this;
|
}
|
/**
|
* 获取添加人名称<BR/>
|
* 䣺2016-13-04 hh:07
|
*/
|
public String getUser_name() {
|
return user_name;
|
}
|
/**
|
* 设置添加人名称<BR/>
|
* 2016-13-04 hh:07
|
*/
|
public CMDB_MAINUFACTURER_CONTACTS setUser_name(String user_name) {
|
this.user_name = user_name;
|
this.isSetted_user_name = true;
|
BEAN_VALUES.put("user_name",user_name);
|
return this;
|
}
|
/**
|
* 获取删除标志【1:未删除 2:已删除】<BR/>
|
* 䣺2016-13-04 hh:07
|
*/
|
public Integer getDel_flag() {
|
return del_flag;
|
}
|
/**
|
* 设置删除标志【1:未删除 2:已删除】<BR/>
|
* 2016-13-04 hh:07
|
*/
|
public CMDB_MAINUFACTURER_CONTACTS setDel_flag(Integer del_flag) {
|
this.del_flag = del_flag;
|
this.isSetted_del_flag = true;
|
BEAN_VALUES.put("del_flag",del_flag);
|
return this;
|
}
|
/**
|
* 获取流程编号<BR/>
|
* 䣺2016-13-04 hh:07
|
*/
|
public String getFlow_id() {
|
return flow_id;
|
}
|
/**
|
* 设置流程编号<BR/>
|
* 2016-13-04 hh:07
|
*/
|
public CMDB_MAINUFACTURER_CONTACTS setFlow_id(String flow_id) {
|
this.flow_id = flow_id;
|
this.isSetted_flow_id = true;
|
BEAN_VALUES.put("flow_id",flow_id);
|
return this;
|
}
|
/**
|
* 获取名称拼音<BR/>
|
* 䣺2016-13-04 hh:07
|
*/
|
public String getName_pinyin() {
|
return name_pinyin;
|
}
|
/**
|
* 设置名称拼音<BR/>
|
* 2016-13-04 hh:07
|
*/
|
public CMDB_MAINUFACTURER_CONTACTS setName_pinyin(String name_pinyin) {
|
this.name_pinyin = name_pinyin;
|
this.isSetted_name_pinyin = true;
|
BEAN_VALUES.put("name_pinyin",name_pinyin);
|
return this;
|
}
|
|
/**
|
* 使用ID删除Bean<BR/>
|
*/
|
public void deleteById() {
|
if (StringUtils.isBlank(id)) {
|
throw new RuntimeException("删除bean时ID不能为空");
|
}
|
dao.execute("delete from " + getTableName() + " where id = :id", BEAN_VALUES);
|
}
|
|
@Override
|
public CMDB_MAINUFACTURER_CONTACTS getInstanceById() {
|
if (StringUtils.isBlank(id)) {
|
throw new RuntimeException("获取Bean时ID不能为空");
|
}
|
return dao.queryForBean("select * from " + getTableName() + " where id=:id", BEAN_VALUES, this);
|
}
|
|
|
|
@Override
|
public CMDB_MAINUFACTURER_CONTACTS queryForBean() {
|
StringBuffer sBuffer = new StringBuffer("select * from CMDB_MAINUFACTURER_CONTACTS where ");
|
if(isSetted_id){
|
sBuffer.append("id=:id and ");
|
}
|
if (isSetted_mainufactureerid) {
|
sBuffer.append("mainufactureerid=:mainufactureerid and ");
|
}
|
if (isSetted_contacts) {
|
sBuffer.append("contacts=:contacts and ");
|
}
|
if (isSetted_telphone) {
|
sBuffer.append("telphone=:telphone and ");
|
}
|
if (isSetted_mobile) {
|
sBuffer.append("mobile=:mobile and ");
|
}
|
if (isSetted_companyaddress) {
|
sBuffer.append("companyaddress=:companyaddress and ");
|
}
|
if (isSetted_job) {
|
sBuffer.append("job=:job and ");
|
}
|
if (isSetted_customer_id) {
|
sBuffer.append("customer_id=:customer_id and ");
|
}
|
if (isSetted_level) {
|
sBuffer.append("level=:level and ");
|
}
|
if (isSetted_project_link_introduce) {
|
sBuffer.append("project_link_introduce=:project_link_introduce and ");
|
}
|
if (isSetted_create_time) {
|
sBuffer.append("create_time=:create_time and ");
|
}
|
if (isSetted_user_id) {
|
sBuffer.append("user_id=:user_id and ");
|
}
|
if (isSetted_user_name) {
|
sBuffer.append("user_name=:user_name and ");
|
}
|
if (isSetted_del_flag) {
|
sBuffer.append("del_flag=:del_flag and ");
|
}
|
if (isSetted_flow_id) {
|
sBuffer.append("flow_id=:flow_id and ");
|
}
|
if (isSetted_name_pinyin) {
|
sBuffer.append("name_pinyin=:name_pinyin and ");
|
}
|
String sql = sBuffer.toString();
|
sql = StringUtils.removeEnd(sql, " and ");
|
return dao.queryForBean(sql,this);
|
}
|
|
@Override
|
public String getTableName() {
|
return "CMDB_MAINUFACTURER_CONTACTS";
|
}
|
|
|
public Map getBeanValues(){
|
return this.BEAN_VALUES;
|
}
|
|
@Override
|
public CMDB_MAINUFACTURER_CONTACTS insert() {
|
if (StringUtils.isBlank(id)) {
|
this.setId(StringUtil.getUUID());
|
}
|
dao.execute(getInsertSql(),BEAN_VALUES);
|
return this;
|
}
|
|
@Override
|
public CMDB_MAINUFACTURER_CONTACTS update() {
|
if (StringUtils.isBlank(id)) {
|
throw new RuntimeException("更新Bean时ID不能为空");
|
}
|
dao.execute(getUpdateSql(),BEAN_VALUES);
|
return this;
|
}
|
|
public CMDB_MAINUFACTURER_CONTACTS insertOrUpdate(){
|
if (StringUtils.isNotBlank(id)) {
|
return update();
|
} else {
|
return insert();
|
}
|
}
|
|
/**
|
* 通过ID获取该条信息的Map结构
|
*/
|
public Map getBeanMapById() {
|
|
if (StringUtils.isBlank(id)) {
|
throw new RuntimeException("ID不能为空!");
|
}
|
|
return dao.queryForMap("select * from CMDB_MAINUFACTURER_CONTACTS where id=:id",BEAN_VALUES);
|
}
|
|
public Object mapRow(ResultSet rs, int rownum) throws SQLException {
|
Object id = rs.getObject("ID");
|
this.setId(ConvertUtil.obj2Str(id));
|
BEAN_VALUES.put("id",id);
|
Object obj = null;
|
obj = rs.getObject("MAINUFACTUREERID");
|
BEAN_VALUES.put("mainufactureerid",obj);
|
this.setMainufactureerid(ConvertUtil.obj2Str(obj));
|
obj = rs.getObject("CONTACTS");
|
BEAN_VALUES.put("contacts",obj);
|
this.setContacts(ConvertUtil.obj2Str(obj));
|
obj = rs.getObject("TELPHONE");
|
BEAN_VALUES.put("telphone",obj);
|
this.setTelphone(ConvertUtil.obj2Str(obj));
|
obj = rs.getObject("MOBILE");
|
BEAN_VALUES.put("mobile",obj);
|
this.setMobile(ConvertUtil.obj2Str(obj));
|
obj = rs.getObject("COMPANYADDRESS");
|
BEAN_VALUES.put("companyaddress",obj);
|
this.setCompanyaddress(ConvertUtil.obj2Str(obj));
|
obj = rs.getObject("JOB");
|
BEAN_VALUES.put("job",obj);
|
this.setJob(ConvertUtil.obj2Str(obj));
|
obj = rs.getObject("CUSTOMER_ID");
|
BEAN_VALUES.put("customer_id",obj);
|
this.setCustomer_id(ConvertUtil.obj2Str(obj));
|
obj = rs.getObject("LEVEL");
|
BEAN_VALUES.put("level",obj);
|
this.setLevel(ConvertUtil.obj2Integer(obj));
|
obj = rs.getObject("PROJECT_LINK_INTRODUCE");
|
BEAN_VALUES.put("project_link_introduce",obj);
|
this.setProject_link_introduce(ConvertUtil.obj2Str(obj));
|
obj = rs.getObject("CREATE_TIME");
|
BEAN_VALUES.put("create_time",obj);
|
this.setCreate_time(ConvertUtil.obj2Long(obj));
|
obj = rs.getObject("USER_ID");
|
BEAN_VALUES.put("user_id",obj);
|
this.setUser_id(ConvertUtil.obj2Str(obj));
|
obj = rs.getObject("USER_NAME");
|
BEAN_VALUES.put("user_name",obj);
|
this.setUser_name(ConvertUtil.obj2Str(obj));
|
obj = rs.getObject("DEL_FLAG");
|
BEAN_VALUES.put("del_flag",obj);
|
this.setDel_flag(ConvertUtil.obj2Integer(obj));
|
obj = rs.getObject("FLOW_ID");
|
BEAN_VALUES.put("flow_id",obj);
|
this.setFlow_id(ConvertUtil.obj2Str(obj));
|
obj = rs.getObject("NAME_PINYIN");
|
BEAN_VALUES.put("name_pinyin",obj);
|
this.setName_pinyin(ConvertUtil.obj2Str(obj));
|
return this;
|
}
|
|
|
public String toString() {
|
StringBuffer sb = new StringBuffer("[");
|
for (Iterator iterator = KEYS.keySet().iterator(); iterator.hasNext();) {
|
String key = (String) iterator.next();
|
sb.append(key+"=" + BEAN_VALUES.get(key)+",");
|
}
|
sb.append("]");
|
return sb.toString();
|
}
|
|
public CMDB_MAINUFACTURER_CONTACTS newInstance(){
|
return new CMDB_MAINUFACTURER_CONTACTS();
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|