You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sdny-order/order-management-consumer/src/main/resources/mybatis/mapper/OilLogMapper.xml

144 lines
6.5 KiB

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.dxhy.order.consumer.dao.OilLogMapper">
<resultMap id="BaseResultMap" type="com.dxhy.order.consumer.modules.oil.model.OilLog">
<id column="id" property="id" jdbcType="VARCHAR"/>
<result column="ywlx" property="ywlx" jdbcType="VARCHAR"/>
<result column="ywlsh" property="ywlsh" jdbcType="VARCHAR"/>
<result column="qqlsh" property="qqlsh" jdbcType="VARCHAR"/>
<result column="xhf_mc" property="xhfMc" jdbcType="VARCHAR"/>
<result column="xhf_nsrsbh" property="xhfNsrsbh" jdbcType="VARCHAR"/>
<result column="jqbh" property="jqbh" jdbcType="VARCHAR"/>
<result column="fjh" property="fjh" jdbcType="VARCHAR"/>
<result column="spmc" property="spmc" jdbcType="VARCHAR"/>
<result column="spbm" property="spbm" jdbcType="VARCHAR"/>
<result column="xzsl" property="xzsl" jdbcType="VARCHAR"/>
<result column="ztdm" property="ztdm" jdbcType="VARCHAR"/>
<result column="ztms" property="ztms" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id
, ywlx, ywlsh, qqlsh, xhf_mc, xhf_nsrsbh, jqbh, fjh, spmc, spbm, xzsl, ztdm, ztms, create_time, update_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap"
parameterType="com.dxhy.order.consumer.modules.oil.model.OilLog">
select
<include refid="Base_Column_List"/>
from oil_log
where id = #{id,jdbcType=VARCHAR}
and xhf_nsrsbh = #{xhfNsrsbh,jdbcType=VARCHAR}
</select>
<!-- <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >-->
<!-- delete from oil_log-->
<!-- where id = #{id,jdbcType=VARCHAR}-->
<!-- </delete>-->
<!-- <insert id="insert" parameterType="com.dxhy.order.consumer.modules.oil.model.OilLog" >-->
<!-- insert into oil_log (id, xhf_mc, xhf_nsrsbh,-->
<!-- fpzldm, invalid_time, create_time-->
<!-- )-->
<!-- values (#{id,jdbcType=VARCHAR}, #{xhfMc,jdbcType=VARCHAR}, #{xhfNsrsbh,jdbcType=VARCHAR},-->
<!-- #{fpzldm,jdbcType=VARCHAR}, #{invalidTime,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}-->
<!-- )-->
<!-- </insert>-->
<insert id="insertSelective" parameterType="java.util.List">
insert into oil_log
(id, ywlx, ywlsh, qqlsh, xhf_mc, xhf_nsrsbh, jqbh, fjh, spmc, spbm, xzsl, ztdm, ztms, create_time, update_time)
values
<foreach collection="list" item="item" separator=",">
(#{item.id}, #{item.ywlx}, #{item.ywlsh}, #{item.qqlsh}, #{item.xhfMc}, #{item.xhfNsrsbh}, #{item.jqbh},
#{item.fjh},
#{item.spmc}, #{item.spbm}, #{item.xzsl}, #{item.ztdm}, #{item.ztms}, #{item.createTime},
#{item.updateTime})
</foreach>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.dxhy.order.consumer.modules.oil.model.OilLog">
update oil_log
<set>
<if test="qqlsh != null">
qqlsh = #{qqlsh,jdbcType=VARCHAR},
</if>
<if test="ztdm != null">
ztdm = #{ztdm,jdbcType=VARCHAR},
</if>
<if test="ztms != null">
ztms = #{ztms,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<!-- <update id="updateByPrimaryKey" parameterType="com.dxhy.order.consumer.modules.oil.model.OilLog" >-->
<!-- update oil_log-->
<!-- set xhf_mc = #{xhfMc,jdbcType=VARCHAR},-->
<!-- xhf_nsrsbh = #{xhfNsrsbh,jdbcType=VARCHAR},-->
<!-- fpzldm = #{fpzldm,jdbcType=VARCHAR},-->
<!-- invalid_time = #{invalidTime,jdbcType=VARCHAR},-->
<!-- create_time = #{createTime,jdbcType=TIMESTAMP}-->
<!-- where id = #{id,jdbcType=VARCHAR}-->
<!-- </update>-->
<select id="queryOilLog" resultMap="BaseResultMap" parameterType="java.util.Map">
select
<include refid="Base_Column_List"/>
from oil_log
<where>
<if test="paraMap.startTime != null and paraMap.startTime != ''">
and create_time >= #{paraMap.startTime,jdbcType=VARCHAR}
</if>
<if test="paraMap.endTime != null and paraMap.endTime != ''">
and #{paraMap.endTime,jdbcType=VARCHAR} >= create_time
</if>
<if test="shList != null and shList.size() == 0">
and xhf_nsrsbh = ''
</if>
<if test="shList != null and shList.size() > 1">
and xhf_nsrsbh in
<foreach collection="shList" index="index" item="item"
open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="shList != null and shList.size() == 1">
and xhf_nsrsbh =
<foreach collection="shList" index="index" item="item">
#{item}
</foreach>
</if>
<if test="paraMap.ywlx != null and paraMap.ywlx != '' ">
and ywlx = #{paraMap.ywlx,jdbcType=VARCHAR}
</if>
<if test="paraMap.jqbh != null and paraMap.jqbh != '' ">
and jqbh = #{paraMap.jqbh,jdbcType=VARCHAR}
</if>
</where>
order by create_time desc
</select>
<select id="queryOilLogByYwlx" resultMap="BaseResultMap"
parameterType="com.dxhy.order.consumer.modules.oil.model.OilLog">
select
<include refid="Base_Column_List"/>
from oil_log
<where>
<if test="xhfNsrsbh != null and xhfNsrsbh != '' ">
and xhf_nsrsbh = #{xhfNsrsbh,jdbcType=VARCHAR}
</if>
<if test="ywlx != null and ywlx != '' ">
and ywlx = #{ywlx,jdbcType=VARCHAR}
</if>
<if test="qqlsh != null and qqlsh != '' ">
and qqlsh = #{qqlsh,jdbcType=VARCHAR}
</if>
<if test="ztdm != null and ztdm != '' ">
and ztdm = #{ztdm,jdbcType=VARCHAR}
</if>
</where>
</select>
</mapper>