OperateLogMapper.xml 6.9 KB
Newer Older
苗卫卫 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222
<?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.boco.nbd.wios.manage.mapper.def.OperateLogMapper">
  
<resultMap id="BaseResultMap" type="com.boco.nbd.wios.manage.entity.bo.OperateLog">
  <id column="id" jdbcType="INTEGER" property="id" />
  <result column="type" jdbcType="INTEGER" property="type" />
  <result column="third_party_id" jdbcType="VARCHAR" property="thirdPartyId" />
  <result column="pre_name" jdbcType="VARCHAR" property="preName" />
  <result column="pre_value" jdbcType="VARCHAR" property="preValue" />
  <result column="name" jdbcType="VARCHAR" property="name" />
  <result column="value" jdbcType="VARCHAR" property="value" />
  <result column="desc" jdbcType="VARCHAR" property="desc" />
  <result column="create_account" jdbcType="INTEGER" property="createAccount" />
  <result column="create_account_name" jdbcType="VARCHAR" property="createAccountName" />
  <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>

  
<sql id="Base_Column_List">
  id, type, third_party_id, pre_name, pre_value, name, value, `desc`, create_account,
  create_account_name, create_time
</sql>

  
<delete id="delete" parameterType="java.lang.Integer">
  delete from t_operate_log
  where id = #{id,jdbcType=INTEGER}
</delete>
  <delete id="deleteByOrderId">
    delete from t_operate_log
    where third_party_id = #{orderId}
  </delete>


  <insert id="insert" parameterType="com.boco.nbd.wios.manage.entity.bo.OperateLog">
  insert into t_operate_log (id, type, third_party_id, 
    pre_name, pre_value, name, 
    value, `desc`, create_account, 
    create_account_name, create_time)
  values (#{id,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{thirdPartyId,jdbcType=VARCHAR}, 
    #{preName,jdbcType=VARCHAR}, #{preValue,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
    #{value,jdbcType=VARCHAR}, #{desc,jdbcType=VARCHAR}, #{createAccount,jdbcType=INTEGER}, 
    #{createAccountName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
</insert>

  
<insert id="insertDynamic" parameterType="com.boco.nbd.wios.manage.entity.bo.OperateLog">
  insert into t_operate_log
  <trim prefix="(" suffix=")" suffixOverrides=",">
    <if test="id != null">
      id,
    </if>
    <if test="type != null">
      type,
    </if>
    <if test="thirdPartyId != null">
      third_party_id,
    </if>
    <if test="preName != null">
      pre_name,
    </if>
    <if test="preValue != null">
      pre_value,
    </if>
    <if test="name != null">
      name,
    </if>
    <if test="value != null">
      value,
    </if>
    <if test="desc != null">
      desc,
    </if>
    <if test="createAccount != null">
      create_account,
    </if>
    <if test="createAccountName != null">
      create_account_name,
    </if>
    <if test="createTime != null">
      create_time,
    </if>
  </trim>
  <trim prefix="values (" suffix=")" suffixOverrides=",">
    <if test="id != null">
      #{id,jdbcType=INTEGER},
    </if>
    <if test="type != null">
      #{type,jdbcType=INTEGER},
    </if>
    <if test="thirdPartyId != null">
      #{thirdPartyId,jdbcType=VARCHAR},
    </if>
    <if test="preName != null">
      #{preName,jdbcType=VARCHAR},
    </if>
    <if test="preValue != null">
      #{preValue,jdbcType=VARCHAR},
    </if>
    <if test="name != null">
      #{name,jdbcType=VARCHAR},
    </if>
    <if test="value != null">
      #{value,jdbcType=VARCHAR},
    </if>
    <if test="desc != null">
      #{desc,jdbcType=VARCHAR},
    </if>
    <if test="createAccount != null">
      #{createAccount,jdbcType=INTEGER},
    </if>
    <if test="createAccountName != null">
      #{createAccountName,jdbcType=VARCHAR},
    </if>
    <if test="createTime != null">
      #{createTime,jdbcType=TIMESTAMP},
    </if>
  </trim>
</insert>

  
<update id="updateDynamic" parameterType="com.boco.nbd.wios.manage.entity.bo.OperateLog">
  update t_operate_log
  <set>
    <if test="type != null">
      type = #{type,jdbcType=INTEGER},
    </if>
    <if test="thirdPartyId != null">
      third_party_id = #{thirdPartyId,jdbcType=VARCHAR},
    </if>
    <if test="preName != null">
      pre_name = #{preName,jdbcType=VARCHAR},
    </if>
    <if test="preValue != null">
      pre_value = #{preValue,jdbcType=VARCHAR},
    </if>
    <if test="name != null">
      name = #{name,jdbcType=VARCHAR},
    </if>
    <if test="value != null">
      value = #{value,jdbcType=VARCHAR},
    </if>
    <if test="desc != null">
      desc = #{desc,jdbcType=VARCHAR},
    </if>
    <if test="createAccount != null">
      create_account = #{createAccount,jdbcType=INTEGER},
    </if>
    <if test="createAccountName != null">
      create_account_name = #{createAccountName,jdbcType=VARCHAR},
    </if>
    <if test="createTime != null">
      create_time = #{createTime,jdbcType=TIMESTAMP},
    </if>
  </set>
  where id = #{id,jdbcType=INTEGER}
</update>

  
<update id="update" parameterType="com.boco.nbd.wios.manage.entity.bo.OperateLog">
  update t_operate_log
  set type = #{type,jdbcType=INTEGER},
    third_party_id = #{thirdPartyId,jdbcType=VARCHAR},
    pre_name = #{preName,jdbcType=VARCHAR},
    pre_value = #{preValue,jdbcType=VARCHAR},
    name = #{name,jdbcType=VARCHAR},
    value = #{value,jdbcType=VARCHAR},
    desc = #{desc,jdbcType=VARCHAR},
    create_account = #{createAccount,jdbcType=INTEGER},
    create_account_name = #{createAccountName,jdbcType=VARCHAR},
    create_time = #{createTime,jdbcType=TIMESTAMP}
  where id = #{id,jdbcType=INTEGER}
</update>

  
<select id="selectById" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  select
	<include refid="Base_Column_List" />
  from  t_operate_log
  where id = #{id,jdbcType=INTEGER}
</select>

<select id="selectByExample" parameterType="com.boco.nbd.wios.manage.entity.bo.OperateLogBo"
        resultType="com.boco.nbd.wios.manage.entity.bo.OperateLog">
   select t.* from t_operate_log t
   <where>
	    <if test="type != null">
	        and t.type = #{type}
	    </if>
	    <if test="typeList != null">
	        and t.type in
		   <foreach collection="typeList" item="item" index="index" open="(" close=")" separator=",">
				#{item}
			</foreach>
	    </if>
	    <if test="thirdPartyId != null and thirdPartyId != ''">
	        and t.third_party_id = #{thirdPartyId}
	    </if>
       <if test="name != null and name !='' ">
         and t.name = #{name}
       </if>
   </where>
   order by t.create_time desc
</select>
  <select id="getNewestCheckFailByOrderId" resultType="com.boco.nbd.wios.manage.entity.bo.OperateLog">
    select
    <include refid="Base_Column_List" />
    from  t_operate_log
    where  type=1
        <if test="orderId != null and orderId != ''">
              and third_party_id =#{orderId}
        </if>
        <if test="name != null and name != ''">
          and name=#{name}
        </if>
    ORDER BY
    create_time DESC
    LIMIT 0,1
  </select>

</mapper>