日期:2014-05-18 浏览次数:20790 次
package zxw.model;
public class UserInf {
private Integer userId;
private String userName;
private String userPasswd;
//getter and setter
}
<mapper namespace="zxw.dao.UserInfMapper" >
<!-- public UserInf selectPublicName(String userName); -->
<select id="obtainedPublicName" resultType="zxw.model.UserInf" parameterType="java.lang.String">
select * from userInf where user_name = #{userName,jdbcType=VARCHAR}
</select>
</mapper>
package zxw.dao;
import zxw.model.UserInf;
public interface UserInfMapper {
/**根据名字查询数据*/
UserInf obtainedPublicName(String userName);
}
public static boolean checkUser(String userName , String userPasswd){
UserInfServiceI userInf = (UserInfServiceImpl)CreateBean.beanFactory("userInfService");
System.out.println(userInf.maxId());
UserInf user = userInf.findByName(userName);
System.out.println(user);
if( null == user )
return false ;
return (
! user.getUserName().equals(userName)
||
! user.getUserPasswd().equals(userPasswd)
)
?
false
:
true;
}
<resultMap id="ShopCar" type="com.able.mycu.model.course.ShopCar">
<result property="shopCarId" column="SHOP_CAR_ID" />
<result property="recruitId" column="RECRUIT_ID" />
<result property="number" column="NUMBER" />
<result property="courseId" column="COURSE_ID" />
<result property="mode" colum