|
package com.ekexiu.portal.dao;
import java.sql.Connection;
import java.sql.SQLException;
import org.jfw.apt.annotation.DefaultValue;
import org.jfw.apt.annotation.Nullable;
import org.jfw.apt.orm.annotation.dao.Column;
import org.jfw.apt.orm.annotation.dao.DAO;
import org.jfw.apt.orm.annotation.dao.method.From;
import org.jfw.apt.orm.annotation.dao.method.Or;
import org.jfw.apt.orm.annotation.dao.method.Where;
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
import org.jfw.apt.orm.annotation.dao.method.operator.QueryVal;
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
import org.jfw.apt.orm.annotation.dao.param.Alias;
import org.jfw.apt.orm.annotation.dao.param.Set;
import org.jfw.apt.orm.core.defaultImpl.IntHandler;
import com.ekexiu.portal.po.User;
@DAO
public interface UserDao {
@Nullable
@SelectOne
User query(Connection con,String id)throws SQLException;
@Or
@Nullable
@SelectOne
User queryByEmailOrMobilePhone(Connection con,@Alias({"email","mobilePhone"}) String key)throws SQLException;
@DeleteWith
@From(User.class)
int delete(Connection con, String id) throws SQLException;
@Insert
int insert(Connection con,User user)throws SQLException;
@UpdateWith
@From(User.class)
int updateSendMailStatus(Connection con,@Set Integer sendMailStatus,String id)throws SQLException;
@UpdateWith
@From(User.class)
int updateInviteCode(Connection con,@Set String inviteCode,String id)throws SQLException;
@UpdateWith
@From(User.class)
int updateEmail(Connection con,@Set String email,String id)throws SQLException;
@UpdateWith
@From(User.class)
int updateMobilePhone(Connection con,@Set String mobilePhone,String id)throws SQLException;
@UpdateWith
@From(User.class)
int updatePassword(Connection con,@Set String passwd,String id)throws SQLException;
@Or
@UpdateWith
@From(User.class)
int updatePasswordWithMobileOrEmail(Connection con,@Set String passwd,@Alias({"email","mobilePhone"}) String key)throws SQLException;
@QueryVal
@Column(handlerClass=IntHandler.class, value = { "COUNT(1)" })
@From(User.class)
@DefaultValue("0")
int countAll(Connection con)throws SQLException;
@QueryVal
@Column(handlerClass=IntHandler.class, value = { "COUNT(1)" })
@From(User.class)
@DefaultValue("0")
@Where("PASSWD<>'11111111111111111111111111111111'")
int countActived(Connection con)throws SQLException;
}
|