ganzi-api/inventory-dao/src/main/resources/mapper/EntDeviceMapper.xml

49 lines
2.5 KiB
XML
Raw Normal View History

<?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.rzyc.mapper.EntDeviceMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.rzyc.model.EntDevice">
<id column="device_id" property="deviceId" />
<result column="name" property="name" />
<result column="number" property="number" />
<result column="model_num" property="modelNum" />
<result column="model_state" property="modelState" />
<result column="buy_time" property="buyTime" />
<result column="type_id" property="typeId" />
<result column="type_path" property="typePath" />
<result column="enterprise_id" property="enterpriseId" />
<result column="qr_code" property="qrCode" />
<result column="del_state" property="delState" />
<result column="create_time" property="createTime" />
<result column="create_by" property="createBy" />
<result column="modify_time" property="modifyTime" />
<result column="modify_by" property="modifyBy" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
device_id, name, number, model_num, model_state, buy_time, type_id, type_path, enterprise_id, qr_code, del_state, create_time, create_by, modify_time, modify_by
</sql>
<select id="selectEntEquipmentList" resultMap="BaseResultMap">
select * from ent_device where enterprise_id = #{enterpriseId}
<if test="null != typeId and '' != typeId">
and type_id = #{typeId}
</if>
</select>
<select id="entEquipmentStatistic" resultMap="BaseResultMap">
生命周期中的统计
</select>
<update id="updateEntDevice" parameterType="com.rzyc.model.EntDevice">
update ent_device set type_path = #{entDevice.typePath},enterprise_id = #{entDevice.enterpriseId},qr_code = #{entDevice.qrCode},installation_time = #{entDevice.installationTime},
enable_time = #{entDevice.enableTime},scrap_time = #{entDevice.scrapTime},factory_number = #{entDevice.factoryNumber},longitude = #{entDevice.longitude},latitude = #{entDevice.latitude},
eq_charge_person = #{entDevice.eqChargePerson},manufacturer = #{entDevice.manufacturer},specific_location = #{entDevice.specificLocation},modify_by = #{entDevice.modifyBy},modify_time = #{entDevice.modifyTime}
where device_id = #{entDevice.deviceId}
</update>
</mapper>