OperationRecordMapper.xml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ematou.wxbase.mapper.OperationRecordMapper">
  6. <sql id="Base_Column_List">
  7. op_id, app_code, creater_sn, create_time, moder_sn, mod_time, tstm
  8. </sql>
  9. <insert id="insertRecord" parameterType="com.ematou.wxbase.entity.OperationRecord">
  10. insert into wxoperation_record
  11. <trim prefix="(" suffix=")" suffixOverrides="," >
  12. <if test="record.appCode != null">
  13. app_code,
  14. </if>
  15. <if test="record.createrSn != null">
  16. creater_sn,
  17. </if>
  18. <if test="record.createTime != null">
  19. create_time,
  20. </if>
  21. <if test="record.moderSn != null">
  22. moder_sn,
  23. </if>
  24. <if test="record.modTime != null">
  25. mod_time,
  26. </if>
  27. <if test="record.tstm != null">
  28. tstm,
  29. </if>
  30. </trim>
  31. <trim prefix="values (" suffix=")" suffixOverrides="," >
  32. <if test="record.appCode != null">
  33. #{record.appCode},
  34. </if>
  35. <if test="record.createrSn != null">
  36. #{record.createrSn},
  37. </if>
  38. <if test="record.createTime != null">
  39. #{record.createTime,jdbcType=VARCHAR},
  40. </if>
  41. <if test="record.moderSn != null">
  42. #{record.moderSn},
  43. </if>
  44. <if test="record.modTime != null">
  45. #{record.modTime,jdbcType=VARCHAR},
  46. </if>
  47. <if test="record.tstm != null">
  48. #{record.tstm},
  49. </if>
  50. </trim>
  51. </insert>
  52. <select id="queryAll" resultType="com.ematou.wxbase.entity.OperationRecord" parameterType="map">
  53. select
  54. <include refid="Base_Column_List"/>
  55. from wx_operation_record
  56. <if test="param.containsKey('order')">
  57. order by #{param.order}
  58. </if>
  59. <if test="param.containsKey('page') and param.containsKey('limit')">
  60. limit #{param.page},#{param.limit}
  61. </if>
  62. <if test="param.containsKey('page') == false and param.containsKey('limit')">
  63. limit #{param.limit}
  64. </if>
  65. </select>
  66. </mapper>