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; /** * 表名:L_GOODS_USER_RECORD * * @author genrator */ public class LGoodsUserRecord_mapper extends LGoodsUserRecord implements BaseMapper { // 序列化版本号 private static final long serialVersionUID = 1L; public static final RowMapper ROW_MAPPER = new LGoodsUserRecordRowMapper(); // 主键 public static final String Id = "id"; // 普通属性 public static final String WhGoodsId = "wh_goods_id"; public static final String RecordType = "record_type"; public static final String TransBusinessId = "trans_business_id"; public static final String ProcureModelUserRecordId = "procure_model_user_record_id"; 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 LastRecord = "last_record"; /** * 默认构造函数 */ public LGoodsUserRecord_mapper(LGoodsUserRecord lGoodsUserRecord) { if (lGoodsUserRecord == null) { throw new IllegalArgumentException("po参数不允许为空!"); } //主键 if (lGoodsUserRecord.isset_id) { this.setId(lGoodsUserRecord.getId()); } //普通属性 if (lGoodsUserRecord.isset_whGoodsId) { this.setWhGoodsId(lGoodsUserRecord.getWhGoodsId()); } if (lGoodsUserRecord.isset_recordType) { this.setRecordType(lGoodsUserRecord.getRecordType()); } if (lGoodsUserRecord.isset_transBusinessId) { this.setTransBusinessId(lGoodsUserRecord.getTransBusinessId()); } if (lGoodsUserRecord.isset_procureModelUserRecordId) { this.setProcureModelUserRecordId(lGoodsUserRecord.getProcureModelUserRecordId()); } if (lGoodsUserRecord.isset_nowUserPhone) { this.setNowUserPhone(lGoodsUserRecord.getNowUserPhone()); } if (lGoodsUserRecord.isset_nowUserName) { this.setNowUserName(lGoodsUserRecord.getNowUserName()); } if (lGoodsUserRecord.isset_operatorId) { this.setOperatorId(lGoodsUserRecord.getOperatorId()); } if (lGoodsUserRecord.isset_operatorName) { this.setOperatorName(lGoodsUserRecord.getOperatorName()); } if (lGoodsUserRecord.isset_dealTime) { this.setDealTime(lGoodsUserRecord.getDealTime()); } if (lGoodsUserRecord.isset_lastRecord) { this.setLastRecord(lGoodsUserRecord.getLastRecord()); } // 去掉,2022-09-07 // this.setDatabaseName_(l_goods_user_record.getDatabaseName_()); } /** * 获取表名 */ @Override public String getTableName_() { String tableName = "l_goods_user_record"; /** 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> getInsertSql_() { InsertBuilder ib = new InsertBuilder(this.getTableName_()); ib.set(Id, this.getId()); ib.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId); ib.set(RecordType, this.getRecordType(), this.isset_recordType); ib.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); ib.set(ProcureModelUserRecordId, this.getProcureModelUserRecordId(), this.isset_procureModelUserRecordId); 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(LastRecord, this.getLastRecord(), this.isset_lastRecord); return ib.genMapSql(); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters> getUpdateSql_() { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId); ub.set(RecordType, this.getRecordType(), this.isset_recordType); ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); ub.set(ProcureModelUserRecordId, this.getProcureModelUserRecordId(), this.isset_procureModelUserRecordId); 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(LastRecord, this.getLastRecord(), this.isset_lastRecord); ub.where(this.getPkName_(), this.getPkValue_()); return ub.genMapSql(); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters> getUpdateSql_(String where, Map parameters) { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId); ub.set(RecordType, this.getRecordType(), this.isset_recordType); ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); ub.set(ProcureModelUserRecordId, this.getProcureModelUserRecordId(), this.isset_procureModelUserRecordId); 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(LastRecord, this.getLastRecord(), this.isset_lastRecord); return ub.genMapSql(where, parameters); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters getUpdateSql_(String where, Object[] parameters) { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId); ub.set(RecordType, this.getRecordType(), this.isset_recordType); ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); ub.set(ProcureModelUserRecordId, this.getProcureModelUserRecordId(), this.isset_procureModelUserRecordId); 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(LastRecord, this.getLastRecord(), this.isset_lastRecord); return ub.genArraySql(where, parameters); } /** * 获取删除语句和参数 */ @Override public SqlAndParameters> getDeleteSql_() { DeleteBuilder db = new DeleteBuilder(this.getTableName_()); db.where(this.getPkName_(), this.getPkValue_()); return db.genMapSql(); } /** * 获取删除语句和参数 */ @Override public SqlAndParameters> getDeleteSql_(String where, Map parameters) { DeleteBuilder db = new DeleteBuilder(this.getTableName_()); return db.genMapSql(where, parameters); } /** * 获取删除语句和参数 */ @Override public SqlAndParameters getDeleteSql_(String where, Object[] parameters) { DeleteBuilder db = new DeleteBuilder(this.getTableName_()); return db.genArraySql(where, parameters); } /** * 获取单行查询语句和参数 */ @Override public SqlAndParameters> getSingleSql_() { SelectBuilder sb = new SelectBuilder(this.getTableName_()); sb.where(this.getPkName_(), this.getPkValue_()); return sb.genMapSql(); } /** * 获取查询语句和参数 */ @Override public SqlAndParameters> getSelectSql_(String where, Map parameters) { return new SqlAndParameters<>("select id, wh_goods_id, record_type, trans_business_id, procure_model_user_record_id, now_user_phone, now_user_name, operator_id, operator_name, deal_time, last_record from " + this.getTableName_() + " " + where, parameters); } /** * 获取查询语句和参数 */ @Override public SqlAndParameters getSelectSql_(String where, Object[] parameters) { return new SqlAndParameters<>("select id, wh_goods_id, record_type, trans_business_id, procure_model_user_record_id, now_user_phone, now_user_name, operator_id, operator_name, deal_time, last_record from " + this.getTableName_() + " " + where, parameters); } /** * 将resultset的一行转化为po */ @Override public LGoodsUserRecord mapRow(ResultSet rs, int i) throws SQLException { return ROW_MAPPER.mapRow(rs, i); } /** * 克隆 */ public LGoodsUserRecord toLGoodsUserRecord() { return super.$clone(); } } /** * l_goods_user_record RowMapper * * @author genrator */ class LGoodsUserRecordRowMapper implements RowMapper { @Override public LGoodsUserRecord mapRow(ResultSet rs, int i) throws SQLException { ResultSetUtils resultSetUtils = new ResultSetUtils(); LGoodsUserRecord l_goods_user_record = new LGoodsUserRecord(); Integer columnIndex; //主键 columnIndex = resultSetUtils.findColumn(rs, LGoodsUserRecord_mapper.Id); if (columnIndex > 0) { l_goods_user_record.setId(rs.getLong(columnIndex)); } //普通属性 columnIndex = resultSetUtils.findColumn(rs, LGoodsUserRecord_mapper.WhGoodsId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_goods_user_record.setWhGoodsId(null); } else { l_goods_user_record.setWhGoodsId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LGoodsUserRecord_mapper.RecordType); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_goods_user_record.setRecordType(null); } else { l_goods_user_record.setRecordType(rs.getInt(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LGoodsUserRecord_mapper.TransBusinessId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_goods_user_record.setTransBusinessId(null); } else { l_goods_user_record.setTransBusinessId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LGoodsUserRecord_mapper.ProcureModelUserRecordId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_goods_user_record.setProcureModelUserRecordId(null); } else { l_goods_user_record.setProcureModelUserRecordId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LGoodsUserRecord_mapper.NowUserPhone); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_goods_user_record.setNowUserPhone(null); } else { l_goods_user_record.setNowUserPhone(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LGoodsUserRecord_mapper.NowUserName); if (columnIndex > 0) { l_goods_user_record.setNowUserName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LGoodsUserRecord_mapper.OperatorId); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_goods_user_record.setOperatorId(null); } else { l_goods_user_record.setOperatorId(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LGoodsUserRecord_mapper.OperatorName); if (columnIndex > 0) { l_goods_user_record.setOperatorName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, LGoodsUserRecord_mapper.DealTime); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_goods_user_record.setDealTime(null); } else { l_goods_user_record.setDealTime(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, LGoodsUserRecord_mapper.LastRecord); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { l_goods_user_record.setLastRecord(null); } else { l_goods_user_record.setLastRecord(rs.getInt(columnIndex)); } } return l_goods_user_record; } }