integrated_traffic/src/main/resources/mybatis/datasource/eightwork/HoistingToMeasuresMapper.xml

157 lines
3.5 KiB
XML

<?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.zcloud.mapper.datasource.eightwork.HoistingToMeasuresMapper">
<!--表名 -->
<sql id="tableName">
BUS_HOISTINGTOMEASURES
</sql>
<!--数据字典表名 -->
<sql id="dicTableName">
SYS_DICTIONARIES
</sql>
<!-- 字段 -->
<sql id="Field">
f.HOISTING_ID,
f.BUS_HOISTING_MEASURES_ID,
f.STATUS,
f.HOISTINGTOMEASURES_ID,
f.CONFIRM_ID,
f.SIGN_PATH,
f.SIGN_TIME,
f.IMG_PATH
</sql>
<!-- 字段用于新增 -->
<sql id="Field2">
HOISTING_ID,
BUS_HOISTING_MEASURES_ID,
STATUS,
HOISTINGTOMEASURES_ID,
CONFIRM_ID,
SIGN_PATH,
SIGN_TIME,
IMG_PATH
</sql>
<!-- 字段值 -->
<sql id="FieldValue">
#{HOISTING_ID},
#{BUS_HOISTING_MEASURES_ID},
#{STATUS},
#{HOISTINGTOMEASURES_ID},
#{CONFIRM_ID},
#{SIGN_PATH},
#{SIGN_TIME},
#{IMG_PATH}
</sql>
<!-- 新增-->
<insert id="save" parameterType="pd">
insert into
<include refid="tableName"></include>
(
<include refid="Field2"></include>
) values (
<include refid="FieldValue"></include>
)
</insert>
<insert id="saveBatch" parameterType="pd">
insert into
<include refid="tableName"></include>
(
HOISTING_ID,
BUS_HOISTING_MEASURES_ID,
HOISTINGTOMEASURES_ID,
CONFIRM_ID
) values
<foreach collection="list" item="item" index="index" separator="," >
(
#{item.HOISTING_ID},
#{item.BUS_HOISTING_MEASURES_ID},
#{item.HOISTINGTOMEASURES_ID},
#{item.CONFIRM_ID}
)
</foreach>
</insert>
<!-- 删除-->
<delete id="delete" parameterType="pd">
delete from
<include refid="tableName"></include>
where
HOISTING_ID = #{HOISTING_ID}
</delete>
<!-- 修改 -->
<update id="edit" parameterType="pd">
update
<include refid="tableName"></include>
set
STATUS = #{STATUS},
SIGN_PATH = #{SIGN_PATH},
IMG_PATH = #{IMG_PATH},
SIGN_TIME = #{SIGN_TIME}
where
HOISTINGTOMEASURES_ID = #{HOISTINGTOMEASURES_ID}
</update>
<!-- 通过ID获取数据 -->
<select id="findById" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.HOISTINGTOMEASURES_ID = #{HOISTINGTOMEASURES_ID}
</select>
<!-- 列表(全部) -->
<select id="listAll" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
</select>
<!-- 批量删除 -->
<delete id="deleteAll" parameterType="String">
update
<include refid="tableName"></include>
set
ISDELETE = '1'
where
HOISTINGTOMEASURES_ID in
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
<select id="listAllMeasuresForSign" parameterType="pd" resultType="pd">
select
f.HOISTINGTOMEASURES_ID,
m.*
from
<include refid="tableName"></include> f
left join bus_Hoisting_measures m on f.BUS_HOISTING_MEASURES_ID = m.BUS_HOISTING_MEASURES_ID
where
f.HOISTING_ID = #{HOISTING_ID} and f.CONFIRM_ID = #{CONFIRM_ID}
</select>
<select id="listSignFinishMeasures" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>,
m.*
from
<include refid="tableName"></include> f
left join bus_Hoisting_measures m on f.BUS_HOISTING_MEASURES_ID = m.BUS_HOISTING_MEASURES_ID
where
f.HOISTING_ID = #{HOISTING_ID}
</select>
</mapper>