package com.consum.model.po;
|
|
import com.walker.jdbc.BaseMapper;
|
import com.walker.jdbc.ResultSetUtils;
|
import com.walker.jdbc.SqlAndParameters;
|
import com.walker.jdbc.sqlgen.DeleteBuilder;
|
import com.walker.jdbc.sqlgen.InsertBuilder;
|
import com.walker.jdbc.sqlgen.SelectBuilder;
|
import com.walker.jdbc.sqlgen.UpdateBuilder;
|
import com.walker.jdbc.util.StringUtils;
|
|
import org.springframework.jdbc.core.RowMapper;
|
|
import java.sql.ResultSet;
|
import java.sql.SQLException;
|
import java.util.Map;
|
|
/**
|
* 表名:DEP_FORM_LENDING_GOODS_USER *
|
* @author genrator
|
*/
|
public class DepFormLendingGoodsUser_mapper extends DepFormLendingGoodsUser implements BaseMapper<DepFormLendingGoodsUser> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
public static final RowMapper<DepFormLendingGoodsUser> ROW_MAPPER = new DepFormLendingGoodsUserRowMapper();
|
|
// 主键
|
public static final String Id = "id";
|
// 普通属性
|
public static final String GoodsUserPhone = "goods_user_phone";
|
public static final String GoodsUserName = "goods_user_name";
|
public static final String NowUserPhone = "now_user_phone";
|
public static final String NowUserName = "now_user_name";
|
public static final String OperatorId = "operator_id";
|
public static final String OperatorName = "operator_name";
|
public static final String DealTime = "deal_time";
|
public static final String DepFormLendingGoodsId = "dep_form_lending_goods_id";
|
|
/**
|
* 默认构造函数
|
*/
|
public DepFormLendingGoodsUser_mapper(DepFormLendingGoodsUser depFormLendingGoodsUser) {
|
if (depFormLendingGoodsUser == null) {
|
throw new IllegalArgumentException("po参数不允许为空!");
|
}
|
//主键
|
if (depFormLendingGoodsUser.isset_id) {
|
this.setId(depFormLendingGoodsUser.getId());
|
}
|
//普通属性
|
if (depFormLendingGoodsUser.isset_goodsUserPhone) {
|
this.setGoodsUserPhone(depFormLendingGoodsUser.getGoodsUserPhone());
|
}
|
if (depFormLendingGoodsUser.isset_goodsUserName) {
|
this.setGoodsUserName(depFormLendingGoodsUser.getGoodsUserName());
|
}
|
if (depFormLendingGoodsUser.isset_nowUserPhone) {
|
this.setNowUserPhone(depFormLendingGoodsUser.getNowUserPhone());
|
}
|
if (depFormLendingGoodsUser.isset_nowUserName) {
|
this.setNowUserName(depFormLendingGoodsUser.getNowUserName());
|
}
|
if (depFormLendingGoodsUser.isset_operatorId) {
|
this.setOperatorId(depFormLendingGoodsUser.getOperatorId());
|
}
|
if (depFormLendingGoodsUser.isset_operatorName) {
|
this.setOperatorName(depFormLendingGoodsUser.getOperatorName());
|
}
|
if (depFormLendingGoodsUser.isset_dealTime) {
|
this.setDealTime(depFormLendingGoodsUser.getDealTime());
|
}
|
if (depFormLendingGoodsUser.isset_depFormLendingGoodsId) {
|
this.setDepFormLendingGoodsId(depFormLendingGoodsUser.getDepFormLendingGoodsId());
|
}
|
// 去掉,2022-09-07
|
// this.setDatabaseName_(dep_form_lending_goods_user.getDatabaseName_());
|
}
|
|
/**
|
* 获取表名
|
*/
|
@Override
|
public String getTableName_() {
|
String tableName = "dep_form_lending_goods_user";
|
/**
|
if (StringUtils.isNotEmpty(this.getDatabaseName_())) {
|
return this.getDatabaseName_() + "." + tableName;
|
} else {
|
return tableName;
|
}
|
*/
|
return tableName;
|
}
|
|
/**
|
* 获取主键名称
|
*/
|
@Override
|
public String getPkName_() {
|
return Id;
|
}
|
|
/**
|
* 获取主键值
|
*/
|
@Override
|
public Object getPkValue_() {
|
return this.getId();
|
}
|
|
/**
|
* 获取插入语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getInsertSql_() {
|
InsertBuilder ib = new InsertBuilder(this.getTableName_());
|
ib.set(Id, this.getId());
|
ib.set(GoodsUserPhone, this.getGoodsUserPhone(), this.isset_goodsUserPhone);
|
ib.set(GoodsUserName, this.getGoodsUserName(), this.isset_goodsUserName);
|
ib.set(NowUserPhone, this.getNowUserPhone(), this.isset_nowUserPhone);
|
ib.set(NowUserName, this.getNowUserName(), this.isset_nowUserName);
|
ib.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ib.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
ib.set(DealTime, this.getDealTime(), this.isset_dealTime);
|
ib.set(DepFormLendingGoodsId, this.getDepFormLendingGoodsId(), this.isset_depFormLendingGoodsId);
|
return ib.genMapSql();
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getUpdateSql_() {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(GoodsUserPhone, this.getGoodsUserPhone(), this.isset_goodsUserPhone);
|
ub.set(GoodsUserName, this.getGoodsUserName(), this.isset_goodsUserName);
|
ub.set(NowUserPhone, this.getNowUserPhone(), this.isset_nowUserPhone);
|
ub.set(NowUserName, this.getNowUserName(), this.isset_nowUserName);
|
ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
ub.set(DealTime, this.getDealTime(), this.isset_dealTime);
|
ub.set(DepFormLendingGoodsId, this.getDepFormLendingGoodsId(), this.isset_depFormLendingGoodsId);
|
ub.where(this.getPkName_(), this.getPkValue_());
|
return ub.genMapSql();
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getUpdateSql_(String where, Map<String, Object> parameters) {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(GoodsUserPhone, this.getGoodsUserPhone(), this.isset_goodsUserPhone);
|
ub.set(GoodsUserName, this.getGoodsUserName(), this.isset_goodsUserName);
|
ub.set(NowUserPhone, this.getNowUserPhone(), this.isset_nowUserPhone);
|
ub.set(NowUserName, this.getNowUserName(), this.isset_nowUserName);
|
ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
ub.set(DealTime, this.getDealTime(), this.isset_dealTime);
|
ub.set(DepFormLendingGoodsId, this.getDepFormLendingGoodsId(), this.isset_depFormLendingGoodsId);
|
return ub.genMapSql(where, parameters);
|
}
|
|
/**
|
* 获取更新语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) {
|
UpdateBuilder ub = new UpdateBuilder(this.getTableName_());
|
ub.set(GoodsUserPhone, this.getGoodsUserPhone(), this.isset_goodsUserPhone);
|
ub.set(GoodsUserName, this.getGoodsUserName(), this.isset_goodsUserName);
|
ub.set(NowUserPhone, this.getNowUserPhone(), this.isset_nowUserPhone);
|
ub.set(NowUserName, this.getNowUserName(), this.isset_nowUserName);
|
ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId);
|
ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName);
|
ub.set(DealTime, this.getDealTime(), this.isset_dealTime);
|
ub.set(DepFormLendingGoodsId, this.getDepFormLendingGoodsId(), this.isset_depFormLendingGoodsId);
|
return ub.genArraySql(where, parameters);
|
}
|
|
/**
|
* 获取删除语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getDeleteSql_() {
|
DeleteBuilder db = new DeleteBuilder(this.getTableName_());
|
db.where(this.getPkName_(), this.getPkValue_());
|
return db.genMapSql();
|
}
|
|
/**
|
* 获取删除语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getDeleteSql_(String where, Map<String, Object> parameters) {
|
DeleteBuilder db = new DeleteBuilder(this.getTableName_());
|
return db.genMapSql(where, parameters);
|
}
|
|
/**
|
* 获取删除语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getDeleteSql_(String where, Object[] parameters) {
|
DeleteBuilder db = new DeleteBuilder(this.getTableName_());
|
return db.genArraySql(where, parameters);
|
}
|
|
/**
|
* 获取单行查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getSingleSql_() {
|
SelectBuilder sb = new SelectBuilder(this.getTableName_());
|
sb.where(this.getPkName_(), this.getPkValue_());
|
return sb.genMapSql();
|
}
|
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) {
|
return new SqlAndParameters<>("select id, goods_user_phone, goods_user_name, now_user_phone, now_user_name, operator_id, operator_name, deal_time, dep_form_lending_goods_id from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 获取查询语句和参数
|
*/
|
@Override
|
public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) {
|
return new SqlAndParameters<>("select id, goods_user_phone, goods_user_name, now_user_phone, now_user_name, operator_id, operator_name, deal_time, dep_form_lending_goods_id from " + this.getTableName_() + " " + where, parameters);
|
}
|
|
/**
|
* 将resultset的一行转化为po
|
*/
|
@Override
|
public DepFormLendingGoodsUser mapRow(ResultSet rs, int i) throws SQLException {
|
return ROW_MAPPER.mapRow(rs, i);
|
}
|
|
/**
|
* 克隆
|
*/
|
public DepFormLendingGoodsUser toDepFormLendingGoodsUser() {
|
return super.$clone();
|
}
|
}
|
|
/**
|
* dep_form_lending_goods_user RowMapper
|
*
|
* @author genrator
|
*/
|
class DepFormLendingGoodsUserRowMapper implements RowMapper<DepFormLendingGoodsUser> {
|
|
@Override
|
public DepFormLendingGoodsUser mapRow(ResultSet rs, int i) throws SQLException {
|
ResultSetUtils resultSetUtils = new ResultSetUtils();
|
DepFormLendingGoodsUser dep_form_lending_goods_user = new DepFormLendingGoodsUser();
|
Integer columnIndex;
|
//主键
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLendingGoodsUser_mapper.Id);
|
if (columnIndex > 0) {
|
dep_form_lending_goods_user.setId(rs.getLong(columnIndex));
|
}
|
//普通属性
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLendingGoodsUser_mapper.GoodsUserPhone);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_lending_goods_user.setGoodsUserPhone(null);
|
} else {
|
dep_form_lending_goods_user.setGoodsUserPhone(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLendingGoodsUser_mapper.GoodsUserName);
|
if (columnIndex > 0) {
|
dep_form_lending_goods_user.setGoodsUserName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLendingGoodsUser_mapper.NowUserPhone);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_lending_goods_user.setNowUserPhone(null);
|
} else {
|
dep_form_lending_goods_user.setNowUserPhone(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLendingGoodsUser_mapper.NowUserName);
|
if (columnIndex > 0) {
|
dep_form_lending_goods_user.setNowUserName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLendingGoodsUser_mapper.OperatorId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_lending_goods_user.setOperatorId(null);
|
} else {
|
dep_form_lending_goods_user.setOperatorId(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLendingGoodsUser_mapper.OperatorName);
|
if (columnIndex > 0) {
|
dep_form_lending_goods_user.setOperatorName(rs.getString(columnIndex));
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLendingGoodsUser_mapper.DealTime);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_lending_goods_user.setDealTime(null);
|
} else {
|
dep_form_lending_goods_user.setDealTime(rs.getLong(columnIndex));
|
}
|
}
|
columnIndex = resultSetUtils.findColumn(rs, DepFormLendingGoodsUser_mapper.DepFormLendingGoodsId);
|
if (columnIndex > 0) {
|
if (rs.getBigDecimal(columnIndex) == null) {
|
dep_form_lending_goods_user.setDepFormLendingGoodsId(null);
|
} else {
|
dep_form_lending_goods_user.setDepFormLendingGoodsId(rs.getLong(columnIndex));
|
}
|
}
|
return dep_form_lending_goods_user;
|
}
|
}
|