⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sqlconst.java

📁 好的超市源码供大家下载
💻 JAVA
字号:
package common.jdbc;

/**
 * 所有表中的有关SQL操作语句
 * @author linfeng
 *
 */
public interface SqlConst {
  //用户表user_pwd的有关操作语句
  public static final String SELECT_USER_INFO = "select * from user_pwd";
  public static final String SELECT_USER = "select * from user_pwd "
      + "where user_name = ? and password = ? and user_type = ?";
  public static final String SELECT_USER_BY_ID = "select * from user_pwd" +
        "where user_id = ?";
  public static final String INSERT_USER = "insert into user_pwd "
      + "values(?,?,?,?,?)";
  public static final String MODIFY_USER = "update user_pwd set user_name"
      + " = ?,user_type = ?,password = ?,phone = ? where user_id = ?";  
  public static final String UPDATE_USER = "update user_pwd set user_id = ?" +
        ",user_name = ?,user_type = ?,password = ?,phone = ?where user_id = ?";
  public static final String DELETE_USER_BY_ID = "delete user_pwd where user_id = ?";
  public static final String DELETE_USER_BY_NAME = "delete user_pwd where user_name = ?";
  
  //会员表VIP的有关操作语句
  public static final String SELECT_VIP_INFO = "select * from VIP";
  public static final String SELECT_VIP_BY_ID = "select * from VIP where vip_id = ?";
  public static final String SELECT_VIP_NAME_BY_ID = "select vip_name from VIP where vip_id = ?";
  public static final String SELECT_VIP_PCT_BY_ID = "select price_pct from VIP where vip_id = ?";
  public static final String SELECT_VIP_TYPE_BY_ID = "select vip_type from VIP where vip_id = ?";
  public static final String SELECT_VIP_PHONE_BY_ID = "select phone from VIP where vip_id = ?";
  public static final String INSERT_VIP = "insert into VIP values(?,?,?,?,?)";
  public static final String MODIFY_VIP = "update VIP set vip_name"
      + " = ?,vip_type = ?,price_pct = ?,phone = ? where vip_id = ?";
  public static final String UPDATE_VIP = "update VIP set vip_id = ?" +
  ",vip_name = ?,vip_type = ?,price_pct = ?,phone = ? where vip_id = ?";
  public static final String DELETE_VIP_BY_ID = "delete VIP where vip_id = ?";
  public static final String DELETE_VIP_BY_NAME = "delete VIP where vip_name = ?";
  
  //进货表stock_product的有关操作语句
  public static final String SELECT_STOCK_BY_ID = "select * from stock_product where product_id = ?";
  public static final String SELECT_STOCK_BY_NAME = "select * from stock_product where product_name = ?";
  public static final String SELECT_STOCK_BY_TYPE = "select * from stock_product where product_type = ?";
  public static final String SELECT_STOCK_BY_DATE = "select * from stock_product where stock_date = to_date(?,'YYYY-MM-DD')";
  public static final String SELECT_STOCK_INFO = "select * from stock_product";
  public static final String INSERT_STOCK = "insert into stock_product values(?,?,?,?,?,to_date(?,'YYYY-MM-DD'))";
  
  //存货表store_product的有关操作语句
  public static final String SELECT_STORE_BY_ID = "select * from store_product where product_id = ?";
  public static final String SELECT_STORE_NAME_BY_ID = "select product_name from store_product where product_id = ?";
  public static final String SELECT_STORE_PRICE_BY_ID = "select price from store_product where product_id = ?";
  public static final String SELECT_STORE_TYPE_BY_ID = "select product_type from store_product where product_id = ?";
  public static final String SELECT_STORE_NUM_BY_ID = "select stock_num from store_product where product_id = ?";
  public static final String SELECT_STORE_BY_NAME = "select * from store_product where product_name like ?";
  public static final String SELECT_STORE_BY_TYPE = "select * from store_product where product_type = ?";
  public static final String SELECT_STORE_BY_DATE = "select * from store_product where stock_date = to_date(?,'YYYY-MM-DD')";
  public static final String SELECT_STORE_INFO = "select * from store_product";
  public static final String UPDATE_STORE_BY_ID = "update store_product set stock_num = stock_num - ? where product_id = ?";
  public static final String INSERT_STORE = "insert into store_product values(?,?,?,?,?,to_date(?,'YYYY-MM-DD'))";
  
  //销售表sale_product的有关操作语句
  public static final String SELECT_SALE_BY_ID = "select * from sale_product where product_id = ?";
  public static final String SELECT_SALE_BY_NAME = "select * from sale_product where product_name = ?";
  public static final String SELECT_SALE_BY_TYPE = "select * from sale_product where product_type = ?";
  public static final String SELECT_SALE_BY_DATE = "select * from sale_product where sale_date = to_date(?,'YYYY-MM-DD')";
  public static final String SELECT_SALE_INFO = "select * from sale_product";
  public static final String INSERT_SALE = "insert into sale_product values(?,?,?,?,?,?,?,to_date(?,'YYYY-MM-DD'))";
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -