parent
96214af01a
commit
291fc81385
8 changed files with 146 additions and 27 deletions
@ -0,0 +1,91 @@ |
||||
<?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.lq.dao.WechatUserDao"> |
||||
<!-- namespace命名空间,作用是对sql进行分类化管理,理解sql隔离 --> |
||||
<!-- 注意:使用mapper代理方法开发 ,namespace有着特殊作用--> |
||||
|
||||
<sql id="column_list"> |
||||
country,unionid,sybscribe_scene,qr_scene,qr_scene_str,subscribe_time,city,tagid_id,open_id,nick_name,sex,groupid,language,remark,province,head_img_url,wechat_info_id,id,status |
||||
</sql> |
||||
|
||||
<select id="findOne" resultType="com.lq.entity.WechatUser" parameterType="long"> |
||||
SELECT <include refid="column_list"/> |
||||
FROM wechat_user |
||||
WHERE id=#{id} AND status = 1 |
||||
</select> |
||||
|
||||
<select id="findAll" resultType="com.lq.entity.WechatUser"> |
||||
SELECT <include refid="column_list"/> |
||||
FROM wechat_user |
||||
WHERE status = 1 |
||||
</select> |
||||
|
||||
<select id="count" resultType="int"> |
||||
SELECT count(id) |
||||
FROM wechat_user |
||||
WHERE status = 1 |
||||
</select> |
||||
|
||||
<insert id="save" parameterType="com.lq.entity.WechatUser" useGeneratedKeys="true" keyProperty="id"> |
||||
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="Long"> |
||||
SELECT LAST_INSERT_ID() |
||||
</selectKey> |
||||
INSERT INTO |
||||
wechat_user(country,unionid,sybscribe_scene,qr_scene,qr_scene_str,subscribe_time,city,tagid_id,open_id,nick_name,sex,groupid,language,remark,province,head_img_url,wechat_info_id,id,status) |
||||
VALUES |
||||
( |
||||
#{country},#{unionid},#{sybscribeScene},#{qrScene},#{qrSceneStr},#{subscribeTime},#{city},#{tagidId},#{openId},#{nickName},#{sex},#{groupid},#{language},#{remark},#{province},#{headImgUrl},#{wechatInfoId},#{id},#{status} |
||||
) |
||||
</insert> |
||||
|
||||
|
||||
<update id="update" parameterType="com.lq.entity.WechatUser"> |
||||
UPDATE |
||||
wechat_user |
||||
<trim prefix="set" suffixOverrides=","> |
||||
|
||||
<if test="country!=null">country=#{country},</if> |
||||
<if test="unionid!=null">unionid=#{unionid},</if> |
||||
<if test="sybscribeScene!=null">sybscribe_scene=#{sybscribeScene},</if> |
||||
<if test="qrScene!=null">qr_scene=#{qrScene},</if> |
||||
<if test="qrSceneStr!=null">qr_scene_str=#{qrSceneStr},</if> |
||||
<if test="subscribeTime!=null">subscribe_time=#{subscribeTime},</if> |
||||
<if test="city!=null">city=#{city},</if> |
||||
<if test="tagidId!=null">tagid_id=#{tagidId},</if> |
||||
<if test="openId!=null">open_id=#{openId},</if> |
||||
<if test="nickName!=null">nick_name=#{nickName},</if> |
||||
<if test="sex!=null">sex=#{sex},</if> |
||||
<if test="groupid!=null">groupid=#{groupid},</if> |
||||
<if test="language!=null">language=#{language},</if> |
||||
<if test="remark!=null">remark=#{remark},</if> |
||||
<if test="province!=null">province=#{province},</if> |
||||
<if test="headImgUrl!=null">head_img_url=#{headImgUrl},</if> |
||||
<if test="wechatInfoId!=null">wechat_info_id=#{wechatInfoId},</if> |
||||
<if test="id!=null">id=#{id},</if> |
||||
<if test="status!=null">status=#{status},</if> |
||||
</trim> |
||||
WHERE |
||||
id=#{id} |
||||
</update> |
||||
|
||||
<update id="delete" parameterType="Long"> |
||||
UPDATE |
||||
FROM wechat_user |
||||
SET |
||||
status = 0 |
||||
WHERE |
||||
id=#{id} |
||||
</update> |
||||
|
||||
<select id="getByOpenId" resultType="WechatUser"> |
||||
select <include refid="column_list"/> |
||||
FROM wechat_user |
||||
where |
||||
status = 1 |
||||
and |
||||
open_id = #{openId} |
||||
</select> |
||||
|
||||
</mapper> |
@ -1,16 +1,25 @@ |
||||
#--------- jdbc ÅäÖÃ--------- |
||||
jdbc.driver=com.mysql.jdbc.Driver |
||||
jdbc.url=jdbc:mysql://localhost:3306/ssm?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8 |
||||
jdbc.user=root |
||||
jdbc.password=mysql |
||||
#\u5B9A\u4E49\u521D\u59CB\u8FDE\u63A5\u6570 |
||||
initialSize=0 |
||||
#\u5B9A\u4E49\u6700\u5927\u8FDE\u63A5\u6570 |
||||
maxActive=5 |
||||
#\u5B9A\u4E49\u6700\u5927\u7A7A\u95F2 |
||||
maxIdle=5 |
||||
#\u5B9A\u4E49\u6700\u5C0F\u7A7A\u95F2 |
||||
minIdle=1 |
||||
#\u5B9A\u4E49\u6700\u957F\u7B49\u5F85\u65F6\u95F4 |
||||
maxWait=6000 |
||||
email.port=Create property |
||||
#--------Êý¾Ý¿âÁ¬½Ó³ØÅäÖà ------- |
||||
durid.pool.initialSize=5 |
||||
durid.pool.maxActive=5 |
||||
durid.pool.minIdle=1 |
||||
durid.pool.maxWait=60000 |
||||
durid.pool.timeBetweenEvictionRunsMillis=60000 |
||||
durid.pool.filters=stat |
||||
durid.pool.poolPreparedStatements=false |
||||
durid.pool.maxPoolPreparedStatementPerConnectionSize=100 |
||||
durid.pool.minEvictableIdleTimeMillis=300000 |
||||
durid.pool.validationQuery=SELECT 'X' |
||||
durid.pool.testWhileIdle=true |
||||
durid.pool.testOnBorrow=false |
||||
durid.pool.testOnReturn=false |
||||
durid.pool.removeAbandonedTimeout=1800 |
||||
durid.pool.logAbandoned=true |
||||
|
||||
|
||||
durid.pool.email.port=Create property |
||||
|
||||
|
Loading…
Reference in new issue