DicIoUnitMapper.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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.sysservice.dao.mysqlmapper.DicIoUnitMapper" >
  4. <resultMap id="BaseResultMap" type="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDicIoUnit" >
  5. <id column="DIU_ID" property="diuId" jdbcType="INTEGER" />
  6. <result column="DIO_ID" property="dioId" jdbcType="INTEGER" />
  7. <result column="DIU_UnitCode" property="diuUnitcode" jdbcType="VARCHAR" />
  8. <result column="DIU_Operation_Time" property="diuOperationTime" jdbcType="TIMESTAMP" />
  9. <result column="DIU_Operator" property="diuOperator" jdbcType="VARCHAR" />
  10. <result column="DIU_IsDel" property="diuIsdel" jdbcType="INTEGER" />
  11. <result column="DIU_Sort" property="diuSort" jdbcType="INTEGER"/>
  12. </resultMap>
  13. <sql id="Base_Column_List" >
  14. DIU_ID, DIO_ID, DIU_UnitCode, DIU_Operation_Time, DIU_Operator, DIU_IsDel,DIU_Sort
  15. </sql>
  16. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  17. select
  18. <include refid="Base_Column_List" />
  19. from dic_io_unit
  20. where DIU_ID = #{diuId,jdbcType=INTEGER}
  21. </select>
  22. <select id="selectByDioId" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  23. select
  24. <include refid="Base_Column_List" />
  25. from dic_io_unit
  26. where DIO_ID = #{dioId,jdbcType=INTEGER} and DIU_IsDel = 0 order by DIU_Sort asc
  27. </select>
  28. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  29. delete from dic_io_unit
  30. where DIU_ID = #{diuId,jdbcType=INTEGER}
  31. </delete>
  32. <insert id="insert" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDicIoUnit" >
  33. insert into dic_io_unit (DIU_ID, DIO_ID, DIU_UnitCode,
  34. DIU_Operation_Time, DIU_Operator, DIU_IsDel,DIU_Sort
  35. )
  36. values (#{diuId,jdbcType=INTEGER}, #{dioId,jdbcType=INTEGER}, #{diuUnitcode,jdbcType=VARCHAR},
  37. #{diuOperationTime,jdbcType=TIMESTAMP}, #{diuOperator,jdbcType=VARCHAR}, #{diuIsdel,jdbcType=INTEGER},#{diuSort,jdbcType=INTEGER}
  38. )
  39. </insert>
  40. <insert id="addSysDicIoUnit" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDicIoUnit">
  41. insert into dic_io_unit (DIO_ID, DIU_UnitCode,
  42. DIU_Operation_Time, DIU_Operator, DIU_IsDel,DIU_Sort
  43. )
  44. values (#{dioId,jdbcType=INTEGER}, #{diuUnitcode,jdbcType=VARCHAR},
  45. now(), #{diuOperator,jdbcType=VARCHAR}, #{diuIsdel,jdbcType=INTEGER},#{diuSort,jdbcType=INTEGER}
  46. )
  47. </insert>
  48. <insert id="insertSelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDicIoUnit" >
  49. insert into dic_io_unit
  50. <trim prefix="(" suffix=")" suffixOverrides="," >
  51. <if test="diuId != null" >
  52. DIU_ID,
  53. </if>
  54. <if test="dioId != null" >
  55. DIO_ID,
  56. </if>
  57. <if test="diuUnitcode != null" >
  58. DIU_UnitCode,
  59. </if>
  60. <if test="diuOperationTime != null" >
  61. DIU_Operation_Time,
  62. </if>
  63. <if test="diuOperator != null" >
  64. DIU_Operator,
  65. </if>
  66. <if test="diuIsdel != null" >
  67. DIU_IsDel,
  68. </if>
  69. <if test="diuSort != null" >
  70. DIU_Sort,
  71. </if>
  72. </trim>
  73. <trim prefix="values (" suffix=")" suffixOverrides="," >
  74. <if test="diuId != null" >
  75. #{diuId,jdbcType=INTEGER},
  76. </if>
  77. <if test="dioId != null" >
  78. #{dioId,jdbcType=INTEGER},
  79. </if>
  80. <if test="diuUnitcode != null" >
  81. #{diuUnitcode,jdbcType=VARCHAR},
  82. </if>
  83. <if test="diuOperationTime != null" >
  84. #{diuOperationTime,jdbcType=TIMESTAMP},
  85. </if>
  86. <if test="diuOperator != null" >
  87. #{diuOperator,jdbcType=VARCHAR},
  88. </if>
  89. <if test="diuIsdel != null" >
  90. #{diuIsdel,jdbcType=INTEGER},
  91. </if>
  92. <if test="diuSort != null" >
  93. #{diuSort,jdbcType=INTEGER},
  94. </if>
  95. </trim>
  96. </insert>
  97. <update id="updateByPrimaryKeySelective" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDicIoUnit" >
  98. update dic_io_unit
  99. <set >
  100. <if test="dioId != null" >
  101. DIO_ID = #{dioId,jdbcType=INTEGER},
  102. </if>
  103. <if test="diuUnitcode != null" >
  104. DIU_UnitCode = #{diuUnitcode,jdbcType=VARCHAR},
  105. </if>
  106. <if test="diuOperationTime != null" >
  107. DIU_Operation_Time = #{diuOperationTime,jdbcType=TIMESTAMP},
  108. </if>
  109. <if test="diuOperator != null" >
  110. DIU_Operator = #{diuOperator,jdbcType=VARCHAR},
  111. </if>
  112. <if test="diuIsdel != null" >
  113. DIU_IsDel = #{diuIsdel,jdbcType=INTEGER},
  114. </if>
  115. <if test="diuSort != null" >
  116. DIU_Sort = #{diuSort,jdbcType=INTEGER},
  117. </if>
  118. </set>
  119. where DIU_ID = #{diuId,jdbcType=INTEGER}
  120. </update>
  121. <update id="updateByPrimaryKey" parameterType="com.xinxin.topro.sysservice.dao.mysqlmodel.SysDicIoUnit" >
  122. update dic_io_unit
  123. set DIO_ID = #{dioId,jdbcType=INTEGER},
  124. DIU_UnitCode = #{diuUnitcode,jdbcType=VARCHAR},
  125. DIU_Operation_Time = #{diuOperationTime,jdbcType=TIMESTAMP},
  126. DIU_Operator = #{diuOperator,jdbcType=VARCHAR},
  127. DIU_IsDel = #{diuIsdel,jdbcType=INTEGER},
  128. DIU_Sort =#{diuSort,jdbcType=INTEGER}
  129. where DIU_ID = #{diuId,jdbcType=INTEGER}
  130. </update>
  131. <update id="delUnitById" parameterType="java.lang.Integer">
  132. update dic_io_unit
  133. set DIU_IsDel = -1
  134. where DIU_ID = #{diuId,jdbcType=INTEGER}
  135. </update>
  136. <update id="delUnitByDioId" parameterType="java.lang.Integer">
  137. update dic_io_unit
  138. set DIU_IsDel = -1
  139. where DIO_ID = #{diuId,jdbcType=INTEGER}
  140. </update>
  141. </mapper>