• postgreSQL alter column data type to timestamp without time zone


    现在公司数据访问层用的是mybatis框架,数据库用的pgsql,其中日期字段指定的是timestamp类型的。实体类是String类型的。

    现在在执行更新操作的时候报这个错误:postgreSQL alter column data type to timestamp without time zone

    以后要一定要多注意,报错的提示信息,其实上面就有交给你怎样进行修改,修改后的sql语句:

    <update id="updateProductService"  parameterType="com.picc.hmims.productInfo.dto.ProductServiceBo">
            update t_product_service
            <set>
                <if test="productId != null" >
                    product_id=cast(#{productId} as NUMERIC ),
                </if>
                <if test="parentServiceId != null" >
                    parent_service_id=cast(#{parentServiceId} as NUMERIC ),
                </if>
                <if test="serviceId != null" >
                    service_id=cast(#{serviceId} as NUMERIC ),
                </if>
                <if test="exeOrder != null" >
                    exe_order=cast(#{exeOrder} as NUMERIC ),
                </if>
                <if test="serviceCode != null" >
                    service_code=#{serviceCode},
                </if>
                <if test="serviceName != null" >
                    service_name=#{serviceName},
                </if>
                <if test="chargingWay != null" >
                    charging_way=#{chargingWay},
                </if>
                <if test="availableAmount != null" >
                    available_amount=cast(#{availableAmount} as NUMERIC ),
                </if>
                <if test="amountUnit != null" >
                    amount_unit=#{amountUnit},
                </if>
                <if test="priceOption != null" >
                    price_option=#{priceOption},
                </if>
                <if test="price != null" >
                    price=cast(#{price} as NUMERIC ),
                </if>
                <if test="cost != null" >
                    cost=cast(#{cost} as NUMERIC ),
                </if>
                <if test="probabilityCost != null" >
                    probability_cost=cast(#{probabilityCost} as NUMERIC ),
                </if>
                <if test="limitType != null" >
                    limit_type=#{limitType},
                </if>
                <if test="isWaitingPeriod != null" >
                    is_waiting_period=#{isWaitingPeriod},
                </if>
                <if test="waitingPeriod != null" >
                    waiting_period=cast(#{waitingPeriod} as NUMERIC ),
                </if>
                <if test="serviceOption != null" >
                    service_option=#{serviceOption},
                </if>
                <if test="serviceAppoint != null" >
                    service_appoint=#{serviceAppoint},
                </if>
                <if test="serviceNum != null" >
                    service_num=cast(#{serviceNum} as NUMERIC ),
                </if>
                <if test="serviceType != null" >
                    service_type=#{serviceType},
                </if>
                <if test="serviceWay != null" >
                    service_way=#{serviceWay},
                </if>
                <if test="insertOper != null" >
                    insert_oper=#{insertOper},
                </if>
                <if test="insertTime != null" >
    
    
                    insert_time=TO_TIMESTAMP(#{insertTime}, 'yyyy-MM-ddTHH24:mm:ss.SSSZ'),
                </if>
                <if test="updateTime != null" >
    
                    update_time=TO_TIMESTAMP(#{updateTime}, 'yyyy-MM-ddTHH24:mm:ss.SSSZ'),
                </if>
                <if test="updateOper != null" >
                    update_oper=#{updateOper},
                </if>
                <if test="balanceType != null" >
                    balance_type=#{balanceType},
                </if>
                <if test="servicePriceOption != null" >
                    service_price_option=#{servicePriceOption}
                </if>
            </set>
            where product_service_id = cast(#{productServiceId} as NUMERIC )
        </update>
  • 相关阅读:
    企业视频会议EasyRTC视频云服务是如何满足不同企业多场景直播的?
    TSINGSEE青犀视频H265网页播放器EasyPlayerPro-Win如何通过配置文件实现自动播放等功能?
    TSINGSEE青犀视频自主研发H265播放器EasyPlayerPro-Win C++如何获取软件版本信息源码
    RTMP视频直播点播平台EasyDSS及企业视频通话会议系统EasyRTC内启动nginx 配置重定向功能介绍
    面向对象程序设计上机练习二(函数模板)
    2014暑假ACM训练总结
    codeforces 之 Little Pigs and Wolves
    SDUT 2766 小明传奇2
    0-1背包的总结
    POJ 2063 Investment (完全背包)
  • 原文地址:https://www.cnblogs.com/dongyaotou/p/12554214.html
Copyright © 2020-2023  润新知