gaoaoy
2024-03-12 cc441cd527704f86af13128213a1b3746c341b90
cnas-server/src/main/resources/mapper/DeviceMapper.xml
@@ -35,7 +35,8 @@
        create_user,
        create_time,
        update_user,
        update_time
        update_time,
        status
        from device
        ) a
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
@@ -45,10 +46,11 @@
    <select id="selectEquipmentOverview" resultType="com.yuanchu.mom.pojo.Device">
        select * from(
        select id,
        deviceName,
        specificationModel,
        deviceStatus,
        device_name,
        specification_model,
        device_status,
        create_user,
        status,
        update_time
        from device
        ) a
@@ -56,4 +58,74 @@
            ${ew.customSqlSegment}
        </if>
    </select>
    <select id="authorizedPerson" resultType="com.yuanchu.mom.pojo.Device">
        select id,
               authorized_person
        from device
    </select>
    <select id="search" resultType="com.yuanchu.mom.pojo.Device">
        select *
        from device
        <where>
            <if test="deviceName!=null and deviceName!=''">
                and device_name like concat('%',#{deviceName},'%')
            </if>
            <if test="specificationModel!=null and specificationModel!= ''">
                and specification_model = #{specificationModel}
            </if>
            <if test="largeCategory!=null and largeCategory!= ''">
                and large_category = #{largeCategory}
            </if>
        </where>
    </select>
    <update id="upDeviceParameter" parameterType="com.yuanchu.mom.pojo.Device">
        UPDATE device
        <set>
            <if test="largeCategory!=null and largeCategory!='' ">large_category=#{largeCategory},</if>
            <if test="dateProduction!=null  ">date_production=#{dateProduction},</if>
            <if test="equipmentManager!=null  ">equipment_manager=#{equipmentManager},</if>
            <if test="authorizedPerson!=null  ">authorized_person=#{authorizedPerson}</if>
            <if test="deviceName!=null  ">device_name=#{deviceName}</if>
            <if test="internalCode!=null  ">internal_code=#{internalCode}</if>
            <if test="assetCode!=null  ">asset_code=#{assetCode}</if>
            <if test="calibrationDate!=null  ">calibration_date=#{calibrationDate}</if>
            <if test="scrapTime!=null  ">scrap_time=#{scrapTime}</if>
            <if test="acceptanceRecords!=null  ">acceptance_records=#{acceptanceRecords}</if>
            <if test="subclass!=null  ">subclass=#{subclass}</if>
            <if test="factoryNo!=null  ">factory_no=#{factoryNo}</if>
            <if test="acquisitionDate!=null  ">create_time=#{acquisition_date}</if>
            <if test="factoryNo!=null  ">create_time=#{factory_no}</if>
            <if test="acquisitionDate!=null  ">acquisition_date=#{acquisitionDate}</if>
            <if test="accurateMeasurement!=null  ">accurate_measurement=#{accurateMeasurement}</if>
            <if test="notes!=null  ">notes=#{notes}</if>
            <if test="specificationModel!=null  ">specification_model=#{specificationModel}</if>
            <if test="deviceStatus!=null  ">device_status=#{deviceStatus}</if>
            <if test="storagePoint!=null  ">storage_point=#{storagePoint}</if>
            <if test="latestTraceability!=null  ">latest_traceability=#{latestTraceability}</if>
            <if test="downTime!=null  ">down_time=#{downTime}</if>
            <if test="maintenanceRecords!=null  ">maintenance_records=#{maintenanceRecords}</if>
            <if test="manufacturer!=null  ">manufacturer=#{manufacturer}</if>
            <if test="detectionType!=null  ">detection_type=#{detectionType}</if>
            <if test="procurementCosts!=null  ">procurement_costs=#{procurementCosts}</if>
            <if test="calibrationCerticate!=null  ">calibration_certicate=#{calibrationCerticate}</if>
            <if test="status!=null  ">status=#{status}</if>
            <if test="imageUpload!=null  ">image_upload=#{imageUpload}</if>
            <if test="imageName!=null  ">image_name=#{imageName}</if>
        </set>
        <where>
            id=#{id}
        </where>
    </update>
    <select id="selectDeviceImage" resultType="com.yuanchu.mom.pojo.Device">
        select (image_upload, create_user, create_time) values (#{image_upload}
             , #{createUser}
             , #{createTime})
    </select>
    <select id="selectDevicePrincipal" resultType="com.yuanchu.mom.pojo.Device">
        select id,
               equipment_manager
        from device
    </select>
</mapper>