StationInformationMapper.xml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.zkqy.amichi.mapper.StationInformationMapper">
  6. <resultMap type="com.zkqy.amichi.domain.StationInformation" id="StationInformationResult">
  7. <result property="id" column="id" />
  8. <result property="stationCode" column="station_code" />
  9. <result property="stationName" column="station_name" />
  10. <result property="personnelId" column="personnel_id" />
  11. <result property="personnelName" column="personnel_name" />
  12. <result property="deviceId" column="device_id" />
  13. <result property="deviceName" column="device_name" />
  14. <result property="remark" column="remark" />
  15. <result property="createById" column="create_by_id" />
  16. <result property="createBy" column="create_by" />
  17. <result property="createTime" column="create_time" />
  18. <result property="updateById" column="update_by_id" />
  19. <result property="updateBy" column="update_by" />
  20. <result property="updateTime" column="update_time" />
  21. <result property="delFlag" column="del_flag" />
  22. <result property="dataApprovalStatus" column="data_approval_status" />
  23. <result property="processKey" column="process_key" />
  24. <result property="taskProcessKey" column="task_process_key" />
  25. <result property="taskNodeKey" column="task_node_key" />
  26. <result property="teamName" column="team_name" />
  27. <result property="teamCode" column="team_code" />
  28. <result property="stationType" column="station_type"></result>
  29. </resultMap>
  30. <sql id="selectStationInformationVo">
  31. select id, station_code, station_name, personnel_id, personnel_name, device_id, device_name, remark, create_by_id, create_by,
  32. create_time, update_by_id, update_by, update_time, del_flag, data_approval_status, process_key, task_process_key, task_node_key,team_name,team_code,station_type
  33. from fjqydb.station_information
  34. </sql>
  35. <select id="selectStationInformationList" parameterType="com.zkqy.amichi.domain.StationInformation" resultMap="StationInformationResult">
  36. select
  37. si.id,
  38. si.station_code,
  39. si.station_name,
  40. si.personnel_id,
  41. si.personnel_name,
  42. si.device_id,
  43. si.device_name,
  44. si.remark,
  45. si.create_by_id,
  46. si.create_by,
  47. si.create_time,
  48. si.update_by_id,
  49. si.update_by,
  50. si.update_time,
  51. si.del_flag,
  52. si.data_approval_status,
  53. si.process_key,
  54. si.task_process_key,
  55. si.task_node_key,
  56. ti.team_name as team_name ,
  57. si.team_code,
  58. si.station_type
  59. from fjqydb.station_information as si
  60. left join fjqydb.team_information as ti
  61. on (si.team_code=ti.team_code)
  62. <where>
  63. <if test="stationCode != null and stationCode != ''"> and si.station_code = #{stationCode}</if>
  64. <if test="stationName != null and stationName != ''"> and si.station_name like concat('%', #{stationName}, '%')</if>
  65. <if test="personnelId != null and personnelId != ''"> and si.personnel_id = #{personnelId}</if>
  66. <if test="personnelName != null and personnelName != ''"> and si.personnel_name like concat('%', #{personnelName}, '%')</if>
  67. <if test="deviceId != null and deviceId != ''"> and si.device_id = #{deviceId}</if>
  68. <if test="deviceName != null and deviceName != ''"> and si.device_name like concat('%', #{deviceName}, '%')</if>
  69. <if test="createById != null "> and si.create_by_id = #{createById}</if>
  70. <if test="updateById != null "> and si.update_by_id = #{updateById}</if>
  71. <if test="dataApprovalStatus != null and dataApprovalStatus != ''"> and si.data_approval_status = #{dataApprovalStatus}</if>
  72. <if test="processKey != null and processKey != ''"> and si.process_key = #{processKey}</if>
  73. <if test="taskProcessKey != null and taskProcessKey != ''"> and si.task_process_key = #{taskProcessKey}</if>
  74. <if test="taskNodeKey != null and taskNodeKey != ''"> and si.task_node_key = #{taskNodeKey}</if>
  75. <if test="teamName != null and teamName != ''"> and ti.team_name = #{teamName}</if>
  76. <if test="teamCode != null and teamCode != ''"> and si.team_code = #{teamCode}</if>
  77. <if test="stationType!=null and stationType!=''">and si.station_type=#{stationType}</if>
  78. </where>
  79. </select>
  80. <select id="selectStationInformationById" parameterType="Long" resultMap="StationInformationResult">
  81. <include refid="selectStationInformationVo"/>
  82. where id = #{id}
  83. </select>
  84. <insert id="insertStationInformation" parameterType="com.zkqy.amichi.domain.StationInformation" useGeneratedKeys="true" keyProperty="id">
  85. insert into {DBNAME}.station_information
  86. <trim prefix="(" suffix=")" suffixOverrides=",">
  87. <if test="stationCode != null">station_code,</if>
  88. <if test="stationName != null">station_name,</if>
  89. <if test="personnelId != null">personnel_id,</if>
  90. <if test="personnelName != null">personnel_name,</if>
  91. <if test="deviceId != null">device_id,</if>
  92. <if test="deviceName != null">device_name,</if>
  93. <if test="remark != null">remark,</if>
  94. <if test="createById != null">create_by_id,</if>
  95. <if test="createBy != null">create_by,</if>
  96. <if test="createTime != null">create_time,</if>
  97. <if test="updateById != null">update_by_id,</if>
  98. <if test="updateBy != null">update_by,</if>
  99. <if test="updateTime != null">update_time,</if>
  100. <if test="delFlag != null">del_flag,</if>
  101. <if test="dataApprovalStatus != null">data_approval_status,</if>
  102. <if test="processKey != null">process_key,</if>
  103. <if test="taskProcessKey != null">task_process_key,</if>
  104. <if test="taskNodeKey != null">task_node_key,</if>
  105. <if test="teamName != null and teamName != ''">team_name,</if>
  106. <if test="teamCode != null and teamCode != ''">team_code,</if>
  107. <if test="stationType!=null and stationType!=''">station_type</if>
  108. </trim>
  109. <trim prefix="values (" suffix=")" suffixOverrides=",">
  110. <if test="stationCode != null">#{stationCode},</if>
  111. <if test="stationName != null">#{stationName},</if>
  112. <if test="personnelId != null">#{personnelId},</if>
  113. <if test="personnelName != null">#{personnelName},</if>
  114. <if test="deviceId != null">#{deviceId},</if>
  115. <if test="deviceName != null">#{deviceName},</if>
  116. <if test="remark != null">#{remark},</if>
  117. <if test="createById != null">#{createById},</if>
  118. <if test="createBy != null">#{createBy},</if>
  119. <if test="createTime != null">#{createTime},</if>
  120. <if test="updateById != null">#{updateById},</if>
  121. <if test="updateBy != null">#{updateBy},</if>
  122. <if test="updateTime != null">#{updateTime},</if>
  123. <if test="delFlag != null">#{delFlag},</if>
  124. <if test="dataApprovalStatus != null">#{dataApprovalStatus},</if>
  125. <if test="processKey != null">#{processKey},</if>
  126. <if test="taskProcessKey != null">#{taskProcessKey},</if>
  127. <if test="taskNodeKey != null">#{taskNodeKey},</if>
  128. <if test="teamName != null and teamName != ''">#{teamName},</if>
  129. <if test="teamCode != null and teamCode != ''">#{teamCode},</if>
  130. <if test="stationType!=null and stationType!=''">#{stationType}</if>
  131. </trim>
  132. </insert>
  133. <update id="updateStationInformation" parameterType="com.zkqy.amichi.domain.StationInformation">
  134. update {DBNAME}.station_information
  135. <trim prefix="SET" suffixOverrides=",">
  136. <if test="stationCode != null">station_code = #{stationCode},</if>
  137. <if test="stationName != null">station_name = #{stationName},</if>
  138. <if test="personnelId != null">personnel_id = #{personnelId},</if>
  139. <if test="personnelName != null">personnel_name = #{personnelName},</if>
  140. <if test="deviceId != null">device_id = #{deviceId},</if>
  141. <if test="deviceName != null">device_name = #{deviceName},</if>
  142. <if test="remark != null">remark = #{remark},</if>
  143. <if test="createById != null">create_by_id = #{createById},</if>
  144. <if test="createBy != null">create_by = #{createBy},</if>
  145. <if test="createTime != null">create_time = #{createTime},</if>
  146. <if test="updateById != null">update_by_id = #{updateById},</if>
  147. <if test="updateBy != null">update_by = #{updateBy},</if>
  148. <if test="updateTime != null">update_time = #{updateTime},</if>
  149. <if test="delFlag != null">del_flag = #{delFlag},</if>
  150. <if test="dataApprovalStatus != null">data_approval_status = #{dataApprovalStatus},</if>
  151. <if test="processKey != null">process_key = #{processKey},</if>
  152. <if test="taskProcessKey != null">task_process_key = #{taskProcessKey},</if>
  153. <if test="taskNodeKey != null">task_node_key = #{taskNodeKey},</if>
  154. <if test="teamName != null and teamName != ''">team_name=#{teamName},</if>
  155. <if test="stationType!=null and stationType!=''">station_type=#{stationType}</if>
  156. </trim>
  157. where id = #{id}
  158. </update>
  159. <!--通过工位码修改设备信息-->
  160. <update id="updateStationInformationByStationUpdateEquipment" parameterType="com.zkqy.amichi.domain.StationInformation">
  161. update fjqydb.station_information
  162. <trim prefix="SET" suffixOverrides=",">
  163. <if test="stationName != null">station_name = #{stationName},</if>
  164. <if test="personnelId != null">personnel_id = #{personnelId},</if>
  165. <if test="personnelName != null">personnel_name = #{personnelName},</if>
  166. <if test="deviceId != null">device_id = #{deviceId},</if>
  167. <if test="deviceName != null">device_name = #{deviceName},</if>
  168. <if test="remark != null">remark = #{remark},</if>
  169. <if test="createById != null">create_by_id = #{createById},</if>
  170. <if test="createBy != null">create_by = #{createBy},</if>
  171. <if test="createTime != null">create_time = #{createTime},</if>
  172. <if test="updateById != null">update_by_id = #{updateById},</if>
  173. <if test="updateBy != null">update_by = #{updateBy},</if>
  174. <if test="updateTime != null">update_time = #{updateTime},</if>
  175. <if test="delFlag != null">del_flag = #{delFlag},</if>
  176. <if test="dataApprovalStatus != null">data_approval_status = #{dataApprovalStatus},</if>
  177. <if test="processKey != null">process_key = #{processKey},</if>
  178. <if test="taskProcessKey != null">task_process_key = #{taskProcessKey},</if>
  179. <if test="taskNodeKey != null">task_node_key = #{taskNodeKey},</if>
  180. <if test="teamName != null">team_name=#{teamName},</if>
  181. <if test="teamCode != null">team_code=#{teamCode},</if>
  182. <if test="stationType!=null and teamCode != ''">station_type=#{stationType}</if>
  183. </trim>
  184. where station_code = #{stationCode}
  185. </update>
  186. <!--通过手持设备修改设备信息-->
  187. <update id="updateStationInformationByStationUpdateByDeviceName" parameterType="com.zkqy.amichi.domain.StationInformation">
  188. update fjqydb.station_information
  189. <trim prefix="SET" suffixOverrides=",">
  190. <if test="stationName != null">station_name = #{stationName},</if>
  191. <if test="personnelId != null">personnel_id = #{personnelId},</if>
  192. <if test="personnelName != null">personnel_name = #{personnelName},</if>
  193. <if test="deviceId != null">device_id = #{deviceId},</if>
  194. <if test="deviceName != null">device_name = #{deviceName},</if>
  195. <if test="remark != null">remark = #{remark},</if>
  196. <if test="createById != null">create_by_id = #{createById},</if>
  197. <if test="createBy != null">create_by = #{createBy},</if>
  198. <if test="createTime != null">create_time = #{createTime},</if>
  199. <if test="updateById != null">update_by_id = #{updateById},</if>
  200. <if test="updateBy != null">update_by = #{updateBy},</if>
  201. <if test="updateTime != null">update_time = #{updateTime},</if>
  202. <if test="delFlag != null">del_flag = #{delFlag},</if>
  203. <if test="dataApprovalStatus != null">data_approval_status = #{dataApprovalStatus},</if>
  204. <if test="processKey != null">process_key = #{processKey},</if>
  205. <if test="taskProcessKey != null">task_process_key = #{taskProcessKey},</if>
  206. <if test="taskNodeKey != null">task_node_key = #{taskNodeKey},</if>
  207. <if test="teamName != null and teamName != ''">team_name=#{teamName},</if>
  208. <if test="teamCode != null and teamCode != ''">team_code=#{teamCode},</if>
  209. <if test="stationType!=null and teamCode != ''">station_type=#{stationType}</if>
  210. </trim>
  211. where device_name = #{deviceName}
  212. </update>
  213. <delete id="deleteStationInformationById" parameterType="Long">
  214. delete from {DBNAME}.station_information where id = #{id}
  215. </delete>
  216. <delete id="deleteStationInformationByIds" parameterType="String">
  217. delete from {DBNAME}.station_information where id in
  218. <foreach item="id" collection="array" open="(" separator="," close=")">
  219. #{id}
  220. </foreach>
  221. </delete>
  222. </mapper>