No Description

UserDao.java 3.1KB

    package com.ekexiu.project.bridge.system.dao; import com.ekexiu.project.bridge.right.po.UserBridge; import com.ekexiu.project.bridge.system.po.Notice; import com.ekexiu.project.bridge.system.po.User; import org.jfw.apt.annotation.Nullable; import org.jfw.apt.orm.annotation.dao.Batch; import org.jfw.apt.orm.annotation.dao.DAO; import org.jfw.apt.orm.annotation.dao.Dynamic; import org.jfw.apt.orm.annotation.dao.method.Exclude; import org.jfw.apt.orm.annotation.dao.method.From; import org.jfw.apt.orm.annotation.dao.method.IncludeFixSet; import org.jfw.apt.orm.annotation.dao.method.SetSentence; 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.PageSelect; import org.jfw.apt.orm.annotation.dao.method.operator.SelectList; import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne; import org.jfw.apt.orm.annotation.dao.method.operator.Update; import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith; import org.jfw.apt.orm.annotation.dao.param.Like; import org.jfw.apt.orm.annotation.dao.param.Set; import org.jfw.apt.orm.annotation.dao.param.SqlColumn; import org.jfw.apt.orm.core.defaultImpl.StringHandler; import org.jfw.util.PageQueryResult; import java.sql.Connection; import java.sql.SQLException; import java.util.List; /** * Created by TT on 2018/8/7. */ @DAO public interface UserDao { @Nullable @SelectOne User query(Connection con, String id) throws SQLException; @Nullable @SelectOne User login(Connection con, String account, String passwd) throws SQLException; @Insert int insert(Connection con, User user) throws SQLException; @Update @Exclude({"passwd","type","active"}) @Dynamic int update(Connection con, User user) throws SQLException; @UpdateWith @From(User.class) int updatePasswdWithMobile(Connection con, @Set String passwd, String account) throws SQLException; @UpdateWith @From(User.class) @SetSentence("active = '0'") int ban(Connection con, @Set String modifier, String id) throws SQLException; @PageSelect @Where("active = '1'") PageQueryResult<User> pageQuery(Connection con, @Nullable String account, @Nullable @Like String name, @Nullable @Like String comp, int pageSize, int pageNo) throws SQLException; @UpdateWith @From(User.class) int changePw(Connection con, @Set String passwd, String id) throws SQLException; @UpdateWith @From(Notice.class) @IncludeFixSet("modifyTime") int updateNotice(Connection con, @Set String cnt, @Set String modifier) throws SQLException; @Nullable @SelectOne User queryByAccount(Connection con, String account) throws SQLException; @Insert @Batch int[] insert(Connection con, UserBridge[] userBridges) throws SQLException; @DeleteWith @From(UserBridge.class) int delete(Connection con, String uid) throws SQLException; @SelectList @From(User.class) List<User> queryByBridgeId(Connection con, @SqlColumn(value = "ID IN (SELECT UID FROM USER_BRIDGE WHERE BRIDGE=?)", handlerClass = StringHandler.class) String bridge, @Nullable Boolean active) throws SQLException; }