FootStoneDao.java 1.65 KB
package com.pipi.dao;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.apache.log4j.Logger;

import com.fangdd.qa.framework.utils.common.DbUtil;
import com.pipi.sql.FootStoneSql;

public class FootStoneDao {

	private static DbUtil DbUtil;
	private final static Logger logger = Logger.getLogger(FootStoneDao.class);

	public static int ps_person_contact_delete(String contact_name) {
		DbUtil = new DbUtil();
		String[] pereson_contact_list = {contact_name};
		int res = DbUtil.delete(FootStoneSql.ps_person_contact_delete, pereson_contact_list);
		DbUtil.close();
		return res;
	}

	public static int ps_person_contact_phone_delete(String phone) {
		DbUtil = new DbUtil();
		String[] ps_pereson_contact_phone_list = {phone};
		int res = DbUtil.delete(FootStoneSql.ps_person_contact_phone_delete, ps_pereson_contact_phone_list);
		DbUtil.close();
		return res;
	}
	
	public static String ps_person_contact_phone_query(String contact_id) {
		String phone_id = null;
		DbUtil = new DbUtil();
		String[] ps_pereson_contact_phone_list = {contact_id};
		ResultSet res = DbUtil.query(FootStoneSql.ps_person_contact_phone_query, ps_pereson_contact_phone_list);
		try {
			while (res.next()) {
				phone_id = res.getString("phone_id");
				System.out.println(phone_id);
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		DbUtil.close();
		return phone_id;
	}
	
	public static void main(String args[]) {

	//	FootStoneDao.ps_person_contact_delete("董虎");
		//FootStoneDao.ps_person_contact_phone_delete("13823774138");
		FootStoneDao.ps_person_contact_phone_query("7f0000015e9806c6015f332a8a2f6fcc");
	}
}