<!--get all the recommended merchants in the current city--
<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 < 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 data type conversion function use of cast vs. convert