package com.iplatform.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; /** * 表名:RC_TASK_STATUS * * @author genrator */ public class Rc_task_status_mapper extends Rc_task_status implements BaseMapper { // 序列化版本号 private static final long serialVersionUID = 1L; public static final RowMapper ROW_MAPPER = new Rc_task_statusRowMapper(); // 主键 public static final String ID = "id"; // 普通属性 public static final String CREATE_TIME = "create_time"; public static final String NAME = "name"; public static final String LAST_VALUE = "last_value"; public static final String STATUS = "status"; public static final String START_TIME = "start_time"; public static final String END_TIME = "end_time"; public static final String MSG = "msg"; public static final String TASK_TYPE = "task_type"; /** * 默认构造函数 */ public Rc_task_status_mapper(Rc_task_status rc_task_status) { if (rc_task_status == null) { throw new IllegalArgumentException("po参数不允许为空!"); } //主键 if (rc_task_status.isset_id) { this.setId(rc_task_status.getId()); } //普通属性 if (rc_task_status.isset_create_time) { this.setCreate_time(rc_task_status.getCreate_time()); } if (rc_task_status.isset_name) { this.setName(rc_task_status.getName()); } if (rc_task_status.isset_last_value) { this.setLast_value(rc_task_status.getLast_value()); } if (rc_task_status.isset_status) { this.setStatus(rc_task_status.getStatus()); } if (rc_task_status.isset_start_time) { this.setStart_time(rc_task_status.getStart_time()); } if (rc_task_status.isset_end_time) { this.setEnd_time(rc_task_status.getEnd_time()); } if (rc_task_status.isset_msg) { this.setMsg(rc_task_status.getMsg()); } if (rc_task_status.isset_task_type) { this.setTask_type(rc_task_status.getTask_type()); } // 去掉,2022-09-07 // this.setDatabaseName_(rc_task_status.getDatabaseName_()); } /** * 获取表名 */ @Override public String getTableName_() { String tableName = "rc_task_status"; /** 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(CREATE_TIME, this.getCreate_time(), this.isset_create_time); ib.set(NAME, this.getName(), this.isset_name); ib.set(LAST_VALUE, this.getLast_value(), this.isset_last_value); ib.set(STATUS, this.getStatus(), this.isset_status); ib.set(START_TIME, this.getStart_time(), this.isset_start_time); ib.set(END_TIME, this.getEnd_time(), this.isset_end_time); ib.set(MSG, this.getMsg(), this.isset_msg); ib.set(TASK_TYPE, this.getTask_type(), this.isset_task_type); return ib.genMapSql(); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters> getUpdateSql_() { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(CREATE_TIME, this.getCreate_time(), this.isset_create_time); ub.set(NAME, this.getName(), this.isset_name); ub.set(LAST_VALUE, this.getLast_value(), this.isset_last_value); ub.set(STATUS, this.getStatus(), this.isset_status); ub.set(START_TIME, this.getStart_time(), this.isset_start_time); ub.set(END_TIME, this.getEnd_time(), this.isset_end_time); ub.set(MSG, this.getMsg(), this.isset_msg); ub.set(TASK_TYPE, this.getTask_type(), this.isset_task_type); 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(CREATE_TIME, this.getCreate_time(), this.isset_create_time); ub.set(NAME, this.getName(), this.isset_name); ub.set(LAST_VALUE, this.getLast_value(), this.isset_last_value); ub.set(STATUS, this.getStatus(), this.isset_status); ub.set(START_TIME, this.getStart_time(), this.isset_start_time); ub.set(END_TIME, this.getEnd_time(), this.isset_end_time); ub.set(MSG, this.getMsg(), this.isset_msg); ub.set(TASK_TYPE, this.getTask_type(), this.isset_task_type); return ub.genMapSql(where, parameters); } /** * 获取更新语句和参数 */ @Override public SqlAndParameters getUpdateSql_(String where, Object[] parameters) { UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); ub.set(CREATE_TIME, this.getCreate_time(), this.isset_create_time); ub.set(NAME, this.getName(), this.isset_name); ub.set(LAST_VALUE, this.getLast_value(), this.isset_last_value); ub.set(STATUS, this.getStatus(), this.isset_status); ub.set(START_TIME, this.getStart_time(), this.isset_start_time); ub.set(END_TIME, this.getEnd_time(), this.isset_end_time); ub.set(MSG, this.getMsg(), this.isset_msg); ub.set(TASK_TYPE, this.getTask_type(), this.isset_task_type); 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, create_time, name, last_value, status, start_time, end_time, msg, task_type from " + this.getTableName_() + " " + where, parameters); } /** * 获取查询语句和参数 */ @Override public SqlAndParameters getSelectSql_(String where, Object[] parameters) { return new SqlAndParameters<>("select id, create_time, name, last_value, status, start_time, end_time, msg, task_type from " + this.getTableName_() + " " + where, parameters); } /** * 将resultset的一行转化为po */ @Override public Rc_task_status mapRow(ResultSet rs, int i) throws SQLException { return ROW_MAPPER.mapRow(rs, i); } /** * 克隆 */ public Rc_task_status toRc_task_status() { return super.$clone(); } } /** * rc_task_status RowMapper * * @author genrator */ class Rc_task_statusRowMapper implements RowMapper { @Override public Rc_task_status mapRow(ResultSet rs, int i) throws SQLException { ResultSetUtils resultSetUtils = new ResultSetUtils(); Rc_task_status rc_task_status = new Rc_task_status(); Integer columnIndex; //主键 columnIndex = resultSetUtils.findColumn(rs, Rc_task_status_mapper.ID); if (columnIndex > 0) { rc_task_status.setId(rs.getLong(columnIndex)); } //普通属性 columnIndex = resultSetUtils.findColumn(rs, Rc_task_status_mapper.CREATE_TIME); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { rc_task_status.setCreate_time(null); } else { rc_task_status.setCreate_time(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, Rc_task_status_mapper.NAME); if (columnIndex > 0) { rc_task_status.setName(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, Rc_task_status_mapper.LAST_VALUE); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { rc_task_status.setLast_value(null); } else { rc_task_status.setLast_value(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, Rc_task_status_mapper.STATUS); if (columnIndex > 0) { rc_task_status.setStatus(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, Rc_task_status_mapper.START_TIME); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { rc_task_status.setStart_time(null); } else { rc_task_status.setStart_time(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, Rc_task_status_mapper.END_TIME); if (columnIndex > 0) { if (rs.getBigDecimal(columnIndex) == null) { rc_task_status.setEnd_time(null); } else { rc_task_status.setEnd_time(rs.getLong(columnIndex)); } } columnIndex = resultSetUtils.findColumn(rs, Rc_task_status_mapper.MSG); if (columnIndex > 0) { rc_task_status.setMsg(rs.getString(columnIndex)); } columnIndex = resultSetUtils.findColumn(rs, Rc_task_status_mapper.TASK_TYPE); if (columnIndex > 0) { rc_task_status.setTask_type(rs.getString(columnIndex)); } return rc_task_status; } }