插入数据时,属性为DateOnly时,拼出来的SQL日期多了时间部分 返回
SqlSugar
处理中
4
240
悬赏:0 飞吻
我测试的实体类型如下:

执行后日志输出的SQL:
INSERT INTO "test_table"
("time_only","date_only","date_time_offset","date_time","tenant_id","id","is_deleted","state_code","is_system","create_time","create_user_id","update_time","update_user_id","version_number")
VALUES
(null,'2021-01-01 00:00:00.000',null,null,null,2012080770079920128,0,0,false,N'2026/1/16 8:33:32 +00:00',1001,N'2026/1/16 8:33:32 +00:00',1001,0) ;
'2021-01-01 00:00:00.000' 多了00:00:00.000这部分,期望的是'2021-01-01',数据库里面的类型是date,这种带时间的会报错提示: Cannot write DateTime with Kind=Unspecified to PostgreSQL type 'timestamp with time zone', only UTC is supported. Note that it's not possible to mix DateTimes with different Kinds in an array, range, or multirange. (Parameter 'value').
有什么好的办法解决吗?求助大佬
热忱回答(4)
-
fate sta VIP0
2周前我这边测试一下
0 回复 -
爱咕咕的布咕 VIP0
2周前@fate sta:麻烦大佬了
0 回复 -
爱咕咕的布咕 VIP0
2周前@fate sta:有解决方案吗
0 回复 -
爱咕咕的布咕 VIP0
2周前@fate sta:


0 回复