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,13 +83,25 @@ ...@@ -83,13 +83,25 @@
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from sys_order from sys_order
where id = #{id,jdbcType=INTEGER} <where>
<if test="id != null">
and id = #{id,jdbcType=INTEGER}
</if>
<if test="orderSn != null">
and order_sn = #{orderSn,jdbcType=VARCHAR} 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>
<if test="id != null">
and id = #{id,jdbcType=INTEGER}
</if>
<if test="orderSn != null">
and order_sn = #{orderSn,jdbcType=VARCHAR} and order_sn = #{orderSn,jdbcType=VARCHAR}
</if>
</where>
</delete> </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">
...@@ -356,8 +368,14 @@ ...@@ -356,8 +368,14 @@
update_by = #{updateBy,jdbcType=VARCHAR}, update_by = #{updateBy,jdbcType=VARCHAR},
</if> </if>
</set> </set>
where id = #{id,jdbcType=INTEGER} <where>
<if test="id != null">
and id = #{id,jdbcType=INTEGER}
</if>
<if test="orderSn != null">
and order_sn = #{orderSn,jdbcType=VARCHAR} 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
...@@ -385,7 +403,13 @@ ...@@ -385,7 +403,13 @@
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>
<if test="id != null">
and id = #{id,jdbcType=INTEGER}
</if>
<if test="orderSn != null">
and order_sn = #{orderSn,jdbcType=VARCHAR} 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!