You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
724 lines
28 KiB
724 lines
28 KiB
package com.hfkj.dao;
|
|
|
|
import com.hfkj.entity.EnOrderOil;
|
|
import com.hfkj.entity.EnOrderOilExample.Criteria;
|
|
import com.hfkj.entity.EnOrderOilExample.Criterion;
|
|
import com.hfkj.entity.EnOrderOilExample;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import org.apache.ibatis.jdbc.SQL;
|
|
|
|
public class EnOrderOilSqlProvider {
|
|
|
|
public String countByExample(EnOrderOilExample example) {
|
|
SQL sql = new SQL();
|
|
sql.SELECT("count(*)").FROM("en_order_oil");
|
|
applyWhere(sql, example, false);
|
|
return sql.toString();
|
|
}
|
|
|
|
public String deleteByExample(EnOrderOilExample example) {
|
|
SQL sql = new SQL();
|
|
sql.DELETE_FROM("en_order_oil");
|
|
applyWhere(sql, example, false);
|
|
return sql.toString();
|
|
}
|
|
|
|
public String insertSelective(EnOrderOil record) {
|
|
SQL sql = new SQL();
|
|
sql.INSERT_INTO("en_order_oil");
|
|
|
|
if (record.getTransportCompanyId() != null) {
|
|
sql.VALUES("transport_company_id", "#{transportCompanyId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getTransportCompanyName() != null) {
|
|
sql.VALUES("transport_company_name", "#{transportCompanyName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getItemId() != null) {
|
|
sql.VALUES("item_id", "#{itemId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getItemName() != null) {
|
|
sql.VALUES("item_name", "#{itemName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getCompanyId() != null) {
|
|
sql.VALUES("company_id", "#{companyId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getCompanyName() != null) {
|
|
sql.VALUES("company_name", "#{companyName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getSegmentId() != null) {
|
|
sql.VALUES("segment_id", "#{segmentId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getSegmentName() != null) {
|
|
sql.VALUES("segment_name", "#{segmentName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getOilType() != null) {
|
|
sql.VALUES("oil_type", "#{oilType,jdbcType=INTEGER}");
|
|
}
|
|
|
|
if (record.getOilNum() != null) {
|
|
sql.VALUES("oil_num", "#{oilNum,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getServiceCompanyDeviceId() != null) {
|
|
sql.VALUES("service_company_device_id", "#{serviceCompanyDeviceId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getServiceCompanyDeviceCode() != null) {
|
|
sql.VALUES("service_company_device_code", "#{serviceCompanyDeviceCode,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getServiceCompanyDeviceName() != null) {
|
|
sql.VALUES("service_company_device_name", "#{serviceCompanyDeviceName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getServiceCompanyDeviceImg() != null) {
|
|
sql.VALUES("service_company_device_img", "#{serviceCompanyDeviceImg,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getDeviceId() != null) {
|
|
sql.VALUES("device_id", "#{deviceId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getDeviceCode() != null) {
|
|
sql.VALUES("device_code", "#{deviceCode,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getCarId() != null) {
|
|
sql.VALUES("car_id", "#{carId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getCarNo() != null) {
|
|
sql.VALUES("car_no", "#{carNo,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getOrderNo() != null) {
|
|
sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getNumber() != null) {
|
|
sql.VALUES("`number`", "#{number,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getThirdOrderNo() != null) {
|
|
sql.VALUES("third_order_no", "#{thirdOrderNo,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getMode() != null) {
|
|
sql.VALUES("`mode`", "#{mode,jdbcType=INTEGER}");
|
|
}
|
|
|
|
if (record.getLiter() != null) {
|
|
sql.VALUES("liter", "#{liter,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getPrice() != null) {
|
|
sql.VALUES("price", "#{price,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getSale() != null) {
|
|
sql.VALUES("sale", "#{sale,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getCardNo() != null) {
|
|
sql.VALUES("card_no", "#{cardNo,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getCardUserName() != null) {
|
|
sql.VALUES("card_user_name", "#{cardUserName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getCardBeforeConsumeMoney() != null) {
|
|
sql.VALUES("card_before_consume_money", "#{cardBeforeConsumeMoney,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getCardAfterConsumeMoney() != null) {
|
|
sql.VALUES("card_after_consume_money", "#{cardAfterConsumeMoney,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getCardPlateNumber() != null) {
|
|
sql.VALUES("card_plate_number", "#{cardPlateNumber,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getSignImg() != null) {
|
|
sql.VALUES("sign_img", "#{signImg,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getFillDateTime() != null) {
|
|
sql.VALUES("fill_date_time", "#{fillDateTime,jdbcType=TIMESTAMP}");
|
|
}
|
|
|
|
if (record.getStatus() != null) {
|
|
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}");
|
|
}
|
|
|
|
if (record.getCreateUserId() != null) {
|
|
sql.VALUES("create_user_id", "#{createUserId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getCreateUserName() != null) {
|
|
sql.VALUES("create_user_name", "#{createUserName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getCreateTime() != null) {
|
|
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
|
|
}
|
|
|
|
if (record.getUpdateUserId() != null) {
|
|
sql.VALUES("update_user_id", "#{updateUserId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getUpdateUserName() != null) {
|
|
sql.VALUES("update_user_name", "#{updateUserName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getUpdateTime() != null) {
|
|
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
|
|
}
|
|
|
|
return sql.toString();
|
|
}
|
|
|
|
public String selectByExample(EnOrderOilExample example) {
|
|
SQL sql = new SQL();
|
|
if (example != null && example.isDistinct()) {
|
|
sql.SELECT_DISTINCT("id");
|
|
} else {
|
|
sql.SELECT("id");
|
|
}
|
|
sql.SELECT("transport_company_id");
|
|
sql.SELECT("transport_company_name");
|
|
sql.SELECT("item_id");
|
|
sql.SELECT("item_name");
|
|
sql.SELECT("company_id");
|
|
sql.SELECT("company_name");
|
|
sql.SELECT("segment_id");
|
|
sql.SELECT("segment_name");
|
|
sql.SELECT("oil_type");
|
|
sql.SELECT("oil_num");
|
|
sql.SELECT("service_company_device_id");
|
|
sql.SELECT("service_company_device_code");
|
|
sql.SELECT("service_company_device_name");
|
|
sql.SELECT("service_company_device_img");
|
|
sql.SELECT("device_id");
|
|
sql.SELECT("device_code");
|
|
sql.SELECT("car_id");
|
|
sql.SELECT("car_no");
|
|
sql.SELECT("order_no");
|
|
sql.SELECT("`number`");
|
|
sql.SELECT("third_order_no");
|
|
sql.SELECT("`mode`");
|
|
sql.SELECT("liter");
|
|
sql.SELECT("price");
|
|
sql.SELECT("sale");
|
|
sql.SELECT("card_no");
|
|
sql.SELECT("card_user_name");
|
|
sql.SELECT("card_before_consume_money");
|
|
sql.SELECT("card_after_consume_money");
|
|
sql.SELECT("card_plate_number");
|
|
sql.SELECT("sign_img");
|
|
sql.SELECT("fill_date_time");
|
|
sql.SELECT("`status`");
|
|
sql.SELECT("create_user_id");
|
|
sql.SELECT("create_user_name");
|
|
sql.SELECT("create_time");
|
|
sql.SELECT("update_user_id");
|
|
sql.SELECT("update_user_name");
|
|
sql.SELECT("update_time");
|
|
sql.FROM("en_order_oil");
|
|
applyWhere(sql, example, false);
|
|
|
|
if (example != null && example.getOrderByClause() != null) {
|
|
sql.ORDER_BY(example.getOrderByClause());
|
|
}
|
|
|
|
return sql.toString();
|
|
}
|
|
|
|
public String updateByExampleSelective(Map<String, Object> parameter) {
|
|
EnOrderOil record = (EnOrderOil) parameter.get("record");
|
|
EnOrderOilExample example = (EnOrderOilExample) parameter.get("example");
|
|
|
|
SQL sql = new SQL();
|
|
sql.UPDATE("en_order_oil");
|
|
|
|
if (record.getId() != null) {
|
|
sql.SET("id = #{record.id,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getTransportCompanyId() != null) {
|
|
sql.SET("transport_company_id = #{record.transportCompanyId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getTransportCompanyName() != null) {
|
|
sql.SET("transport_company_name = #{record.transportCompanyName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getItemId() != null) {
|
|
sql.SET("item_id = #{record.itemId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getItemName() != null) {
|
|
sql.SET("item_name = #{record.itemName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getCompanyId() != null) {
|
|
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getCompanyName() != null) {
|
|
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getSegmentId() != null) {
|
|
sql.SET("segment_id = #{record.segmentId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getSegmentName() != null) {
|
|
sql.SET("segment_name = #{record.segmentName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getOilType() != null) {
|
|
sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}");
|
|
}
|
|
|
|
if (record.getOilNum() != null) {
|
|
sql.SET("oil_num = #{record.oilNum,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getServiceCompanyDeviceId() != null) {
|
|
sql.SET("service_company_device_id = #{record.serviceCompanyDeviceId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getServiceCompanyDeviceCode() != null) {
|
|
sql.SET("service_company_device_code = #{record.serviceCompanyDeviceCode,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getServiceCompanyDeviceName() != null) {
|
|
sql.SET("service_company_device_name = #{record.serviceCompanyDeviceName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getServiceCompanyDeviceImg() != null) {
|
|
sql.SET("service_company_device_img = #{record.serviceCompanyDeviceImg,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getDeviceId() != null) {
|
|
sql.SET("device_id = #{record.deviceId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getDeviceCode() != null) {
|
|
sql.SET("device_code = #{record.deviceCode,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getCarId() != null) {
|
|
sql.SET("car_id = #{record.carId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getCarNo() != null) {
|
|
sql.SET("car_no = #{record.carNo,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getOrderNo() != null) {
|
|
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getNumber() != null) {
|
|
sql.SET("`number` = #{record.number,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getThirdOrderNo() != null) {
|
|
sql.SET("third_order_no = #{record.thirdOrderNo,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getMode() != null) {
|
|
sql.SET("`mode` = #{record.mode,jdbcType=INTEGER}");
|
|
}
|
|
|
|
if (record.getLiter() != null) {
|
|
sql.SET("liter = #{record.liter,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getPrice() != null) {
|
|
sql.SET("price = #{record.price,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getSale() != null) {
|
|
sql.SET("sale = #{record.sale,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getCardNo() != null) {
|
|
sql.SET("card_no = #{record.cardNo,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getCardUserName() != null) {
|
|
sql.SET("card_user_name = #{record.cardUserName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getCardBeforeConsumeMoney() != null) {
|
|
sql.SET("card_before_consume_money = #{record.cardBeforeConsumeMoney,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getCardAfterConsumeMoney() != null) {
|
|
sql.SET("card_after_consume_money = #{record.cardAfterConsumeMoney,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getCardPlateNumber() != null) {
|
|
sql.SET("card_plate_number = #{record.cardPlateNumber,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getSignImg() != null) {
|
|
sql.SET("sign_img = #{record.signImg,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getFillDateTime() != null) {
|
|
sql.SET("fill_date_time = #{record.fillDateTime,jdbcType=TIMESTAMP}");
|
|
}
|
|
|
|
if (record.getStatus() != null) {
|
|
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
|
|
}
|
|
|
|
if (record.getCreateUserId() != null) {
|
|
sql.SET("create_user_id = #{record.createUserId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getCreateUserName() != null) {
|
|
sql.SET("create_user_name = #{record.createUserName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getCreateTime() != null) {
|
|
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
|
|
}
|
|
|
|
if (record.getUpdateUserId() != null) {
|
|
sql.SET("update_user_id = #{record.updateUserId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getUpdateUserName() != null) {
|
|
sql.SET("update_user_name = #{record.updateUserName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getUpdateTime() != null) {
|
|
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
|
|
}
|
|
|
|
applyWhere(sql, example, true);
|
|
return sql.toString();
|
|
}
|
|
|
|
public String updateByExample(Map<String, Object> parameter) {
|
|
SQL sql = new SQL();
|
|
sql.UPDATE("en_order_oil");
|
|
|
|
sql.SET("id = #{record.id,jdbcType=BIGINT}");
|
|
sql.SET("transport_company_id = #{record.transportCompanyId,jdbcType=BIGINT}");
|
|
sql.SET("transport_company_name = #{record.transportCompanyName,jdbcType=VARCHAR}");
|
|
sql.SET("item_id = #{record.itemId,jdbcType=BIGINT}");
|
|
sql.SET("item_name = #{record.itemName,jdbcType=VARCHAR}");
|
|
sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}");
|
|
sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}");
|
|
sql.SET("segment_id = #{record.segmentId,jdbcType=BIGINT}");
|
|
sql.SET("segment_name = #{record.segmentName,jdbcType=VARCHAR}");
|
|
sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}");
|
|
sql.SET("oil_num = #{record.oilNum,jdbcType=DECIMAL}");
|
|
sql.SET("service_company_device_id = #{record.serviceCompanyDeviceId,jdbcType=BIGINT}");
|
|
sql.SET("service_company_device_code = #{record.serviceCompanyDeviceCode,jdbcType=VARCHAR}");
|
|
sql.SET("service_company_device_name = #{record.serviceCompanyDeviceName,jdbcType=VARCHAR}");
|
|
sql.SET("service_company_device_img = #{record.serviceCompanyDeviceImg,jdbcType=VARCHAR}");
|
|
sql.SET("device_id = #{record.deviceId,jdbcType=BIGINT}");
|
|
sql.SET("device_code = #{record.deviceCode,jdbcType=VARCHAR}");
|
|
sql.SET("car_id = #{record.carId,jdbcType=BIGINT}");
|
|
sql.SET("car_no = #{record.carNo,jdbcType=VARCHAR}");
|
|
sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}");
|
|
sql.SET("`number` = #{record.number,jdbcType=BIGINT}");
|
|
sql.SET("third_order_no = #{record.thirdOrderNo,jdbcType=VARCHAR}");
|
|
sql.SET("`mode` = #{record.mode,jdbcType=INTEGER}");
|
|
sql.SET("liter = #{record.liter,jdbcType=DECIMAL}");
|
|
sql.SET("price = #{record.price,jdbcType=DECIMAL}");
|
|
sql.SET("sale = #{record.sale,jdbcType=DECIMAL}");
|
|
sql.SET("card_no = #{record.cardNo,jdbcType=VARCHAR}");
|
|
sql.SET("card_user_name = #{record.cardUserName,jdbcType=VARCHAR}");
|
|
sql.SET("card_before_consume_money = #{record.cardBeforeConsumeMoney,jdbcType=DECIMAL}");
|
|
sql.SET("card_after_consume_money = #{record.cardAfterConsumeMoney,jdbcType=DECIMAL}");
|
|
sql.SET("card_plate_number = #{record.cardPlateNumber,jdbcType=VARCHAR}");
|
|
sql.SET("sign_img = #{record.signImg,jdbcType=VARCHAR}");
|
|
sql.SET("fill_date_time = #{record.fillDateTime,jdbcType=TIMESTAMP}");
|
|
sql.SET("`status` = #{record.status,jdbcType=INTEGER}");
|
|
sql.SET("create_user_id = #{record.createUserId,jdbcType=BIGINT}");
|
|
sql.SET("create_user_name = #{record.createUserName,jdbcType=VARCHAR}");
|
|
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}");
|
|
sql.SET("update_user_id = #{record.updateUserId,jdbcType=BIGINT}");
|
|
sql.SET("update_user_name = #{record.updateUserName,jdbcType=VARCHAR}");
|
|
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}");
|
|
|
|
EnOrderOilExample example = (EnOrderOilExample) parameter.get("example");
|
|
applyWhere(sql, example, true);
|
|
return sql.toString();
|
|
}
|
|
|
|
public String updateByPrimaryKeySelective(EnOrderOil record) {
|
|
SQL sql = new SQL();
|
|
sql.UPDATE("en_order_oil");
|
|
|
|
if (record.getTransportCompanyId() != null) {
|
|
sql.SET("transport_company_id = #{transportCompanyId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getTransportCompanyName() != null) {
|
|
sql.SET("transport_company_name = #{transportCompanyName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getItemId() != null) {
|
|
sql.SET("item_id = #{itemId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getItemName() != null) {
|
|
sql.SET("item_name = #{itemName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getCompanyId() != null) {
|
|
sql.SET("company_id = #{companyId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getCompanyName() != null) {
|
|
sql.SET("company_name = #{companyName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getSegmentId() != null) {
|
|
sql.SET("segment_id = #{segmentId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getSegmentName() != null) {
|
|
sql.SET("segment_name = #{segmentName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getOilType() != null) {
|
|
sql.SET("oil_type = #{oilType,jdbcType=INTEGER}");
|
|
}
|
|
|
|
if (record.getOilNum() != null) {
|
|
sql.SET("oil_num = #{oilNum,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getServiceCompanyDeviceId() != null) {
|
|
sql.SET("service_company_device_id = #{serviceCompanyDeviceId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getServiceCompanyDeviceCode() != null) {
|
|
sql.SET("service_company_device_code = #{serviceCompanyDeviceCode,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getServiceCompanyDeviceName() != null) {
|
|
sql.SET("service_company_device_name = #{serviceCompanyDeviceName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getServiceCompanyDeviceImg() != null) {
|
|
sql.SET("service_company_device_img = #{serviceCompanyDeviceImg,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getDeviceId() != null) {
|
|
sql.SET("device_id = #{deviceId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getDeviceCode() != null) {
|
|
sql.SET("device_code = #{deviceCode,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getCarId() != null) {
|
|
sql.SET("car_id = #{carId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getCarNo() != null) {
|
|
sql.SET("car_no = #{carNo,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getOrderNo() != null) {
|
|
sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getNumber() != null) {
|
|
sql.SET("`number` = #{number,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getThirdOrderNo() != null) {
|
|
sql.SET("third_order_no = #{thirdOrderNo,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getMode() != null) {
|
|
sql.SET("`mode` = #{mode,jdbcType=INTEGER}");
|
|
}
|
|
|
|
if (record.getLiter() != null) {
|
|
sql.SET("liter = #{liter,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getPrice() != null) {
|
|
sql.SET("price = #{price,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getSale() != null) {
|
|
sql.SET("sale = #{sale,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getCardNo() != null) {
|
|
sql.SET("card_no = #{cardNo,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getCardUserName() != null) {
|
|
sql.SET("card_user_name = #{cardUserName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getCardBeforeConsumeMoney() != null) {
|
|
sql.SET("card_before_consume_money = #{cardBeforeConsumeMoney,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getCardAfterConsumeMoney() != null) {
|
|
sql.SET("card_after_consume_money = #{cardAfterConsumeMoney,jdbcType=DECIMAL}");
|
|
}
|
|
|
|
if (record.getCardPlateNumber() != null) {
|
|
sql.SET("card_plate_number = #{cardPlateNumber,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getSignImg() != null) {
|
|
sql.SET("sign_img = #{signImg,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getFillDateTime() != null) {
|
|
sql.SET("fill_date_time = #{fillDateTime,jdbcType=TIMESTAMP}");
|
|
}
|
|
|
|
if (record.getStatus() != null) {
|
|
sql.SET("`status` = #{status,jdbcType=INTEGER}");
|
|
}
|
|
|
|
if (record.getCreateUserId() != null) {
|
|
sql.SET("create_user_id = #{createUserId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getCreateUserName() != null) {
|
|
sql.SET("create_user_name = #{createUserName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getCreateTime() != null) {
|
|
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
|
|
}
|
|
|
|
if (record.getUpdateUserId() != null) {
|
|
sql.SET("update_user_id = #{updateUserId,jdbcType=BIGINT}");
|
|
}
|
|
|
|
if (record.getUpdateUserName() != null) {
|
|
sql.SET("update_user_name = #{updateUserName,jdbcType=VARCHAR}");
|
|
}
|
|
|
|
if (record.getUpdateTime() != null) {
|
|
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
|
|
}
|
|
|
|
sql.WHERE("id = #{id,jdbcType=BIGINT}");
|
|
|
|
return sql.toString();
|
|
}
|
|
|
|
protected void applyWhere(SQL sql, EnOrderOilExample example, boolean includeExamplePhrase) {
|
|
if (example == null) {
|
|
return;
|
|
}
|
|
|
|
String parmPhrase1;
|
|
String parmPhrase1_th;
|
|
String parmPhrase2;
|
|
String parmPhrase2_th;
|
|
String parmPhrase3;
|
|
String parmPhrase3_th;
|
|
if (includeExamplePhrase) {
|
|
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}";
|
|
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
|
|
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}";
|
|
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
|
|
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}";
|
|
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
|
|
} else {
|
|
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}";
|
|
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}";
|
|
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}";
|
|
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}";
|
|
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}";
|
|
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}";
|
|
}
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
List<Criteria> oredCriteria = example.getOredCriteria();
|
|
boolean firstCriteria = true;
|
|
for (int i = 0; i < oredCriteria.size(); i++) {
|
|
Criteria criteria = oredCriteria.get(i);
|
|
if (criteria.isValid()) {
|
|
if (firstCriteria) {
|
|
firstCriteria = false;
|
|
} else {
|
|
sb.append(" or ");
|
|
}
|
|
|
|
sb.append('(');
|
|
List<Criterion> criterions = criteria.getAllCriteria();
|
|
boolean firstCriterion = true;
|
|
for (int j = 0; j < criterions.size(); j++) {
|
|
Criterion criterion = criterions.get(j);
|
|
if (firstCriterion) {
|
|
firstCriterion = false;
|
|
} else {
|
|
sb.append(" and ");
|
|
}
|
|
|
|
if (criterion.isNoValue()) {
|
|
sb.append(criterion.getCondition());
|
|
} else if (criterion.isSingleValue()) {
|
|
if (criterion.getTypeHandler() == null) {
|
|
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j));
|
|
} else {
|
|
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler()));
|
|
}
|
|
} else if (criterion.isBetweenValue()) {
|
|
if (criterion.getTypeHandler() == null) {
|
|
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j));
|
|
} else {
|
|
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler()));
|
|
}
|
|
} else if (criterion.isListValue()) {
|
|
sb.append(criterion.getCondition());
|
|
sb.append(" (");
|
|
List<?> listItems = (List<?>) criterion.getValue();
|
|
boolean comma = false;
|
|
for (int k = 0; k < listItems.size(); k++) {
|
|
if (comma) {
|
|
sb.append(", ");
|
|
} else {
|
|
comma = true;
|
|
}
|
|
if (criterion.getTypeHandler() == null) {
|
|
sb.append(String.format(parmPhrase3, i, j, k));
|
|
} else {
|
|
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler()));
|
|
}
|
|
}
|
|
sb.append(')');
|
|
}
|
|
}
|
|
sb.append(')');
|
|
}
|
|
}
|
|
|
|
if (sb.length() > 0) {
|
|
sql.WHERE(sb.toString());
|
|
}
|
|
}
|
|
} |