BaseDeptLineMapper.xml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <mapper namespace="com.railway.business.baseinfo.mapper.BaseDeptLineMapper">
  5. <resultMap id="BaseResultMap" type="com.railway.business.baseinfo.domain.BaseDeptLine">
  6. <result column="id" property="id"/>
  7. <result column="line_id" property="lineId"/>
  8. <result column="dept_id" property="deptId"/>
  9. <result column="line_ktrq" property="lineKtrq"/>
  10. <result column="line_start_marker" property="lineStartMarker"/>
  11. <result column="line_end_marker" property="lineEndMarker"/>
  12. <result column="line_gdfs" property="lineGdfs"/>
  13. <result column="line_xglx" property="lineXglx"/>
  14. <result column="line_qt" property="lineQt"/>
  15. <result column="line_sjbh" property="lineSjbh"/>
  16. <result column="order_num" property="orderNum"/>
  17. <result column="del_flag" property="delFlag"/>
  18. <result column="create_by" property="createBy"/>
  19. <result column="create_time" property="createTime"/>
  20. <result column="update_by" property="updateBy"/>
  21. <result column="update_time" property="updateTime"/>
  22. </resultMap>
  23. <sql id="Base_Column_List">
  24. id,
  25. line_id,
  26. dept_id,
  27. line_ktrq,
  28. line_start_marker,
  29. line_end_marker,
  30. line_gdfs,
  31. line_xglx,
  32. line_qt,
  33. line_sjbh,
  34. order_num,
  35. del_flag,
  36. create_by,
  37. create_time,
  38. update_by,
  39. update_time
  40. </sql>
  41. <insert id="insert" parameterType="com.railway.business.baseinfo.domain.BaseDeptLine">
  42. INSERT INTO base_dept_line
  43. <trim prefix="(" suffix=")" suffixOverrides=",">
  44. <if test='null != deptId'>
  45. dept_id,
  46. </if>
  47. <if test='null != lineKtrq'>
  48. line_ktrq,
  49. </if>
  50. <if test='null != lineStartMarker'>
  51. line_start_marker,
  52. </if>
  53. <if test='null != lineEndMarker'>
  54. line_end_marker,
  55. </if>
  56. <if test='null != lineGdfs'>
  57. line_gdfs,
  58. </if>
  59. <if test='null != lineXglx'>
  60. line_xglx,
  61. </if>
  62. <if test='null != lineQt'>
  63. line_qt,
  64. </if>
  65. <if test='null != lineSjbh'>
  66. line_sjbh,
  67. </if>
  68. <if test='null != orderNum'>
  69. order_num,
  70. </if>
  71. <if test='null != delFlag'>
  72. del_flag,
  73. </if>
  74. <if test='null != createBy'>
  75. create_by,
  76. </if>
  77. <if test='null != createTime'>
  78. create_time,
  79. </if>
  80. <if test='null != updateBy'>
  81. update_by,
  82. </if>
  83. <if test='null != updateTime'>
  84. update_time
  85. </if>
  86. </trim>
  87. <trim prefix="values (" suffix=")" suffixOverrides=",">
  88. <if test='null != deptId'>
  89. #{deptId},
  90. </if>
  91. <if test='null != lineKtrq'>
  92. #{lineKtrq},
  93. </if>
  94. <if test='null != lineStartMarker'>
  95. #{lineStartMarker},
  96. </if>
  97. <if test='null != lineEndMarker'>
  98. #{lineEndMarker},
  99. </if>
  100. <if test='null != lineGdfs'>
  101. #{lineGdfs},
  102. </if>
  103. <if test='null != lineXglx'>
  104. #{lineXglx},
  105. </if>
  106. <if test='null != lineQt'>
  107. #{lineQt},
  108. </if>
  109. <if test='null != lineSjbh'>
  110. #{lineSjbh},
  111. </if>
  112. <if test='null != orderNum'>
  113. #{orderNum},
  114. </if>
  115. <if test='null != delFlag'>
  116. #{delFlag},
  117. </if>
  118. <if test='null != createBy'>
  119. #{createBy},
  120. </if>
  121. <if test='null != createTime'>
  122. #{createTime},
  123. </if>
  124. <if test='null != updateBy'>
  125. #{updateBy},
  126. </if>
  127. <if test='null != updateTime'>
  128. #{updateTime}
  129. </if>
  130. </trim>
  131. </insert>
  132. <delete id="delete">
  133. UPDATE base_dept_line
  134. set del_flag='1'
  135. WHERE line_id = #{lineId}
  136. </delete>
  137. <select id="getList" resultMap="BaseResultMap">
  138. SELECT
  139. <include refid="Base_Column_List"/>
  140. FROM base_dept_line
  141. <where>
  142. del_flag='0'
  143. <if test="lineId!=null and lineId!=''">
  144. and line_id=#{lineId}
  145. </if>
  146. </where>
  147. </select>
  148. </mapper>