fixed sql version bugs on deployment
parent
c8b1374688
commit
1f750216c4
|
@ -21,8 +21,8 @@ public class CutPieceDAO {
|
||||||
private final String SELECT_ALL_QUERY = String.format( "SELECT * FROM %s ORDER BY id DESC", TABLE_NAME );
|
private final String SELECT_ALL_QUERY = String.format( "SELECT * FROM %s ORDER BY id DESC", TABLE_NAME );
|
||||||
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
private final String DELETE_QUERY = String.format( "DELETE FROM %s WHERE id = :id", TABLE_NAME );
|
||||||
private final String SELECT_BY_ITEM_IDS = String.format( "SELECT * FROM %s WHERE job_card_item_id IN (:item_ids)", TABLE_NAME );
|
private final String SELECT_BY_ITEM_IDS = String.format( "SELECT * FROM %s WHERE job_card_item_id IN (:item_ids)", TABLE_NAME );
|
||||||
private final String SELECT_BY_ITEM_IDS_AND_GROUP_BY = String.format( "SELECT id,job_card_item_id,type,SUM(quantity) AS quantity FROM %s WHERE job_card_item_id IN (:item_ids) GROUP BY job_card_item_id, type", TABLE_NAME );
|
private final String SELECT_BY_ITEM_IDS_AND_GROUP_BY = String.format( "SELECT id,job_card_item_id,'type',SUM(quantity) AS quantity FROM %s WHERE job_card_item_id IN (:item_ids) GROUP BY job_card_item_id, 'type'", TABLE_NAME );
|
||||||
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, job_card_item_id, type, quantity) VALUES (:id, :job_card_item_id, :type, :quantity) ON DUPLICATE KEY UPDATE job_card_item_id = VALUES(job_card_item_id), type = VALUES(type), quantity = VALUES(quantity)", TABLE_NAME );
|
private final String INSERT_QUERY = String.format( "INSERT INTO %s (id, job_card_item_id, 'type', quantity) VALUES (:id, :job_card_item_id, :type, :quantity) ON DUPLICATE KEY UPDATE job_card_item_id = VALUES(job_card_item_id), 'type' = VALUES('type'), quantity = VALUES(quantity)", TABLE_NAME );
|
||||||
private final String DELETE_BY_ITEM_ID = String.format( "DELETE FROM %s WHERE job_card_item_id = :job_card_item_id", TABLE_NAME );
|
private final String DELETE_BY_ITEM_ID = String.format( "DELETE FROM %s WHERE job_card_item_id = :job_card_item_id", TABLE_NAME );
|
||||||
|
|
||||||
public CutPieceDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
|
public CutPieceDAO(NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class ItemDAO {
|
||||||
TABLE_NAME);
|
TABLE_NAME);
|
||||||
private final String SELECT_BY_IDS = String.format("SELECT * FROM %s WHERE id IN (:ids)", TABLE_NAME);
|
private final String SELECT_BY_IDS = String.format("SELECT * FROM %s WHERE id IN (:ids)", TABLE_NAME);
|
||||||
private final String SELECT_BY_IDS_AND_ACTIVE = String.format("SELECT * FROM %s WHERE id IN (:ids) AND is_active = 1 ", TABLE_NAME);
|
private final String SELECT_BY_IDS_AND_ACTIVE = String.format("SELECT * FROM %s WHERE id IN (:ids) AND is_active = 1 ", TABLE_NAME);
|
||||||
private final String SELECT_LIKE_TITLE_AND_STATUS_QUERY = String.format("SELECT * FROM %s WHERE is_active = :is_active AND title LIKE :title ORDER BY title ASC", TABLE_NAME);
|
private final String SELECT_LIKE_TITLE_AND_STATUS_QUERY = String.format("SELECT * FROM %s WHERE is_active = :is_active AND title LIKE :title ORDER BY title ASC limit 100 offset 0", TABLE_NAME);
|
||||||
private final String SELECT_LIKE_TITLE_BY_DEPARTMENT_QUERY =
|
private final String SELECT_LIKE_TITLE_BY_DEPARTMENT_QUERY =
|
||||||
String.format("SELECT * FROM %s WHERE department_id = :department_id AND title LIKE :title ORDER BY title ASC", TABLE_NAME);
|
String.format("SELECT * FROM %s WHERE department_id = :department_id AND title LIKE :title ORDER BY title ASC", TABLE_NAME);
|
||||||
private final String SELECT_LIKE_TITLE = String.format("SELECT * FROM %s WHERE title LIKE :item_title", TABLE_NAME);
|
private final String SELECT_LIKE_TITLE = String.format("SELECT * FROM %s WHERE title LIKE :item_title", TABLE_NAME);
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class PurchaseOrderDAO {
|
||||||
private final String SELECT_BY_PO_IDS_AND_ISCOMPLETED = String.format("SELECT * FROM %s WHERE id IN (:id) AND completed = :completed AND management_status = :management_status ORDER BY id DESC", TABLE_NAME);
|
private final String SELECT_BY_PO_IDS_AND_ISCOMPLETED = String.format("SELECT * FROM %s WHERE id IN (:id) AND completed = :completed AND management_status = :management_status ORDER BY id DESC", TABLE_NAME);
|
||||||
private final String SELECT_BY_GENERATED_BY_USER_AND_COMPANY_DETAILS_QUERY = String.format("SELECT * FROM %s WHERE generated_by_user = :generated_by_user AND company_id = :company_id AND function_id = :function_id AND department_id = :department_id AND section_id = :section_id", TABLE_NAME);
|
private final String SELECT_BY_GENERATED_BY_USER_AND_COMPANY_DETAILS_QUERY = String.format("SELECT * FROM %s WHERE generated_by_user = :generated_by_user AND company_id = :company_id AND function_id = :function_id AND department_id = :department_id AND section_id = :section_id", TABLE_NAME);
|
||||||
|
|
||||||
private final String SELECT_BY_TERM = String.format( "SELECT * FROM %s WHERE code LIKE :term", TABLE_NAME );
|
private final String SELECT_BY_TERM = String.format( "SELECT * FROM %s WHERE code LIKE :term limit 100 offset 0", TABLE_NAME );
|
||||||
|
|
||||||
public PurchaseOrderDAO(@Qualifier("namedParameterJdbcTemplateUind") NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
|
public PurchaseOrderDAO(@Qualifier("namedParameterJdbcTemplateUind") NamedParameterJdbcTemplate namedParameterJdbcTemplate) {
|
||||||
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
|
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
|
||||||
|
|
|
@ -7,8 +7,11 @@ spring:
|
||||||
logbackUrl: jdbc:mysql://localhost:3306/uind_logs?serverTimezone=Asia/Karachi
|
logbackUrl: jdbc:mysql://localhost:3306/uind_logs?serverTimezone=Asia/Karachi
|
||||||
hikari:
|
hikari:
|
||||||
maximum-pool-size: 5
|
maximum-pool-size: 5
|
||||||
pool-name: UINDMainPool
|
minimum-idle: 5
|
||||||
leak-detection-threshold: 2000
|
idle-timeout: 30000 # 30 seconds
|
||||||
|
max-lifetime: 1800000 # 30 minutes
|
||||||
|
connection-timeout: 30000 # 30 seconds
|
||||||
|
leak-detection-threshold: 10000
|
||||||
cosmosdatasource:
|
cosmosdatasource:
|
||||||
jdbcUrl: jdbc:mysql://localhost:3307
|
jdbcUrl: jdbc:mysql://localhost:3307
|
||||||
username: root
|
username: root
|
||||||
|
|
Loading…
Reference in New Issue