Commit 42560020 by zhengxj

finish 修正sql on 20190123 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@16975 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 2abb8d31
...@@ -83,14 +83,26 @@ ...@@ -83,14 +83,26 @@
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from sys_order from sys_order
where id = #{id,jdbcType=INTEGER} <where>
and order_sn = #{orderSn,jdbcType=VARCHAR} <if test="id != null">
and id = #{id,jdbcType=INTEGER}
</if>
<if test="orderSn != null">
and order_sn = #{orderSn,jdbcType=VARCHAR}
</if>
</where>
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="map"> <delete id="deleteByPrimaryKey" parameterType="map">
delete from sys_order delete from sys_order
where id = #{id,jdbcType=INTEGER} <where>
and order_sn = #{orderSn,jdbcType=VARCHAR} <if test="id != null">
</delete> and id = #{id,jdbcType=INTEGER}
</if>
<if test="orderSn != null">
and order_sn = #{orderSn,jdbcType=VARCHAR}
</if>
</where>
</delete>
<insert id="insert" parameterType="com.glsx.ordercenter.pojo.SysOrder"> <insert id="insert" parameterType="com.glsx.ordercenter.pojo.SysOrder">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
...@@ -356,36 +368,48 @@ ...@@ -356,36 +368,48 @@
update_by = #{updateBy,jdbcType=VARCHAR}, update_by = #{updateBy,jdbcType=VARCHAR},
</if> </if>
</set> </set>
where id = #{id,jdbcType=INTEGER} <where>
and order_sn = #{orderSn,jdbcType=VARCHAR} <if test="id != null">
and id = #{id,jdbcType=INTEGER}
</if>
<if test="orderSn != null">
and order_sn = #{orderSn,jdbcType=VARCHAR}
</if>
</where>
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.SysOrder"> <update id="updateByPrimaryKey" parameterType="com.glsx.ordercenter.pojo.SysOrder">
update sys_order update sys_order
set active_status = #{activeStatus,jdbcType=TINYINT}, set active_status = #{activeStatus,jdbcType=TINYINT},
canceled = #{canceled,jdbcType=TINYINT}, canceled = #{canceled,jdbcType=TINYINT},
order_type = #{orderType,jdbcType=TINYINT}, order_type = #{orderType,jdbcType=TINYINT},
shop_id = #{shopId,jdbcType=INTEGER}, shop_id = #{shopId,jdbcType=INTEGER},
contact = #{contact,jdbcType=VARCHAR}, contact = #{contact,jdbcType=VARCHAR},
phone_number = #{phoneNumber,jdbcType=INTEGER}, phone_number = #{phoneNumber,jdbcType=INTEGER},
car_brand = #{carBrand,jdbcType=VARCHAR}, car_brand = #{carBrand,jdbcType=VARCHAR},
car_type = #{carType,jdbcType=VARCHAR}, car_type = #{carType,jdbcType=VARCHAR},
vin_no = #{vinNo,jdbcType=VARCHAR}, vin_no = #{vinNo,jdbcType=VARCHAR},
car_color = #{carColor,jdbcType=VARCHAR}, car_color = #{carColor,jdbcType=VARCHAR},
install_date = #{installDate,jdbcType=TIMESTAMP}, install_date = #{installDate,jdbcType=TIMESTAMP},
service_type = #{serviceType,jdbcType=VARCHAR}, service_type = #{serviceType,jdbcType=VARCHAR},
car_owner = #{carOwner,jdbcType=VARCHAR}, car_owner = #{carOwner,jdbcType=VARCHAR},
car_owner_phone = #{carOwnerPhone,jdbcType=INTEGER}, car_owner_phone = #{carOwnerPhone,jdbcType=INTEGER},
cancel_time = #{cancelTime,jdbcType=TIMESTAMP}, cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
active_status_array = #{activeStatusArray,jdbcType=VARCHAR}, active_status_array = #{activeStatusArray,jdbcType=VARCHAR},
merchant_id = #{merchantId,jdbcType=INTEGER}, merchant_id = #{merchantId,jdbcType=INTEGER},
mechanic_id = #{mechanicId,jdbcType=INTEGER}, mechanic_id = #{mechanicId,jdbcType=INTEGER},
repair_reason = #{repairReason,jdbcType=VARCHAR}, repair_reason = #{repairReason,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=VARCHAR} update_by = #{updateBy,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER} <where>
and order_sn = #{orderSn,jdbcType=VARCHAR} <if test="id != null">
and id = #{id,jdbcType=INTEGER}
</if>
<if test="orderSn != null">
and order_sn = #{orderSn,jdbcType=VARCHAR}
</if>
</where>
</update> </update>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!