SysConfigMapper.xml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
  4. <mapper namespace="com.ym.mec.biz.dal.dao.SysConfigDao">
  5. <resultMap type="com.ym.mec.biz.dal.entity.SysConfig" id="SysConfig">
  6. <result column="id" property="id" />
  7. <result column="param_name_" property="paramName" />
  8. <result column="paran_value_" property="paranValue" />
  9. <result column="description_" property="description" />
  10. <result column="create_on_" property="createOn" />
  11. <result column="modify_on_" property="modifyOn" />
  12. </resultMap>
  13. <!-- 根据主键查询一条记录 -->
  14. <select id="get" resultMap="SysConfig">
  15. SELECT * FROM sys_config WHERE id = #{id}
  16. </select>
  17. <!-- 全查询 -->
  18. <select id="findAll" resultMap="SysConfig">
  19. SELECT * FROM sys_config ORDER BY
  20. id
  21. </select>
  22. <!-- 向数据库增加一条记录 -->
  23. <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysConfig"
  24. useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  25. <!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
  26. AS ID FROM DUAL </selectKey> -->
  27. INSERT INTO sys_config
  28. (id,param_name_,paran_value_,description_,create_on_,modify_on_)
  29. VALUES(#{id},#{paramName},#{paranValue},#{description},#{createOn},#{modifyOn})
  30. </insert>
  31. <!-- 根据主键查询一条记录 -->
  32. <update id="update" parameterType="com.ym.mec.biz.dal.entity.SysConfig">
  33. UPDATE sys_config
  34. <set>
  35. <if test="modifyOn != null">
  36. modify_on_ = #{modifyOn},
  37. </if>
  38. <if test="paranValue != null">
  39. paran_value_ = #{paranValue},
  40. </if>
  41. <if test="description != null">
  42. description_ = #{description},
  43. </if>
  44. <if test="id != null">
  45. id = #{id},
  46. </if>
  47. <if test="createOn != null">
  48. create_on_ = #{createOn},
  49. </if>
  50. <if test="paramName != null">
  51. param_name_ = #{paramName},
  52. </if>
  53. </set>
  54. WHERE id = #{id}
  55. </update>
  56. <!-- 根据主键删除一条记录 -->
  57. <delete id="delete">
  58. DELETE FROM sys_config WHERE id = #{id}
  59. </delete>
  60. <!-- 分页查询 -->
  61. <select id="queryPage" resultMap="SysConfig" parameterType="map">
  62. SELECT * FROM sys_config ORDER BY id
  63. <include refid="global.limit" />
  64. </select>
  65. <!-- 查询当前表的总记录数 -->
  66. <select id="queryCount" resultType="int">
  67. SELECT COUNT(*) FROM
  68. sys_config
  69. </select>
  70. </mapper>