码迷,mamicode.com
首页 > 数据库 > 详细

MySQL数据类型转换函数CAST与CONVERT的用法

时间:2018-05-02 11:22:26      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:util   where   sort   sele   result   end   now()   state   null   

技术分享图片

<!-- 获取当前城市的所有推荐商户 -->
<select id="findAllRecommendSupplier" resultType="java.util.Map">
SELECT s.supplier_id AS supplierId ,s.main_products AS mainProducts
,s.group_id AS groupId,s.head_url AS supplierHead,
s.repair_center_name AS repairCenterName,s.shop_url AS shopUrl
,s.manager_phone AS managerPhone, s.service_tel AS serviceTel,
s.pro_name AS proName ,s.city_name AS cityName ,s.area_name AS
areaName ,s.detailed ,shop_profile AS shopProfile,s.company AS
supplierName,s.head_url AS headUrl
FROM w_supplier_sort w
LEFT JOIN s_supplier s ON w.supplier_id = s.supplier_id
LEFT JOIN s_user u ON w.supplier_id = u.id
WHERE s.city_number = #{cityNumber,jdbcType=VARCHAR} AND
UNIX_TIMESTAMP(NOW())*1000 &lt; s.end_time
AND s.main_products is not NULL AND u.user_state = 0 AND u.account_state = 0
ORDER BY convert((sell_number /#{sellSum,jdbcType=BIGINT} * #{sellFaciend,jdbcType=DECIMAL} +
call_number/#{callSum,jdbcType=BIGINT} * #{callFaciend,jdbcType=DECIMAL}),decimal(18,10))
DESC
</select>

MySQL数据类型转换函数CAST与CONVERT的用法

标签:util   where   sort   sele   result   end   now()   state   null   

原文地址:https://www.cnblogs.com/flywang/p/8978841.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!