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>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM