123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.zkqy.amichi.mapper.StationInformationMapper">
-
- <resultMap type="com.zkqy.amichi.domain.StationInformation" id="StationInformationResult">
- <result property="id" column="id" />
- <result property="stationCode" column="station_code" />
- <result property="stationName" column="station_name" />
- <result property="personnelId" column="personnel_id" />
- <result property="personnelName" column="personnel_name" />
- <result property="deviceId" column="device_id" />
- <result property="deviceName" column="device_name" />
- <result property="remark" column="remark" />
- <result property="createById" column="create_by_id" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateById" column="update_by_id" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="delFlag" column="del_flag" />
- <result property="dataApprovalStatus" column="data_approval_status" />
- <result property="processKey" column="process_key" />
- <result property="taskProcessKey" column="task_process_key" />
- <result property="taskNodeKey" column="task_node_key" />
- <result property="teamName" column="team_name" />
- <result property="teamCode" column="team_code" />
- <result property="stationType" column="station_type"></result>
- </resultMap>
- <sql id="selectStationInformationVo">
- select id, station_code, station_name, personnel_id, personnel_name, device_id, device_name, remark, create_by_id, create_by,
- 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
- from fjqydb.station_information
- </sql>
- <select id="selectStationInformationList" parameterType="com.zkqy.amichi.domain.StationInformation" resultMap="StationInformationResult">
- select
- si.id,
- si.station_code,
- si.station_name,
- si.personnel_id,
- si.personnel_name,
- si.device_id,
- si.device_name,
- si.remark,
- si.create_by_id,
- si.create_by,
- si.create_time,
- si.update_by_id,
- si.update_by,
- si.update_time,
- si.del_flag,
- si.data_approval_status,
- si.process_key,
- si.task_process_key,
- si.task_node_key,
- ti.team_name as team_name ,
- si.team_code,
- si.station_type
- from fjqydb.station_information as si
- left join fjqydb.team_information as ti
- on (si.team_code=ti.team_code)
- <where>
- <if test="stationCode != null and stationCode != ''"> and si.station_code = #{stationCode}</if>
- <if test="stationName != null and stationName != ''"> and si.station_name like concat('%', #{stationName}, '%')</if>
- <if test="personnelId != null and personnelId != ''"> and si.personnel_id = #{personnelId}</if>
- <if test="personnelName != null and personnelName != ''"> and si.personnel_name like concat('%', #{personnelName}, '%')</if>
- <if test="deviceId != null and deviceId != ''"> and si.device_id = #{deviceId}</if>
- <if test="deviceName != null and deviceName != ''"> and si.device_name like concat('%', #{deviceName}, '%')</if>
- <if test="createById != null "> and si.create_by_id = #{createById}</if>
- <if test="updateById != null "> and si.update_by_id = #{updateById}</if>
- <if test="dataApprovalStatus != null and dataApprovalStatus != ''"> and si.data_approval_status = #{dataApprovalStatus}</if>
- <if test="processKey != null and processKey != ''"> and si.process_key = #{processKey}</if>
- <if test="taskProcessKey != null and taskProcessKey != ''"> and si.task_process_key = #{taskProcessKey}</if>
- <if test="taskNodeKey != null and taskNodeKey != ''"> and si.task_node_key = #{taskNodeKey}</if>
- <if test="teamName != null and teamName != ''"> and ti.team_name = #{teamName}</if>
- <if test="teamCode != null and teamCode != ''"> and si.team_code = #{teamCode}</if>
- <if test="stationType!=null and stationType!=''">and si.station_type=#{stationType}</if>
- </where>
- </select>
-
- <select id="selectStationInformationById" parameterType="Long" resultMap="StationInformationResult">
- <include refid="selectStationInformationVo"/>
- where id = #{id}
- </select>
-
- <insert id="insertStationInformation" parameterType="com.zkqy.amichi.domain.StationInformation" useGeneratedKeys="true" keyProperty="id">
- insert into {DBNAME}.station_information
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="stationCode != null">station_code,</if>
- <if test="stationName != null">station_name,</if>
- <if test="personnelId != null">personnel_id,</if>
- <if test="personnelName != null">personnel_name,</if>
- <if test="deviceId != null">device_id,</if>
- <if test="deviceName != null">device_name,</if>
- <if test="remark != null">remark,</if>
- <if test="createById != null">create_by_id,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateById != null">update_by_id,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="delFlag != null">del_flag,</if>
- <if test="dataApprovalStatus != null">data_approval_status,</if>
- <if test="processKey != null">process_key,</if>
- <if test="taskProcessKey != null">task_process_key,</if>
- <if test="taskNodeKey != null">task_node_key,</if>
- <if test="teamName != null and teamName != ''">team_name,</if>
- <if test="teamCode != null and teamCode != ''">team_code,</if>
- <if test="stationType!=null and stationType!=''">station_type</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="stationCode != null">#{stationCode},</if>
- <if test="stationName != null">#{stationName},</if>
- <if test="personnelId != null">#{personnelId},</if>
- <if test="personnelName != null">#{personnelName},</if>
- <if test="deviceId != null">#{deviceId},</if>
- <if test="deviceName != null">#{deviceName},</if>
- <if test="remark != null">#{remark},</if>
- <if test="createById != null">#{createById},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateById != null">#{updateById},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="delFlag != null">#{delFlag},</if>
- <if test="dataApprovalStatus != null">#{dataApprovalStatus},</if>
- <if test="processKey != null">#{processKey},</if>
- <if test="taskProcessKey != null">#{taskProcessKey},</if>
- <if test="taskNodeKey != null">#{taskNodeKey},</if>
- <if test="teamName != null and teamName != ''">#{teamName},</if>
- <if test="teamCode != null and teamCode != ''">#{teamCode},</if>
- <if test="stationType!=null and stationType!=''">#{stationType}</if>
- </trim>
- </insert>
- <update id="updateStationInformation" parameterType="com.zkqy.amichi.domain.StationInformation">
- update {DBNAME}.station_information
- <trim prefix="SET" suffixOverrides=",">
- <if test="stationCode != null">station_code = #{stationCode},</if>
- <if test="stationName != null">station_name = #{stationName},</if>
- <if test="personnelId != null">personnel_id = #{personnelId},</if>
- <if test="personnelName != null">personnel_name = #{personnelName},</if>
- <if test="deviceId != null">device_id = #{deviceId},</if>
- <if test="deviceName != null">device_name = #{deviceName},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="createById != null">create_by_id = #{createById},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateById != null">update_by_id = #{updateById},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="dataApprovalStatus != null">data_approval_status = #{dataApprovalStatus},</if>
- <if test="processKey != null">process_key = #{processKey},</if>
- <if test="taskProcessKey != null">task_process_key = #{taskProcessKey},</if>
- <if test="taskNodeKey != null">task_node_key = #{taskNodeKey},</if>
- <if test="teamName != null and teamName != ''">team_name=#{teamName},</if>
- <if test="stationType!=null and stationType!=''">station_type=#{stationType}</if>
- </trim>
- where id = #{id}
- </update>
- <!--通过工位码修改设备信息-->
- <update id="updateStationInformationByStationUpdateEquipment" parameterType="com.zkqy.amichi.domain.StationInformation">
- update fjqydb.station_information
- <trim prefix="SET" suffixOverrides=",">
- <if test="stationName != null">station_name = #{stationName},</if>
- <if test="personnelId != null">personnel_id = #{personnelId},</if>
- <if test="personnelName != null">personnel_name = #{personnelName},</if>
- <if test="deviceId != null">device_id = #{deviceId},</if>
- <if test="deviceName != null">device_name = #{deviceName},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="createById != null">create_by_id = #{createById},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateById != null">update_by_id = #{updateById},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="dataApprovalStatus != null">data_approval_status = #{dataApprovalStatus},</if>
- <if test="processKey != null">process_key = #{processKey},</if>
- <if test="taskProcessKey != null">task_process_key = #{taskProcessKey},</if>
- <if test="taskNodeKey != null">task_node_key = #{taskNodeKey},</if>
- <if test="teamName != null">team_name=#{teamName},</if>
- <if test="teamCode != null">team_code=#{teamCode},</if>
- <if test="stationType!=null and teamCode != ''">station_type=#{stationType}</if>
- </trim>
- where station_code = #{stationCode}
- </update>
- <!--通过手持设备修改设备信息-->
- <update id="updateStationInformationByStationUpdateByDeviceName" parameterType="com.zkqy.amichi.domain.StationInformation">
- update fjqydb.station_information
- <trim prefix="SET" suffixOverrides=",">
- <if test="stationName != null">station_name = #{stationName},</if>
- <if test="personnelId != null">personnel_id = #{personnelId},</if>
- <if test="personnelName != null">personnel_name = #{personnelName},</if>
- <if test="deviceId != null">device_id = #{deviceId},</if>
- <if test="deviceName != null">device_name = #{deviceName},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="createById != null">create_by_id = #{createById},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateById != null">update_by_id = #{updateById},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="delFlag != null">del_flag = #{delFlag},</if>
- <if test="dataApprovalStatus != null">data_approval_status = #{dataApprovalStatus},</if>
- <if test="processKey != null">process_key = #{processKey},</if>
- <if test="taskProcessKey != null">task_process_key = #{taskProcessKey},</if>
- <if test="taskNodeKey != null">task_node_key = #{taskNodeKey},</if>
- <if test="teamName != null and teamName != ''">team_name=#{teamName},</if>
- <if test="teamCode != null and teamCode != ''">team_code=#{teamCode},</if>
- <if test="stationType!=null and teamCode != ''">station_type=#{stationType}</if>
- </trim>
- where device_name = #{deviceName}
- </update>
- <delete id="deleteStationInformationById" parameterType="Long">
- delete from {DBNAME}.station_information where id = #{id}
- </delete>
- <delete id="deleteStationInformationByIds" parameterType="String">
- delete from {DBNAME}.station_information where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|