Kaynağa Gözat

优化仓库数据问题和优化dev下菜单问题

xiaogang 3 yıl önce
ebeveyn
işleme
382ca40add

+ 11 - 55
java110-db/src/main/resources/mapper/community/MenuServiceDaoImplMapper.xml

@@ -1,21 +1,14 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper
-        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="menuServiceDaoImpl">
 
-
     <!-- 保存路由信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveMenuGroupInfo" parameterType="Map">
-        insert into m_menu_group(
-        g_id,name,icon,label,seq,description,group_type,store_type
-        ) values (
-        #{gId},#{name},#{icon},#{label},#{seq},#{description},#{groupType},#{storeType}
-        )
-
+        insert into m_menu_group(g_id, name, icon, label, seq, description, group_type, store_type)
+        values (#{gId}, #{name}, #{icon}, #{label}, #{seq}, #{description}, #{groupType}, #{storeType})
     </insert>
 
-
     <!-- 查询路由信息 add by wuxw 2018-07-03 -->
     <select id="getMenuGroupInfo" parameterType="Map" resultType="Map">
         select t.g_id,t.name,t.icon,t.label,t.seq,t.description,t.g_id gId,t.group_type groupType,t.store_type storeType
@@ -42,7 +35,6 @@
         <if test="seq !=null">
             and t.seq= #{seq}
         </if>
-
         <if test="description !=null and description != ''">
             and t.description= #{description}
         </if>
@@ -50,10 +42,8 @@
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
         </if>
-
     </select>
 
-
     <!-- 修改路由信息 add by wuxw 2018-07-03 -->
     <update id="updateMenuGroupInfo" parameterType="Map">
         update m_menu_group t
@@ -84,7 +74,6 @@
             </if>
         </set>
         where t.g_id= #{gId}
-
     </update>
 
     <!-- 查询路由数量 add by wuxw 2018-07-03 -->
@@ -121,29 +110,18 @@
         </if>
     </select>
 
-
     <!-- 保存路由信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveBasePrivilegeRelInfo" parameterType="Map">
-        insert into p_privilege_rel(
-        p_id,pg_id
-        ) values (
-        #{pId},#{pgId}
-        )
-
+        insert into p_privilege_rel(p_id, pg_id)
+        values (#{pId}, #{pgId})
     </insert>
 
-
     <!-- 保存路由信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveBasePrivilegeInfo" parameterType="Map">
-        insert into p_privilege(
-        p_id,name,resource,domain,description,m_id
-        ) values (
-        #{pId},#{name},#{resource},#{domain},#{description},#{mId}
-        )
-
+        insert into p_privilege(p_id, name, resource, domain, description, m_id)
+        values (#{pId}, #{name}, #{resource}, #{domain}, #{description}, #{mId})
     </insert>
 
-
     <!-- 查询路由信息 add by wuxw 2018-07-03 -->
     <select id="getBasePrivilegeInfo" parameterType="Map" resultType="Map">
         select t.p_id,t.name,t.domain,t.resource,t.description,t.p_id pId,t.create_time createTime,st.name stName
@@ -169,10 +147,8 @@
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
         </if>
-
     </select>
 
-
     <!-- 修改路由信息 add by wuxw 2018-07-03 -->
     <update id="updateBasePrivilegeInfo" parameterType="Map">
         update p_privilege t
@@ -194,7 +170,6 @@
             </if>
         </set>
         where t.p_id= #{pId}
-
     </update>
 
     <!-- 修改路由信息 add by wuxw 2018-07-03 -->
@@ -210,10 +185,8 @@
 
         </set>
         where t.p_id= #{pId}
-
     </update>
 
-
     <!-- 查询路由数量 add by wuxw 2018-07-03 -->
     <select id="queryBasePrivilegesCount" parameterType="Map" resultType="Map">
         select count(1) count
@@ -239,17 +212,12 @@
         </if>
     </select>
 
-
     <!-- 保存路由信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="saveMenuInfo" parameterType="Map">
-        insert into m_menu(
-        m_id,name,g_id,url,seq,p_id,description,is_show
-        ) values (
-        #{mId},#{name},#{gId},#{url},#{seq},'-1',#{description},#{isShow}
-        )
+        insert into m_menu(m_id, name, g_id, url, seq, p_id, description, is_show)
+        values (#{mId}, #{name}, #{gId}, #{url}, #{seq}, '-1', #{description}, #{isShow})
     </insert>
 
-
     <!-- 查询路由信息 add by wuxw 2018-07-03 -->
     <select id="getMenuInfo" parameterType="Map" resultType="Map">
         select DISTINCT t.m_id mId,t.name,t.g_id gId,t.url,t.seq,t.p_id pId,t.description,t.is_show isShow,
@@ -270,7 +238,6 @@
         <if test="mName !=null and mName != ''">
             and t.name like concat('%',#{mName},'%')
         </if>
-
         <if test="domain !=null and domain != ''">
             and p.domain= #{domain}
         </if>
@@ -323,13 +290,9 @@
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
         </if>
-
     </select>
 
-
-    <!-- 修改路由信息
-  ,t.description,t.is_show isShow
-    add by wuxw 2018-07-03 -->
+    <!-- 修改路由信息 add by wuxw 2018-07-03 -->
     <update id="updateMenuInfo" parameterType="Map">
         update m_menu t
         <set>
@@ -356,7 +319,6 @@
             </if>
         </set>
         where t.m_id= #{mId}
-
     </update>
 
     <!-- 查询路由数量 add by wuxw 2018-07-03 -->
@@ -378,7 +340,7 @@
             and t.name like concat('%',#{mName},'%')
         </if>
         <if test="pId !=null and pId != ''">
-            and t.p_id= #{pId}
+            and p.p_id= #{pId}
         </if>
         <if test="domain !=null and domain != ''">
             and p.domain= #{domain}
@@ -389,9 +351,6 @@
         <if test="mId !=null and mId != ''">
             and p.m_id= #{mId}
         </if>
-        <if test="pId !=null and pId != ''">
-            and t.p_id= #{pId}
-        </if>
         <if test="isShow !=null and isShow != ''">
             and t.is_show= #{isShow}
         </if>
@@ -480,7 +439,4 @@
         AND ppr.status_cd = '0'
         ) tt
     </select>
-
-
-
 </mapper>

+ 12 - 3
java110-db/src/main/resources/mapper/store/ResourceStoreServiceDaoImplMapper.xml

@@ -318,7 +318,7 @@
         <if test="resOrderType == '20000'">
             and t.stock > 0
         </if>
-        order by t.create_time desc
+        order by t.create_time desc,t.res_id DESC
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
         </if>
@@ -504,7 +504,16 @@
     <select id="queryResourceStoresTotalPrice" parameterType="Map" resultType="Map">
         select IFNULL(sum(w.stock*w.average_price),0) as totalPrice from(
         select t.stock,t.average_price from resource_store t
+        left join resource_store_type rst on t.rst_id = rst.rst_id and rst.status_cd = '0'
+        left join resource_store_type rst1 on t.parent_rst_id = rst1.rst_id and rst1.status_cd = '0'
+        left join resource_store_specification rss on t.rss_id = rss.rss_id and rss.status_cd = '0'
         left join storehouse sh on t.sh_id = sh.sh_id and t.store_id = sh.store_id and sh.status_cd = '0'
+        left join t_dict td on t.unit_code = td.status_cd and td.table_name = 'resource_store' and td.table_columns =
+        'unit_code'
+        left join t_dict td1 on t.mini_unit_code = td1.status_cd and td1.table_name = 'resource_store' and
+        td1.table_columns = 'unit_code'
+        left join t_dict td2 on t.is_fixed = td2.status_cd and td2.table_name='resource_store' and td2.table_columns =
+        'is_fixed'
         where 1 = 1
         <if test="resName !=null and resName != ''">
             and t.res_name like concat('%',#{resName},'%')
@@ -537,7 +546,7 @@
             and t.remark = #{remark}
         </if>
         <if test="resCode !=null and resCode != ''">
-            and t.res_code= #{resCode}
+            and t.res_code like concat('%',#{resCode},'%')
         </if>
         <if test="description !=null and description != ''">
             and t.description= #{description}
@@ -599,7 +608,7 @@
         <if test="resOrderType == '20000'">
             and t.stock > 0
         </if>
-        order by t.create_time desc
+        order by t.create_time desc,t.res_id DESC
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}
         </if>