📄 shopcarsqlmapdao.java
字号:
package omega.persistence.sqlmapdao;
import java.util.List;
import com.ibatis.sqlmap.client.SqlMapClient;
import omega.domain.Product;
import omega.domain.Shopcart;
import omega.persistence.iface.ShopCarDao;
public class ShopCarSqlMapDao implements ShopCarDao {
private static SqlMapClient sqlMapper=DaoConfig.getsqlMapper();
public List getShopCar(String username) throws Exception{
return sqlMapper.queryForList("getCarbyName",username);
}
public void delCar(int id) throws Exception {
sqlMapper.delete("deleteCar", id);
}
public void insertCar(Shopcart shopcar) throws Exception {
sqlMapper.insert("insertCar", shopcar);
}
public void updateCar(Shopcart shopcar) throws Exception {
sqlMapper.update("updateCar", shopcar);
}
public void updateCarByOrderid(Shopcart shopcar) throws Exception {
sqlMapper.update("updateCarbyOrderid", shopcar);
}
public void delCarbyusername(String username) throws Exception {
sqlMapper.delete("deleteCarbyusername", username);
}
public Shopcart getMaxId() throws Exception {
return (Shopcart) sqlMapper.queryForObject("getShopMaxId");
}
public int getCount() throws Exception {
return (Integer) sqlMapper.queryForObject("getShopCount");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -