liuxm
2024-04-23 71f83a057f01cc56db8fbeed18d64214e386d813
pms-parent/pms-global/src/main/resources/mapper/BaLogMapper.xml
@@ -68,8 +68,7 @@
      <property name="alias" value="r"/>
    </include>
    from ba_log r
    where
    <trim prefix="and" suffixOverrides="and">
    <trim prefix="where " suffixOverrides="and">
      <if test="userId != null and userId != ''">
        user_id = #{userId,jdbcType=BIGINT} and
      </if>
@@ -83,11 +82,30 @@
        res_ip =#{resIp,jdbcType=VARCHAR} and
      </if>
    </trim>
    order by id DESC
    order by id desc
    <trim prefix="limit " >
      <if test="start != null and count != null">
        #{start}, #{count}
      </if>
    </trim>
  </select>
  <select id="selectSomeCount" resultType="java.lang.Long">
    select count(1)
    from ba_log r
    <trim prefix="where " suffixOverrides="and">
      <if test="userId != null and userId != ''">
        user_id = #{userId,jdbcType=BIGINT} and
      </if>
      <if test="content != null  and content != '' ">
        content like concat('%', #{content}, '%') and
      </if>
      <if test="createDt != null and createDt != '' ">
        create_dt = #{createDt,jdbcType=TIMESTAMP} and
      </if>
      <if test="resIp != null and resIp != '' ">
        res_ip =#{resIp,jdbcType=VARCHAR} and
      </if>
    </trim>
  </select>
</mapper>