sqlmap-auth.xml 2.18 KB
<?xml version="1.0" encoding="UTF-8"?>
<sqlMap namespace="auth">
	<select id="getAuthByTypeAndAid">
		SELECT * FROM `tbl_auth_info` where `type` = :type AND `auth_id`=:auth_id LIMIT 1 
	</select>
	<insert id="setAuth">
		INSERT INTO `tbl_auth_info` (`uid`,`type`,`auth_id`,`create_time`) values (:uid, :type, :auth_id,:create_time) ON DUPLICATE KEY UPDATE `uid` = :uid, `auth_id` = :auth_id
	</insert>
	<delete id="delAuth">
		DELETE FROM `tbl_auth_info` WHERE `uid`=:uid and `type`=:type and `auth_id`=:auth_id
	</delete>
	<select id="getAllAuth">
		SELECT type,auth_id FROM `tbl_auth_info` WHERE `uid`=:uid
	</select>
	<delete id="deleteUser">
		DELETE FROM `tbl_basic_info` WHERE `uid`=:uid;
		DELETE FROM `tbl_password` WHERE `uid`=:uid;
		DELETE FROM `tbl_auth_info` WHERE `uid`=:uid;
	</delete>
	
	<insert id="setUserinfo">
		INSERT INTO `tbl_basic_info` (#fields#) VALUES (#string#) 
	</insert>
	<update id="updateUserinfo">
		UPDATE `tbl_basic_info` SET #upstring# WHERE  `uid`=:uid
	</update>
	<select id="getUserinfo">
		SELECT #fields# FROM `tbl_basic_info` where `uid` = :uid LIMIT 1 
	</select>
	
	<insert id="setPassword">
		INSERT INTO `tbl_password` (`uid`,`password`,`password_salt`) values (:uid, :password, :password_salt) ON DUPLICATE KEY UPDATE `password` = :password , `password_salt`=:password_salt 
	</insert>
	<select id="getPassword">
		SELECT * FROM `tbl_password` WHERE `uid`=:uid
	</select>
    <update id="updAuth">
		UPDATE `tbl_auth_info` SET `auth_id`=:auth_id WHERE uid=:id AND type=:type
    </update>	
    
       
    <select id="getYohobuyAccountByShowId">
		SELECT * FROM `tbl_show_relevance` WHERE `show_uid`=:show_uid
	</select>
	<select id="getShowUidBySsoId">
		SELECT sso_uid,show_uid FROM `tbl_show_relevance` WHERE `sso_uid` IN (#sso_uid#)
	</select>
	<insert id="relevanceYohobuyAccount">
		INSERT INTO `tbl_show_relevance` (`show_uid`,`sso_uid`,`create_time`) values (:show_uid, :sso_uid, UNIX_TIMESTAMP())  
	</insert>
	<delete id="removeYohobuyAccount">
		DELETE FROM  `tbl_show_relevance`  WHERE `show_uid` = :show_uid and `sso_uid`=:sso_uid
	</delete>
	<select id="getFacebookRela">
	   SELECT `openid` FROM `tbl_facebook_rela` WHERE `new_openid`=:new_openid
	</select>
</sqlMap>