lxw
2022-09-21 64f77df94783eb3e9cd426152fdb2775b279b180
数据库xml中去除
12个文件已修改
136 ■■■■ 已修改文件
src/main/resources/mapper/CategoryMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/DocLogMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/GroupMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/MaterialMapper.xml 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/MaterialProductApprovingMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/MaterialProductHistoryMapper.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/PermitMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ProductBomHistoryMapper.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ProductBomMapper.xml 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ProductMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WorksheetLinkMapper.xml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WorksheetMainMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/CategoryMapper.xml
@@ -10,9 +10,9 @@
    </resultMap>
    <select id="getAllPermit" resultMap="permitList">
        select distinct * from db_doc.tb_category order by category_id
        select distinct * from tb_category order by category_id
    </select>
    <select id="selectPermit" resultType="permit">
        select distinct * from db_doc.tb_permit where category_id=#{categoryId}
        select distinct * from tb_permit where category_id=#{categoryId}
    </select>
</mapper>
src/main/resources/mapper/DocLogMapper.xml
@@ -13,7 +13,7 @@
        <result property="name" column="name"/>
    </resultMap>
    <select id="getList" resultMap="Map_docLog">
        select l.*,u.name from db_doc.tb_doc_log l,db_doc.tb_doc_user u
        select l.*,u.name from tb_doc_log l,tb_doc_user u
        where l.uId = u.uId
        and uOprateDay between #{oprateDay} and  #{oprateDay2}
        <if test="id !=null">
src/main/resources/mapper/GroupMapper.xml
@@ -12,10 +12,10 @@
    </resultMap>
    <select id="getAllGroup" resultMap="groupList">
        select distinct * from db_doc.tb_group order by group_id
        select distinct * from tb_group order by group_id
    </select>
    <select id="selectPermit" resultType="permit">
        select distinct tb_permit.* from db_doc.tb_permit_group,db_doc.tb_permit
        select distinct tb_permit.* from tb_permit_group,tb_permit
        where tb_permit_group.permit_id=tb_permit.permit_id
        and group_id=#{groupId}
    </select>
@@ -24,13 +24,13 @@
        <result property="name" column="name"></result>
    </resultMap>
    <select id="selectUser" resultMap="userInfo">
        select distinct tb_doc_user.id,tb_doc_user.name from db_doc.tb_user_group,db_doc.tb_doc_user
        select distinct tb_doc_user.id,tb_doc_user.name from tb_user_group,tb_doc_user
        where  tb_user_group.uname=tb_doc_user.name
          and group_id=#{groupId}
    </select>
    <select id="selectGroupIdMax" resultType="java.lang.Integer">
        select max(group_id) as groupIdMax from db_doc.tb_group
        select max(group_id) as groupIdMax from tb_group
    </select>
