lchao 1 year ago
parent
commit
6e6f933a05

+ 10 - 1
songhua-system/src/main/resources/mapper/system/CruiseShipMappingMapper.xml

@@ -17,7 +17,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 
     <select id="selectCruiseShipMappingList" parameterType="CruiseShipMapping" resultMap="CruiseShipMappingResult">
-        <include refid="selectCruiseShipMappingVo"/>
+        SELECT
+        c.id,
+        c.ship_id,
+        b.ship_name,
+        c.longitude,
+        c.latitude,
+        c.ship_time
+        FROM
+        cruise_ship_mapping c
+        left join basic_cruise_ship b ON c.ship_id = b.id
         <where>  
             <if test="shipId != null  and shipId != ''"> and ship_id = #{shipId}</if>
             <if test="longitude != null  and longitude != ''"> and longitude = #{longitude}</if>

+ 7 - 11
songhua-ui/src/views/ship/index.vue

@@ -95,6 +95,7 @@ export default {
       single: true,
       // 非多个禁用
       multiple: true,
+      id: null,
       // 显示搜索条件
       showSearch: true,
       // 总条数
@@ -122,13 +123,16 @@ export default {
     };
   },
   created() {
+    this.shipId = this.$route.query.id;
     this.getList();
   },
   methods: {
     /** 查询列表 */
     getList() {
       this.loading = true;
-      listMapping(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+      const shipId = this.shipId;
+      this.queryParams.shipId = this.shipId
+      listMapping(this.addDateRange(this.queryParams, this.dateRange,shipId)).then(response => {
         this.mappingList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -150,16 +154,7 @@ export default {
       };
       this.resetForm("form");
     },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
+
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
@@ -184,6 +179,7 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      this.form.shipId = this.shipId
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.form.id != null) {