1、
2、
SqlCommandType sqlCommandType = mappedStatement.getSqlCommandType();
DataSource routedDataSource;
if (SqlCommandType.SELECT == sqlCommandType){
if(StringUtils.endsWith(mappedStatement.getId(), SUFFIX_USE_MASTER)) {
routedDataSource = writeDataSource;
logger.debug("Force use writeDataSource for {}: {}", sqlCommandType, routedDataSource);
} else {
routedDataSource = loadBalancer.select(readDataSources, mappedStatement, parameter);
logger.debug("Select readDataSource for {}: {}", sqlCommandType, routedDataSource);
}
} else {
routedDataSource = writeDataSource;
logger.debug("Select writeDataSource for {}: {}", sqlCommandType, routedDataSource);
}
/**
* 获取时间戳
*
* @param userId
* @return
*/
GuizuExpStamp getByUserId$Master(@Param("userId") int userId);
<!-- 获取贵族经验时间戳 -->
<select id="getByUserId$Master" parameterType="int"
resultMap="guizuExpStampResultMap">
select *
from
t_guizu_exp_stamp
where fk_user = #{userId}
</select>
2、