The data that is converted into a character type in the SQL statement is completed for the numeric type.
Like this time will read out the float type of data in the Jsonobject.fromobject (object). toString ();
This method does not retain the data type to be retained after the decimal point, like 100.00 of this data, into the JSON data converted into 100, not conducive to the effect of the display.
At the same time, since I am a list collection queried through SQL statements, it is difficult and inefficient to modify them in Java code, so consider implementing them in SQL.
Implemented in MyBatis, CONVERT (Q.quotediscountamount,char (20))
------------------------------
SELECT S.taskcode,p.prvshotname,convert (Q.quotediscountamount,char) as Quoteamount,q.inscomcode,s.taskstate From Insbworkflowmain m
Left JOIN insbworkflowsub s on m.instanceid = S.maininstanceid
Left JOIN insbquoteinfo q on q.workflowinstanceid = S.instanceid
Left JOIN Insbprovider p on p.prvcode = Q.inscomcode where m.instanceid= #{processinstanceid}
------------------------------
CONVERT (Q.quotediscountamount,char); You can also remove the length limit here.
Similarly, other formats can also be converted
binary[(N)]
char[(N)]
DATE
Time
DateTime Date Time
DECIMAL floating-point number
Signed [integer] integer
UNSIGNED [integer] unsigned integer
-----------------------------------------
Date,time,datetime three different kinds of time:
Date: Type, MySQL retrieves and displays the date value in ' YYYY-MM-DD ' format, with no time portion.
Time: Date type, which represents the time of day, MySQL retrieves and displays the value in "HH:MM:SS" format.
DateTime: Date and Time type, sum of both.
In addition, MySQL also has one of the following:
TIMESTAMP, a column type provides a type that you can use to automatically mark an INSERT or update operation with the current date and time.
Data conversion for MySQL