DicHolidayMapper.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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.xinxin.topro.inpnurseservice.mysqlmapper.DicHolidayMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.inpnurseservice.mysqlmodel.DicHoliday" >
  5. <id column="dh_id" property="dhId" jdbcType="INTEGER" />
  6. <result column="hi_id" property="hiId" jdbcType="INTEGER" />
  7. <result column="dh_name" property="dhName" jdbcType="VARCHAR" />
  8. <result column="dh_begin_time" property="dhBeginTime" jdbcType="TIMESTAMP" />
  9. <result column="dh_end_time" property="dhEndTime" jdbcType="TIMESTAMP" />
  10. <result column="dh_is_del" property="dhIsDel" jdbcType="INTEGER" />
  11. <result column="dh_type" property="dhType" jdbcType="INTEGER" />
  12. </resultMap>
  13. <sql id="Base_Column_List" >
  14. dh_id, hi_id, dh_name, dh_begin_time, dh_end_time, dh_is_del, dh_type
  15. </sql>
  16. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  17. select
  18. <include refid="Base_Column_List" />
  19. from dic_holiday
  20. where dh_id = #{dhId,jdbcType=INTEGER}
  21. </select>
  22. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  23. delete from dic_holiday
  24. where dh_id = #{dhId,jdbcType=INTEGER}
  25. </delete>
  26. <insert id="insert" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicHoliday" >
  27. insert into dic_holiday (dh_id, hi_id, dh_name,
  28. dh_begin_time, dh_end_time, dh_is_del, dh_type
  29. )
  30. values (#{dhId,jdbcType=INTEGER}, #{hiId,jdbcType=INTEGER}, #{dhName,jdbcType=VARCHAR},
  31. #{dhBeginTime,jdbcType=TIMESTAMP}, #{dhEndTime,jdbcType=TIMESTAMP}, #{dhIsDel,jdbcType=INTEGER},
  32. #{dhType,jdbcType=INTEGER}
  33. )
  34. </insert>
  35. <insert id="insertSelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicHoliday" >
  36. insert into dic_holiday
  37. <trim prefix="(" suffix=")" suffixOverrides="," >
  38. <if test="dhId != null" >
  39. dh_id,
  40. </if>
  41. <if test="hiId != null" >
  42. hi_id,
  43. </if>
  44. <if test="dhName != null" >
  45. dh_name,
  46. </if>
  47. <if test="dhBeginTime != null" >
  48. dh_begin_time,
  49. </if>
  50. <if test="dhEndTime != null" >
  51. dh_end_time,
  52. </if>
  53. <if test="dhIsDel != null" >
  54. dh_is_del,
  55. </if>
  56. <if test="dhType != null" >
  57. dh_type,
  58. </if>
  59. </trim>
  60. <trim prefix="values (" suffix=")" suffixOverrides="," >
  61. <if test="dhId != null" >
  62. #{dhId,jdbcType=INTEGER},
  63. </if>
  64. <if test="hiId != null" >
  65. #{hiId,jdbcType=INTEGER},
  66. </if>
  67. <if test="dhName != null" >
  68. #{dhName,jdbcType=VARCHAR},
  69. </if>
  70. <if test="dhBeginTime != null" >
  71. #{dhBeginTime,jdbcType=TIMESTAMP},
  72. </if>
  73. <if test="dhEndTime != null" >
  74. #{dhEndTime,jdbcType=TIMESTAMP},
  75. </if>
  76. <if test="dhIsDel != null" >
  77. #{dhIsDel,jdbcType=INTEGER},
  78. </if>
  79. <if test="dhType != null" >
  80. #{dhType,jdbcType=INTEGER},
  81. </if>
  82. </trim>
  83. </insert>
  84. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicHoliday" >
  85. update dic_holiday
  86. <set >
  87. <if test="hiId != null" >
  88. hi_id = #{hiId,jdbcType=INTEGER},
  89. </if>
  90. <if test="dhName != null" >
  91. dh_name = #{dhName,jdbcType=VARCHAR},
  92. </if>
  93. <if test="dhBeginTime != null" >
  94. dh_begin_time = #{dhBeginTime,jdbcType=TIMESTAMP},
  95. </if>
  96. <if test="dhEndTime != null" >
  97. dh_end_time = #{dhEndTime,jdbcType=TIMESTAMP},
  98. </if>
  99. <if test="dhIsDel != null" >
  100. dh_is_del = #{dhIsDel,jdbcType=INTEGER},
  101. </if>
  102. <if test="dhType != null" >
  103. dh_type = #{dhType,jdbcType=INTEGER},
  104. </if>
  105. </set>
  106. where dh_id = #{dhId,jdbcType=INTEGER}
  107. </update>
  108. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicHoliday" >
  109. update dic_holiday
  110. set hi_id = #{hiId,jdbcType=INTEGER},
  111. dh_name = #{dhName,jdbcType=VARCHAR},
  112. dh_begin_time = #{dhBeginTime,jdbcType=TIMESTAMP},
  113. dh_end_time = #{dhEndTime,jdbcType=TIMESTAMP},
  114. dh_is_del = #{dhIsDel,jdbcType=INTEGER},
  115. dh_type = #{dhType,jdbcType=INTEGER}
  116. where dh_id = #{dhId,jdbcType=INTEGER}
  117. </update>
  118. <update id="deleteAllData" parameterType="com.xinxin.topro.inpnurseservice.mysqlmodel.DicHoliday" >
  119. UPDATE dic_holiday
  120. SET dh_is_del = -1
  121. WHERE dh_is_del = 0
  122. AND dh_type = #{dhType,jdbcType=INTEGER}
  123. </update>
  124. <insert id="batchInsert" parameterType="java.util.List">
  125. INSERT INTO dic_holiday (dh_id, hi_id, dh_name,
  126. dh_begin_time, dh_end_time, dh_is_del, dh_type
  127. )
  128. VALUES
  129. <foreach collection="list" item="item" separator=",">
  130. (#{item.dhId,jdbcType=INTEGER}, #{item.hiId,jdbcType=INTEGER}, #{item.dhName,jdbcType=VARCHAR},
  131. #{item.dhBeginTime,jdbcType=TIMESTAMP}, #{item.dhEndTime,jdbcType=TIMESTAMP}, #{item.dhIsDel,jdbcType=INTEGER},
  132. #{item.dhType,jdbcType=INTEGER}
  133. )
  134. </foreach>
  135. </insert>
  136. <select id="selectDicHolidayList" resultMap="BaseResultMap">
  137. SELECT
  138. <include refid="Base_Column_List" />
  139. FROM dic_holiday
  140. WHERE
  141. dh_is_del = 0
  142. <if test="hiId != null" >
  143. AND hi_id = #{hiId,jdbcType=INTEGER}
  144. </if>
  145. <if test="dhType != null" >
  146. AND dh_type = #{dhType,jdbcType=INTEGER}
  147. </if>
  148. </select>
  149. </mapper>