| | |
| | | package com.consum.model.po; |
| | | |
| | | import java.sql.ResultSet; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import com.walker.jdbc.BaseMapper; |
| | | import com.walker.jdbc.ResultSetUtils; |
| | | import com.walker.jdbc.SqlAndParameters; |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 表名:BASE_GOODS_MODELS * |
| | | * |
| | | * @author genrator |
| | | */ |
| | | public class BaseGoodsModels_mapper extends BaseGoodsModels implements BaseMapper<BaseGoodsModels> { |
| | |
| | | public static final String ModelName = "model_name"; |
| | | public static final String States = "states"; |
| | | public static final String GoodsTemplatesId = "goods_templates_id"; |
| | | public static final String Unit = "unit"; |
| | | public static final String OrderNumber = "order_number"; |
| | | public static final String CreateTime = "create_time"; |
| | | |
| | | /** |
| | | * 默认构造函数 |
| | |
| | | if (baseGoodsModels == null) { |
| | | throw new IllegalArgumentException("po参数不允许为空!"); |
| | | } |
| | | //主键 |
| | | // 主键 |
| | | if (baseGoodsModels.isset_id) { |
| | | this.setId(baseGoodsModels.getId()); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | if (baseGoodsModels.isset_modelName) { |
| | | this.setModelName(baseGoodsModels.getModelName()); |
| | | } |
| | |
| | | if (baseGoodsModels.isset_goodsTemplatesId) { |
| | | this.setGoodsTemplatesId(baseGoodsModels.getGoodsTemplatesId()); |
| | | } |
| | | if (baseGoodsModels.isset_unit) { |
| | | this.setUnit(baseGoodsModels.getUnit()); |
| | | } |
| | | if (baseGoodsModels.isset_orderNumber) { |
| | | this.setOrderNumber(baseGoodsModels.getOrderNumber()); |
| | | } |
| | | if (baseGoodsModels.isset_createTime) { |
| | | this.setCreateTime(baseGoodsModels.getCreateTime()); |
| | | } |
| | | // 去掉,2022-09-07 |
| | | // this.setDatabaseName_(base_goods_models.getDatabaseName_()); |
| | |
| | | public String getTableName_() { |
| | | String tableName = "base_goods_models"; |
| | | /** |
| | | if (StringUtils.isNotEmpty(this.getDatabaseName_())) { |
| | | return this.getDatabaseName_() + "." + tableName; |
| | | } else { |
| | | return tableName; |
| | | } |
| | | */ |
| | | * if (StringUtils.isNotEmpty(this.getDatabaseName_())) { return this.getDatabaseName_() + "." + tableName; } |
| | | * else { return tableName; } |
| | | */ |
| | | return tableName; |
| | | } |
| | | |
| | |
| | | ib.set(ModelName, this.getModelName(), this.isset_modelName); |
| | | ib.set(States, this.getStates(), this.isset_states); |
| | | ib.set(GoodsTemplatesId, this.getGoodsTemplatesId(), this.isset_goodsTemplatesId); |
| | | ib.set(Unit, this.getUnit(), this.isset_unit); |
| | | ib.set(OrderNumber, this.getOrderNumber(), this.isset_orderNumber); |
| | | ib.set(CreateTime, this.getCreateTime(), this.isset_createTime); |
| | | return ib.genMapSql(); |
| | | } |
| | | |
| | |
| | | ub.set(ModelName, this.getModelName(), this.isset_modelName); |
| | | ub.set(States, this.getStates(), this.isset_states); |
| | | ub.set(GoodsTemplatesId, this.getGoodsTemplatesId(), this.isset_goodsTemplatesId); |
| | | ub.set(Unit, this.getUnit(), this.isset_unit); |
| | | ub.set(OrderNumber, this.getOrderNumber(), this.isset_orderNumber); |
| | | ub.set(CreateTime, this.getCreateTime(), this.isset_createTime); |
| | | ub.where(this.getPkName_(), this.getPkValue_()); |
| | | return ub.genMapSql(); |
| | | } |
| | |
| | | ub.set(ModelName, this.getModelName(), this.isset_modelName); |
| | | ub.set(States, this.getStates(), this.isset_states); |
| | | ub.set(GoodsTemplatesId, this.getGoodsTemplatesId(), this.isset_goodsTemplatesId); |
| | | ub.set(Unit, this.getUnit(), this.isset_unit); |
| | | ub.set(OrderNumber, this.getOrderNumber(), this.isset_orderNumber); |
| | | ub.set(CreateTime, this.getCreateTime(), this.isset_createTime); |
| | | return ub.genMapSql(where, parameters); |
| | | } |
| | | |
| | |
| | | ub.set(ModelName, this.getModelName(), this.isset_modelName); |
| | | ub.set(States, this.getStates(), this.isset_states); |
| | | ub.set(GoodsTemplatesId, this.getGoodsTemplatesId(), this.isset_goodsTemplatesId); |
| | | ub.set(Unit, this.getUnit(), this.isset_unit); |
| | | ub.set(OrderNumber, this.getOrderNumber(), this.isset_orderNumber); |
| | | ub.set(CreateTime, this.getCreateTime(), this.isset_createTime); |
| | | return ub.genArraySql(where, parameters); |
| | | } |
| | | |
| | |
| | | return sb.genMapSql(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取查询语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, model_name, states, goods_templates_id, order_number from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, model_name, states, goods_templates_id, unit, order_number, create_time from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, model_name, states, goods_templates_id, order_number from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>( |
| | | "select id, model_name, states, goods_templates_id, unit, order_number, create_time from " |
| | | + this.getTableName_() + " " + where, |
| | | parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | ResultSetUtils resultSetUtils = new ResultSetUtils(); |
| | | BaseGoodsModels base_goods_models = new BaseGoodsModels(); |
| | | Integer columnIndex; |
| | | //主键 |
| | | // 主键 |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseGoodsModels_mapper.Id); |
| | | if (columnIndex > 0) { |
| | | base_goods_models.setId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | // 普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseGoodsModels_mapper.ModelName); |
| | | if (columnIndex > 0) { |
| | | base_goods_models.setModelName(rs.getString(columnIndex)); |
| | |
| | | base_goods_models.setGoodsTemplatesId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseGoodsModels_mapper.Unit); |
| | | if (columnIndex > 0) { |
| | | base_goods_models.setUnit(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseGoodsModels_mapper.OrderNumber); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | |
| | | base_goods_models.setOrderNumber(rs.getInt(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, BaseGoodsModels_mapper.CreateTime); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | base_goods_models.setCreateTime(null); |
| | | } else { |
| | | base_goods_models.setCreateTime(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | return base_goods_models; |
| | | } |
| | | } |