EquipmentInfo.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. <mapper namespace="com.ygj.yuemum.dao.equipment.EquipmentInfoDao" >
  4. <resultMap id="BaseResultMap" type="com.ygj.yuemum.domain.equipment.EquipmentInfo" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="et_code" property="et_code" jdbcType="INTEGER" />
  7. <result column="ei_code" property="ei_code" jdbcType="VARCHAR" />
  8. <result column="ei_rent" property="ei_rent" jdbcType="INTEGER" />
  9. <result column="ei_status" property="ei_status" jdbcType="INTEGER" />
  10. </resultMap>
  11. <sql id="Base_Column_List" >
  12. id,et_code, ei_code,ei_rent,ei_status
  13. </sql>
  14. <!--获取所有数据-->
  15. <select id="getCount" resultType="java.lang.Integer" >
  16. select
  17. count(1)
  18. from equipment_info
  19. </select>
  20. <select id="getAll" resultMap="BaseResultMap" >
  21. select
  22. id,et_code, ei_code,ei_rent,ei_status
  23. from equipment_info
  24. order by id desc
  25. </select>
  26. <select id="queryEquipmentInfo" resultMap="BaseResultMap" parameterType="com.ygj.yuemum.domain.equipment.EquipmentInfo">
  27. select
  28. id,et_code, ei_code,ei_rent,ei_status
  29. from equipment_info
  30. where 1=1
  31. <if test="et_code != null and ot_code != ''">
  32. and et_code like "%"#{et_code,jdbcType=VARCHAR}"%"
  33. </if>
  34. <if test="ei_rent != null and cm_phone != ''">
  35. and ei_rent = #{ei_rent,jdbcType=INTEGER}
  36. </if>
  37. <if test="ei_status != null and ot_startdate != ''">
  38. and ei_status = #{ei_status,jdbcType=INTEGER}
  39. </if>
  40. order by id desc
  41. </select>
  42. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  43. select
  44. <include refid="Base_Column_List" />
  45. from equipment_info
  46. where id = #{id,jdbcType=INTEGER}
  47. </select>
  48. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  49. delete from equipment_info
  50. where id = #{id,jdbcType=VARCHAR}
  51. </delete>
  52. <!-- 插入一条培训信息 -->
  53. <insert id="insertSelective" parameterType="com.ygj.yuemum.domain.equipment.EquipmentInfo" >
  54. insert into equipment_info
  55. <trim prefix="(" suffix=")" suffixOverrides="," >
  56. <if test="et_code != null" >
  57. et_code,
  58. </if>
  59. <if test="ei_code != null" >
  60. ei_code,
  61. </if>
  62. <if test="ei_rent != null" >
  63. ei_rent,
  64. </if>
  65. <if test="ei_status != null" >
  66. ei_status
  67. </if>
  68. </trim>
  69. <trim prefix="values (" suffix=")" suffixOverrides="," >
  70. <if test="et_code != null" >
  71. #{et_code,jdbcType=INTEGER},
  72. </if>
  73. <if test="ei_code != null" >
  74. #{ei_code,jdbcType=VARCHAR},
  75. </if>
  76. <if test="ei_rent != null" >
  77. #{ei_rent,jdbcType=INTEGER},
  78. </if>
  79. <if test="ei_status != null" >
  80. #{ei_status,jdbcType=INTEGER}
  81. </if>
  82. </trim>
  83. </insert>
  84. <!-- 根据id更新一条培训信息 -->
  85. <update id="updateByPrimaryKeySelective" parameterType="com.ygj.yuemum.domain.equipment.EquipmentInfo" >
  86. update equipment_info
  87. <set >
  88. <if test="et_code != null" >
  89. et_code = #{et_code,jdbcType=INTEGER},
  90. </if>
  91. <if test="ei_code != null" >
  92. ei_code = #{ei_code,jdbcType=VARCHAR},
  93. </if>
  94. <if test="ei_rent != null" >
  95. ei_rent = #{ei_rent,jdbcType=INTEGER},
  96. </if>
  97. <if test="ei_status != null" >
  98. ei_status = #{ei_status,jdbcType=INTEGER}
  99. </if>
  100. </set>
  101. where id = #{id,jdbcType=INTEGER}
  102. </update>
  103. </mapper>