</mapper>
src/main/resources/mapper/MaterialMapper.xml
@@ -4,8 +4,8 @@
    <!--<select id="getMaterialWithoutSub" resultType="com.whyc.pojo.Material">
        select * from  db_doc.tb_Material  b
        where (select count(1) as num from  db_doc.tb_material_product_history  c
        select * from  tb_Material  b
        where (select count(1) as num from  tb_material_product_history  c
               where b.id= c.material_id   and c.sub_name=#{subName} and parent_model=#{parentModel}
               and c.e_version=#{version}
             ) = 0
@@ -37,7 +37,7 @@
    </resultMap>
-->
    <!--<select id="getAllMaterial" resultMap="productBomList">
        select distinct * from  db_doc.tb_Material
        select distinct * from  tb_Material
        <where>
        1=1
            <if test="category!=null&amp;&amp;category!=''">
@@ -56,7 +56,7 @@
        order by id asc
    </select>-->
    <!--<select id="selectMaterialProductHistory"  resultType="com.whyc.pojo.MaterialProductHistory">
        select DISTINCT tb_material_product_history.*  FROM db_doc.tb_product_bom,db_doc.tb_material_product_history
        select DISTINCT tb_material_product_history.*  FROM tb_product_bom,tb_material_product_history
        where  tb_product_bom.version=tb_material_product_history.e_version
        and tb_product_bom.parent_model=tb_material_product_history.parent_model and tb_material_product_history.material_id=#{id}
    </select>-->
@@ -92,7 +92,7 @@
        select distinct tb_Material.*,tb_material_product_history.sub_name as old_subName
             ,tb_product_bom.parent_model,tb_product_bom.parent_code,tb_product_bom.parent_name
        ,tb_material_product_history.e_version as version
        from db_doc.tb_Material,db_doc.tb_material_product_history,tb_product_bom
        from tb_Material,tb_material_product_history,tb_product_bom
        where tb_Material.id=tb_material_product_history.material_id
        and tb_material_product_history.parent_model=tb_product_bom.parent_model
        and tb_product_bom.version=tb_material_product_history.e_version
@@ -126,7 +126,7 @@
    <!--<select id="getReplaceHisMaterial" resultMap="replaceHisBom">
        select distinct tb_Material.*,tb_material_product_history.sub_name as old_subName
                      ,tb_product_bom.parent_model,tb_product_bom.parent_code,tb_product_bom.parent_name
        from db_doc.tb_Material,db_doc.tb_material_product_history,tb_product_bom
        from tb_Material,tb_material_product_history,tb_product_bom
        where tb_Material.id=tb_material_product_history.material_id
          and tb_material_product_history.parent_model=tb_product_bom.parent_model
          and tb_material_product_history.parent_model=#{parentModel}
@@ -136,11 +136,11 @@
    </select>-->
    <update id="updateDwgUrl">
        <foreach collection="list" item="item" separator=";">
            update db_doc.tb_material set dwg_url = #{item.notes} where sub_model = #{item.subModel}
            update tb_material set dwg_url = #{item.notes} where sub_model = #{item.subModel}
        </foreach>
    </update>
    <update id="disableStatus">
        update db_doc.tb_material set status = 0 where sub_code in
        update tb_material set status = 0 where sub_code in
        <foreach collection="list" item="item" separator="," open="(" close=")">
            #{item.subCode}
        </foreach>
@@ -189,7 +189,7 @@
         order by id asc
    </select>
    <select id="selectMaterialProductHistory"  resultType="com.whyc.pojo.MaterialProductHistory">
        select DISTINCT tb_material_product_history.*  FROM db_doc.tb_material_product_history,db_doc.tb_product
        select DISTINCT tb_material_product_history.*  FROM tb_material_product_history,tb_product
        where  tb_product.version>=tb_material_product_history.s_version and tb_product.version&lt;=tb_material_product_history.e_version
          and tb_product.parent_code=tb_material_product_history.parent_code
          and tb_product.custom_code=tb_material_product_history.custom_code
@@ -210,40 +210,40 @@
    </resultMap>
    <select id="selectMaterialInProduct"  resultMap="productIds">
        select p.*,tb_material_product_history.material_id  from (select DISTINCT tb_product.*  FROM db_doc.tb_product, db_doc.tb_product_bom
        select p.*,tb_material_product_history.material_id  from (select DISTINCT tb_product.*  FROM tb_product, tb_product_bom
        where  tb_product.id=tb_product_bom.product_id  and tb_product_bom.material_id=#{id}) as p
        left  outer join db_doc.tb_material_product_history on
        left  outer join tb_material_product_history on
        tb_material_product_history.parent_code= p.parent_code  and tb_material_product_history.custom_code= p.custom_code
        and  p.version>=tb_material_product_history.s_version and  p.version&lt;=tb_material_product_history.e_version
        and tb_material_product_history.sub_material_id=#{id}
    </select>
    <select id="selectAttachLock"  resultType="com.whyc.pojo.AttachLock">
        select DISTINCT tb_attach_lock.*  FROM db_doc.tb_attach_lock
        select DISTINCT tb_attach_lock.*  FROM tb_attach_lock
          where material_id=#{id}
    </select>
    <select id="getListByCodeList" resultType="java.lang.String">
        SELECT sub_code FROM db_doc.tb_material where sub_code in
        SELECT sub_code FROM tb_material where sub_code in
        <foreach collection="list" item="code" separator="," open="(" close=")">
            ${code}
        </foreach>
    </select>
    <select id="getListByCodeAndModelList" resultType="com.whyc.pojo.Material">
        <foreach collection="list" item="item" separator=" union ">
            select sub_code,sub_model from db_doc.tb_material where sub_code = #{item.subCode} and sub_model = #{item.subModel}
            select sub_code,sub_model from tb_material where sub_code = #{item.subCode} and sub_model = #{item.subModel}
        </foreach>
    </select>
    <select id="getListByCodeAndModelList2" resultType="com.whyc.pojo.Material">
        <foreach collection="list" item="item" separator=" union ">
            select id,sub_code,sub_model from db_doc.tb_material where sub_code = #{item.subCode} and sub_model = #{item.subModel}
            select id,sub_code,sub_model from tb_material where sub_code = #{item.subCode} and sub_model = #{item.subModel}
        </foreach>
    </select>
    <select id="getAttachByMaterialId" resultType="com.whyc.pojo.Material">
        select * from db_doc.tb_material WHERE id = #{materialId} limit 1
        select * from tb_material WHERE id = #{materialId} limit 1
    </select>
    <select id="getMaterialVersion" resultType="material">
        SELECT distinct *
        FROM db_doc.tb_material WHERE  sub_model LIKE '${subModel}%'
        FROM tb_material WHERE  sub_model LIKE '${subModel}%'
        ORDER BY create_date DESC
    </select>
    <resultMap id="materialInfo" type="Material">
@@ -271,15 +271,15 @@
        </collection>
    </resultMap>
    <select id="getMaterialById" resultMap="materialInfo">
        select * from db_doc.tb_material WHERE id = #{materialId} limit 1
        select * from tb_material WHERE id = #{materialId} limit 1
    </select>
    <select id="selectInProduct"  resultType="product">
        select DISTINCT tb_product.*  FROM db_doc.tb_product,db_doc.tb_product_bom
        select DISTINCT tb_product.*  FROM tb_product,tb_product_bom
        where tb_product.id=tb_product_bom.product_id
        and tb_product_bom.material_id=#{id}
    </select>
    <select id="selectInAttachLock"  resultType="attachLock">
        select DISTINCT tb_attach_lock.*  FROM db_doc.tb_attach_lock
        select DISTINCT tb_attach_lock.*  FROM tb_attach_lock
        where tb_attach_lock.material_id=#{id}
    </select>
</mapper>
src/main/resources/mapper/MaterialProductApprovingMapper.xml
@@ -4,7 +4,7 @@
    <select id="getLatestExistListByMaterialId" resultType="com.whyc.pojo.MaterialProductApproving">
        SELECT a.* FROM db_doc.tb_Material_product_approving a,db_doc.tb_worksheet_main m
        SELECT a.* FROM tb_Material_product_approving a,tb_worksheet_main m
        where a.main_id = m.id
        and m.status not in(0,5)
        and material_id = #{materialId}
src/main/resources/mapper/MaterialProductHistoryMapper.xml
@@ -19,27 +19,27 @@
    <update id="updateVersionBatch">
        <foreach collection="list" item="his" separator=";">
            update db_doc.tb_material_product_history set e_version = e_version+1 where id = #{his.id}
            update tb_material_product_history set e_version = e_version+1 where id = #{his.id}
        </foreach>
    </update>
    <update id="updateVersionSubtractBatch">
        <foreach collection="list" item="his" separator=";">
            update db_doc.tb_material_product_history set e_version = e_version-1 where id = #{his.id}
            update tb_material_product_history set e_version = e_version-1 where id = #{his.id}
        </foreach>
    </update>
    <select id="getLatestExistListByMaterialId" resultType="com.whyc.pojo.MaterialProductHistory">
        SELECT
        h.*
        FROM
        db_doc.tb_material_product_history h,
        db_doc.tb_product_bom b
        tb_material_product_history h,
        tb_product_bom b
        WHERE
        h.parent_model = b.parent_model
        AND b.version = h.e_version
        AND h.material_id = #{materialId}
    </select>
    <select id="getListWithMaterialInfo" resultMap="Map_MaterialProductHistory">
        SELECT mp.*,m.sub_code m_sub_code,m.sub_model FROM db_doc.tb_material_product_history mp,db_doc.tb_material m where mp.sub_material_id = m.id and mp.id in
        SELECT mp.*,m.sub_code m_sub_code,m.sub_model FROM tb_material_product_history mp,tb_material m where mp.sub_material_id = m.id and mp.id in
        <foreach collection="list" item="item" separator="," open="(" close=")">
            #{item.id}
        </foreach>
src/main/resources/mapper/PermitMapper.xml
@@ -4,7 +4,7 @@
    <select id="getPermitsByUname" resultType="Permit">
        select distinct tb_permit.* from db_doc.tb_permit,db_doc.tb_user_group,db_doc.tb_permit_group
        select distinct tb_permit.* from tb_permit,tb_user_group,tb_permit_group
        where tb_user_group.group_id=tb_permit_group.group_id
        and tb_permit_group.permit_id=tb_permit.permit_id
        and tb_user_group.uname=#{name}
src/main/resources/mapper/ProductBomHistoryMapper.xml
@@ -28,7 +28,7 @@
    <update id="updateVersionBatch">
        <foreach collection="list" item="his" separator=";">
            update db_doc.tb_product_bom_history set e_version = #{his.eVersion} where id = #{his.id}
            update tb_product_bom_history set e_version = #{his.eVersion} where id = #{his.id}
        </foreach>
    </update>
@@ -66,7 +66,7 @@
        ,tb_product_history.version
        ,tb_product_history.parent_code,tb_product_history.custom_code
        ,tb_Material.*
        from  db_doc.tb_product_bom_history,db_doc.tb_product_history,tb_Material
        from  tb_product_bom_history,tb_product_history,tb_Material
        where
        tb_product_bom_history.product_id = tb_product_history.id
        and
@@ -82,11 +82,11 @@
        order by tb_product_bom_history.id asc
    </select>
    <select id="selectSoftWares"  resultType="com.whyc.pojo.Software">
        select DISTINCT tb_software.*  FROM db_doc.tb_software
        select DISTINCT tb_software.*  FROM tb_software
        where apply_material_code=#{subCode}
    </select>
    <select id="selectMaterial"  resultType="com.whyc.pojo.Material">
        select DISTINCT tb_Material.*  FROM db_doc.tb_Material,db_doc.tb_material_product_history
        select DISTINCT tb_Material.*  FROM tb_Material,tb_material_product_history
        where tb_Material.id=tb_material_product_history.material_id
        and tb_material_product_history.parent_code=#{parentCode}
        and tb_material_product_history.custom_code=#{customCode}
@@ -95,17 +95,17 @@
        and tb_material_product_history.e_version>=#{version}
    </select>
    <select id="selectInAttachLock"  resultType="attachLock">
        select DISTINCT tb_attach_lock.*  FROM db_doc.tb_attach_lock
        select DISTINCT tb_attach_lock.*  FROM tb_attach_lock
        where tb_attach_lock.product_id=#{productId}
    </select>
    <select id="selectSoftware"  resultType="com.whyc.pojo.Software">
        select DISTINCT tb_software.*  FROM db_doc.tb_software
        select DISTINCT tb_software.*  FROM tb_software
        where apply_material_code=#{parentCode}
    </select>
    <select id="getBomListByProductIdAndSubVersion" resultMap="Map_ProductBomHistory">
        SELECT h.product_id,h.material_id,h.quantity,m.*
        FROM db_doc.tb_product_bom_history h,db_doc.tb_material m
        FROM tb_product_bom_history h,tb_material m
        where product_id = #{productId}
        and sub_s_version &lt;= #{subVersion}
        and sub_e_version &gt;= #{subVersion}
src/main/resources/mapper/ProductBomMapper.xml
@@ -27,16 +27,16 @@
    <update id="updateUrl">
        <foreach collection="list" item="item" separator=";">
            update db_doc.tb_product_bom set picture_url = #{item.pictureUrl},dwg_url = #{item.dwgUrl}
            update tb_product_bom set picture_url = #{item.pictureUrl},dwg_url = #{item.dwgUrl}
            where parent_model = #{item.parentModel} and sub_model = #{item.subModel} and id !=0
        </foreach>
    </update>
    <select id="searchCadDrawer" resultType="ProductBom" parameterType="ProductBom">
        select distinct tb_product_bom.*,tb_doc_user.name as upUser from db_doc.tb_product_bom,db_doc.tb_doc_user
        select distinct tb_product_bom.*,tb_doc_user.name as upUser from tb_product_bom,tb_doc_user
        <where>
            db_doc.tb_product_bom.up_user_id=db_doc.tb_doc_user.id
            tb_product_bom.up_user_id=tb_doc_user.id
           <if test="parentCode!=null&amp;&amp;parentCode!=''">
               and parent_code like '%${parentCode}%'
           </if>
@@ -78,8 +78,8 @@
        </where>
    </select>
    <select id="getAllSubWithOutMaterial" resultType="com.whyc.pojo.ProductBom">
        select * from  db_doc.tb_product_bom  b
        where (select count(1) as num from  db_doc.tb_material_product_history  c
        select * from  tb_product_bom  b
        where (select count(1) as num from  tb_material_product_history  c
               where b.parent_model= c.parent_model  and b.sub_name= c.sub_name  and b.version=c.e_version
                and c.material_id=#{materialId}
              ) = 0
@@ -116,7 +116,7 @@
    </resultMap>
    <select id="getSubByMaterialProduct" resultMap="MaterialList" parameterType="java.lang.String">
        select distinct *,0 as replaceStatus from  db_doc.tb_product_bom
        select distinct *,0 as replaceStatus from  tb_product_bom
        <where>
            parent_model = #{parentModel}
        </where>
@@ -124,14 +124,14 @@
    </select>
    <select id="selectMaterial"  resultType="com.whyc.pojo.Material">
        select DISTINCT tb_Material.*  FROM db_doc.tb_Material,db_doc.tb_material_product_history where tb_Material.id=tb_material_product_history.material_id
        select DISTINCT tb_Material.*  FROM tb_Material,tb_material_product_history where tb_Material.id=tb_material_product_history.material_id
        and tb_material_product_history.sub_name=#{subName} and tb_material_product_history.parent_model=#{parentModel}
        and tb_material_product_history.e_version=#{eVersion}
    </select>-->
    <select id="getOldMaterial"  resultType="com.whyc.pojo.Material">
        select DISTINCT tb_Material.*
        FROM db_doc.tb_Material,db_doc.tb_material_product_history,tb_product_bom
        FROM tb_Material,tb_material_product_history,tb_product_bom
        where tb_Material.id=tb_material_product_history.material_id
        and tb_material_product_history.parent_model=tb_product_bom.parent_model
        and tb_material_product_history.sub_name=#{oldSubName} and tb_material_product_history.link_type=1
@@ -168,7 +168,7 @@
        select distinct tb_product_bom.*
                      ,tb_product.parent_code,tb_product.custom_code,tb_product.version
                      ,tb_Material.*
        from  db_doc.tb_product_bom,db_doc.tb_product,tb_Material
        from  tb_product_bom,tb_product,tb_Material
        where
            tb_product_bom.product_id = tb_product.id
            and
@@ -180,7 +180,7 @@
        order by tb_product_bom.id asc
    </select>
    <select id="selectMaterial"  resultType="com.whyc.pojo.Material">
        select DISTINCT tb_Material.*  FROM db_doc.tb_Material,db_doc.tb_material_product_history
        select DISTINCT tb_Material.*  FROM tb_Material,tb_material_product_history
        where tb_Material.id=tb_material_product_history.material_id
        and tb_material_product_history.parent_code=#{parentCode}
        and tb_material_product_history.custom_code=#{customCode}
@@ -190,20 +190,20 @@
    </select>
    <select id="getListByCodeAndModelList2" resultType="com.whyc.pojo.ProductBom">
        <foreach collection="list" item="item" separator=" union ">
            select id,#{item.quantity} as quantity from db_doc.tb_material where sub_code = #{item.subCode} and sub_model = #{item.subModel}
            select id,#{item.quantity} as quantity from tb_material where sub_code = #{item.subCode} and sub_model = #{item.subModel}
        </foreach>
    </select>
    <select id="getEnabledBomListByParentCodeAndCustomCode" resultMap="Map_ProductBom">
        SELECT
        b.id b_id,b.quantity b_quantity,m.*
        FROM db_doc.tb_product p,db_doc.tb_product_bom b,db_doc.tb_material m
        FROM tb_product p,tb_product_bom b,tb_material m
        where p.id = b.product_id
        and b.material_id = m.id
        and p.parent_code = #{parentCode} and p.custom_code = #{customCode}
        and p.version!=-1
    </select>
    <insert id="insertBomSelectBomH">
        insert into db_doc.tb_product_bom(product_id,material_id,sub_version,quantity)
        select product_id,material_id,#{subVersionMax},quantity from db_doc.tb_product_bom_history where tb_product_bom_history.product_id=#{id}
        insert into tb_product_bom(product_id,material_id,sub_version,quantity)
        select product_id,material_id,#{subVersionMax},quantity from tb_product_bom_history where tb_product_bom_history.product_id=#{id}
    </insert>
</mapper>
src/main/resources/mapper/ProductMapper.xml
@@ -4,11 +4,11 @@
    <insert id="insertPselectPH">
        insert into db_doc.tb_product(id,parent_code,parent_name,parent_model,notes,custom_code,create_time,version_time,version)
        select id,parent_code,parent_name,parent_model,notes,custom_code,create_time,version_time,version from db_doc.tb_product_history where tb_product_history.id=#{id}
        insert into tb_product(id,parent_code,parent_name,parent_model,notes,custom_code,create_time,version_time,version)
        select id,parent_code,parent_name,parent_model,notes,custom_code,create_time,version_time,version from tb_product_history where tb_product_history.id=#{id}
    </insert>
    <select id="getAllProduct" resultType="Product">
        select distinct tb_product.* from db_doc.tb_product,db_doc.tb_product_bom,db_doc.tb_material
        select distinct tb_product.* from tb_product,tb_product_bom,tb_material
        <where>
            tb_product.id=tb_product_bom.product_id
            and tb_product_bom.material_id=tb_material.id
src/main/resources/mapper/WorksheetLinkMapper.xml
@@ -33,22 +33,22 @@
        m.id mid,m.title,m.description,m.file,m.create_user_id,m.begin_time,m.end_time,m.level,m.status,m.end_reason,m.type mType,
        l.id lid,deal_user_id,deal_type,deal_desc,deal_reason,link_file,link_status,enable_archive,create_time,deal_time
        FROM
            db_doc.tb_worksheet_main m,
            db_doc.tb_worksheet_link l
            tb_worksheet_main m,
            tb_worksheet_link l
        WHERE
            l.main_id = m.id
        AND deal_user_id = #{id}
    </select>
    <select id="getUser" resultType="com.whyc.pojo.DocUser">
        select name from db_doc.tb_doc_user where id =#{create_user_id}
        select name from tb_doc_user where id =#{create_user_id}
    </select>
    <select id="getInfoList2" resultMap="com.whyc.mapper.WorksheetMainMapper.Map_WorksheetMain">
        SELECT
        m.id mid,m.title,m.description,m.file,m.create_user_id,m.begin_time,m.end_time,m.level,m.status,m.end_reason,m.type mType
        FROM
            db_doc.tb_worksheet_main m,
            db_doc.tb_worksheet_link l
            tb_worksheet_main m,
            tb_worksheet_link l
        WHERE
            l.main_id = m.id
        AND l.deal_user_id = #{userId}
@@ -67,8 +67,8 @@
        m.id mid,m.title,m.description,m.file,m.create_user_id,m.begin_time,m.end_time,m.level,m.status,m.end_reason,m.type mType,
        l.deal_desc,l.deal_reason,l.deal_time
        FROM
        db_doc.tb_worksheet_main m,
        db_doc.tb_worksheet_link l
        tb_worksheet_main m,
        tb_worksheet_link l
        WHERE
        l.main_id = m.id
        AND l.deal_user_id = #{userId}
@@ -83,6 +83,6 @@
        order by m.id desc
    </select>
    <select id="getApprovingUser" resultType="com.whyc.pojo.DocUser">
        SELECT u.* FROM db_doc.tb_worksheet_link l,db_doc.tb_doc_user u,db_doc.tb_doc_depart d where l.deal_user_id = u.id and u.depart_id = d.depart_id and  l.main_id = #{mainId} and link_status = 0
        SELECT u.* FROM tb_worksheet_link l,tb_doc_user u,tb_doc_depart d where l.deal_user_id = u.id and u.depart_id = d.depart_id and  l.main_id = #{mainId} and link_status = 0
    </select>
</mapper>
src/main/resources/mapper/WorksheetMainMapper.xml
@@ -134,10 +134,10 @@
    </select>
    
    <select id="getUser" resultType="com.whyc.pojo.DocUser">
        select name from db_doc.tb_doc_user where id =#{user_id}
        select name from tb_doc_user where id =#{user_id}
    </select>
    <select id="getMaterial" resultType="Material">
        select category,sub_code,sub_name,sub_model,unit,quantity,producer,notes from db_doc.tb_material where id =#{material_id}
        select category,sub_code,sub_name,sub_model,unit,quantity,producer,notes from tb_material where id =#{material_id}
    </select>
    <select id="getLinkListWithMaterials" resultMap="Map_WorksheetMain3">
        SELECT