// 更新用户微信信息
func (sqlBasis *iotsqlDbBasis) updateWechatData(rndFlag string, auiID, auiSource int, sex, nickname, position string) bool {
// 处理昵称长度
nickname = xstring.SubString(nickname, 100)
sqlStr := `DECLARE @res INT
DECLARE @auiid INT= ?
DECLARE @auid_sex INT= ?
DECLARE @aux_nick_name VARCHAR(100)= ?
DECLARE @auid_position VARCHAR(100)= ?
DECLARE @auid_signature VARCHAR(200)= ?
SELECT TOP 1
@res = auid_auiid
FROM ALL_USER_INFO_DETAIL
WHERE auid_auiid = @auiid
ORDER BY auid_auiid DESC
IF ( @res IS NULL OR @res = 0 )
BEGIN
INSERT INTO [ALL_USER_INFO_DETAIL] ([auid_auiid],[auid_sex],[auid_position],[auid_signature],auiid_edit_time)
VALUES ( @auiid,@auid_sex,@auid_position,@auid_signature,GETDATE())
SET @res=@@ROWCOUNT
END
ELSE
SET @res=0
-- 更新用户微信资料
UPDATE ALL_USER_WX SET aux_nick_name = @aux_nick_name,aux_source=` + fmt.Sprintf("%d", auiSource) + ` , aux_live_time = GETDATE() WHERE aux_auiid = @auiid
SET @res=@@ROWCOUNT+@res
--返回执行结果
SELECT @res AS 'res'`
_, res := sqlBasis.execSQLReInt(rndFlag, sqlStr, auiID, sex, nickname, position, "")
return res > 0
}