|
@@ -5,15 +5,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<mapper namespace="com.ruoyi.project.base.mapper.TBaseDeviceMapper">
|
|
|
|
|
|
<resultMap type="TBaseDevice" id="TBaseDeviceResult">
|
|
|
- <result property="id" column="id" />
|
|
|
+ <result property="devId" column="dev_id" />
|
|
|
<result property="plantId" column="plant_id" />
|
|
|
<result property="plantName" column="plant_name" />
|
|
|
<result property="plantCode" column="plant_code" />
|
|
|
<result property="regionId" column="region_id" />
|
|
|
<result property="regionName" column="region_name" />
|
|
|
<result property="regionCode" column="region_code" />
|
|
|
- <result property="code" column="code" />
|
|
|
- <result property="describe" column="describe" />
|
|
|
+ <result property="devCode" column="dev_code" />
|
|
|
+ <result property="devDescribe" column="dev_describe" />
|
|
|
<result property="remarks" column="remarks" />
|
|
|
<result property="approveStatus" column="approve_status" />
|
|
|
<result property="approveTime" column="approve_time" />
|
|
@@ -31,19 +31,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectTBaseDeviceVo">
|
|
|
- select id, plant_id, region_id, `code`, `describe`, remarks, approve_status, approve_time, dept_id, del_flag, creater_code, createdate, updater_code, updatedate,material,material_status,response_factor,response_factor_from from t_base_device
|
|
|
+ select dev_id, plant_id, region_id, `dev_code`, `dev_describe`, remarks, approve_status, approve_time, dept_id, del_flag, creater_code, createdate, updater_code, updatedate,material,material_status,response_factor,response_factor_from from t_base_device
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectTBaseDeviceList" parameterType="TBaseDevice" resultMap="TBaseDeviceResult">
|
|
|
- select d.id, d.plant_id,bp.plant_name,bp.plant_type,bp.plant_code, d.region_id,br.region_code,br.region_name, d.code, d.describe, d.remarks, d.approve_status, d.approve_time, d.dept_id, d.del_flag, d.creater_code, d.createdate, d.updater_code,su.user_name updater, d.updatedate,d.material,d.material_status,d.response_factor,d.response_factor_from from t_base_device d
|
|
|
+ select d.dev_id, d.plant_id,bp.plant_name,bp.plant_type,bp.plant_code, d.region_id,br.region_code,br.region_name, d.dev_code, d.dev_describe, d.remarks, d.approve_status, d.approve_time, d.dept_id, d.del_flag, d.creater_code, d.createdate, d.updater_code,su.user_name updater, d.updatedate,d.material,d.material_status,d.response_factor,d.response_factor_from from t_base_device d
|
|
|
left join sys_user su on su.user_id = d.updater_code
|
|
|
left join t_base_plant bp on bp.id = d.plant_id
|
|
|
left join t_base_region br on br.id = d.region_id
|
|
|
<where>
|
|
|
<if test="plantId != null "> and d.plant_id = #{plantId}</if>
|
|
|
<if test="regionId != null and regionId != ''"> and d.region_id = #{regionId}</if>
|
|
|
- <if test="code != null and code != ''"> and d.code = #{code}</if>
|
|
|
- <if test="describe != null and describe != ''"> and d.describe = #{describe}</if>
|
|
|
+ <if test="devCode != null and devCode != ''"> and d.dev_code = #{devCode}</if>
|
|
|
+ <if test="devDescribe != null and devDescribe != ''"> and d.dev_describe = #{devDescribe}</if>
|
|
|
<if test="approveStatus != null "> and d.approve_status = #{approveStatus}</if>
|
|
|
<if test="approveTime != null "> and d.approve_time = #{approveTime}</if>
|
|
|
<if test="deptId != null "> and d.dept_id = #{deptId}</if>
|
|
@@ -56,16 +56,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<select id="selectAllDeviceByRegionId" parameterType="long" resultMap="TBaseDeviceResult">
|
|
|
- select d.id, concat(d.code, '+',d.describe) `describe` from t_base_device d where d.region_id=#{regionId} and d.del_flag=0
|
|
|
+ select d.dev_id, concat(d.dev_code, '+',d.dev_describe) `dev_describe` from t_base_device d where d.region_id=#{regionId} and d.del_flag=0
|
|
|
</select>
|
|
|
|
|
|
<select id="selectTBaseDeviceById" parameterType="Long" resultMap="TBaseDeviceResult">
|
|
|
<include refid="selectTBaseDeviceVo"/>
|
|
|
- where id = #{id}
|
|
|
+ where dev_id = #{devId}
|
|
|
</select>
|
|
|
<select id="selectDeviceByPlantRegionAndDevice" parameterType="TBaseDevice" resultMap="TBaseDeviceResult">
|
|
|
<include refid="selectTBaseDeviceVo"/>
|
|
|
- where plant_id=#{plantId} and region_id=#{regionId} and `code`=#{code} and `describe`=#{describe} and del_flag=0
|
|
|
+ where plant_id=#{plantId} and region_id=#{regionId} and `dev_code`=#{devCode} and `dev_describe`=#{devDescribe} and del_flag=0
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertTBaseDevice" parameterType="TBaseDevice" useGeneratedKeys="true" keyProperty="id">
|
|
@@ -73,8 +73,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="plantId != null">plant_id,</if>
|
|
|
<if test="regionId != null">region_id,</if>
|
|
|
- <if test="code != null">`code`,</if>
|
|
|
- <if test="describe != null">`describe`,</if>
|
|
|
+ <if test="devCode != null">`dev_code`,</if>
|
|
|
+ <if test="devDescribe != null">`dev_describe`,</if>
|
|
|
<if test="remarks != null">remarks,</if>
|
|
|
<if test="approveStatus != null">approve_status,</if>
|
|
|
<if test="approveTime != null">approve_time,</if>
|
|
@@ -92,8 +92,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="plantId != null">#{plantId},</if>
|
|
|
<if test="regionId != null">#{regionId},</if>
|
|
|
- <if test="code != null">#{code},</if>
|
|
|
- <if test="describe != null">#{describe},</if>
|
|
|
+ <if test="devCode != null">#{devCode},</if>
|
|
|
+ <if test="devDescribe != null">#{devDescribe},</if>
|
|
|
<if test="remarks != null">#{remarks},</if>
|
|
|
<if test="approveStatus != null">#{approveStatus},</if>
|
|
|
<if test="approveTime != null">#{approveTime},</if>
|
|
@@ -115,8 +115,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
<if test="plantId != null">plant_id = #{plantId},</if>
|
|
|
<if test="regionId != null">region_id = #{regionId},</if>
|
|
|
- <if test="code != null">`code` = #{code},</if>
|
|
|
- <if test="describe != null">`describe` = #{describe},</if>
|
|
|
+ <if test="devCode != null">`dev_code` = #{devCode},</if>
|
|
|
+ <if test="devDescribe != null">`dev_describe` = #{devDescribe},</if>
|
|
|
<if test="remarks != null">remarks = #{remarks},</if>
|
|
|
<if test="approveStatus != null">approve_status = #{approveStatus},</if>
|
|
|
<if test="approveTime != null">approve_time = #{approveTime},</if>
|
|
@@ -131,17 +131,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="responseFactor != null">response_factor=#{responseFactor},</if>
|
|
|
<if test="responseFactorFrom != null">response_factor_from=#{responseFactorFrom},</if>
|
|
|
</trim>
|
|
|
- where id = #{id}
|
|
|
+ where dev_id = #{devId}
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteTBaseDeviceById" parameterType="Long">
|
|
|
- update t_base_device set del_flag=1 where id = #{id}
|
|
|
+ update t_base_device set del_flag=1 where dev_id = #{devId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteTBaseDeviceByIds" parameterType="String">
|
|
|
- update t_base_device set del_flag=1 where id in
|
|
|
- <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
- #{id}
|
|
|
+ update t_base_device set del_flag=1 where dev_id in
|
|
|
+ <foreach item="devId" collection="array" open="(" separator="," close=")">
|
|
|
+ #{devId}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
</mapper>
|