65 lines
2.3 KiB
XML
Raw Permalink Normal View History

2026-03-10 14:30:24 +08:00
<?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="BindInfo">
<insert id="insertBindInfo" parameterType="BindInfo">
INSERT INTO BindInfo ( openId, uid, userType, created, status , areaid , cellphone ,type ) Values ( #{openId}, #{uid}, #{userType},current_timestamp, #{status} , #{areaid} , #{cellphone} ,#{type} )
</insert>
<update id="updateBindInfo" parameterType="BindInfo">
UPDATE BindInfo SET
uid = #{uid}, created = #{created}, status = #{status} , areaid = #{areaid} , cellphone = #{cellphone}
where openId=#{openId} and userType=#{userType} and type= #{type}
</update>
<select id="getBindInfoByKey" parameterType="java.util.Map" resultType="BindInfo">
SELECT openId , uid , userType , created , status ,areaid , cellphone,type
FROM BindInfo WHERE openId=#{openId} and userType=#{userType} and status=1
</select>
<select id="getBindInfoByKeyTwo" parameterType="java.util.Map" resultType="BindInfo">
SELECT openId , uid , userType , created , status ,areaid , cellphone,type
FROM BindInfo WHERE openId=#{openId} and userType=#{userType}
</select>
<select id="getSeqBindInfo" resultType="Integer" useCache="false" flushCache="true">
SELECT nextval('seq_bindInfoId') ;
</select>
<select id="getBindInfoByClassesId" parameterType="Long" resultType="WeixinName">
select sa.openid , st.truename from
(select b.openid , s.studentid from bindinfo b
inner join studentownclass s on b.uid = s.studentid and b.status=1 and b.type =1
where s.classesid = #{classid} and s.status = 1) sa
inner join student st on sa.studentid = st.studentid
</select>
<select id="getBindInfoByUid" parameterType="Long" resultType="String">
SELECT openId FROM BindInfo WHERE uid = #{uid} and type = 1
</select>
<!-- <delete id="delBindInfo" parameterClass="java.util.Map">
delete from bindinfo where openId = #{openId} and userType = #{userType}
</delete> -->
<update id="delBindInfo" parameterType="java.util.Map">
update bindinfo set status=0 where openId = #{openId} and userType = #{userType} and type = #{type}
</update>
</mapper>