UserDao.xml
797 Bytes
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gxb.modules.api.dao.UserDao">
<insert id="save" parameterType="com.gxb.modules.api.entity.UserEntity" useGeneratedKeys="true" keyProperty="userId">
insert into tb_user
(
`username`,
`mobile`,
`password`,
`create_time`
)
values
(
#{username},
#{mobile},
#{password},
#{createTime}
)
</insert>
<select id="queryObject" resultType="com.gxb.modules.api.entity.UserEntity">
select * from tb_user where user_id = #{value}
</select>
<select id="queryByMobile" resultType="com.gxb.modules.api.entity.UserEntity">
select * from tb_user where mobile = #{value}
</select>
</mapper>