gz_safety_ma/src/main/resources/mappers/business/app/CommonMapper.xml

41 lines
1.7 KiB
XML
Raw Normal View History

2025-01-16 19:19:59 +08:00
<?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.bonus.aqgqj.business.app.mapper.CommonMapper">
<!--添加附件-->
<insert id="uploadAppFile">
INSERT INTO bm_file_upload (id,file_name,file_url,create_time,creator,model_table,own_id,suffix,file_type,create_name,type)
VALUES
<foreach collection="list" item="item" separator=",">
(null,#{item.fileName},#{item.fileUrl},now(),#{item.creator},#{item.modelTable},#{item.ownId},#{item.suffix},#{item.fileType},#{item.createName},#{item.type})
</foreach>
</insert>
<!--工程下拉选-->
<select id="getProList" resultType="com.bonus.aqgqj.business.app.entity.vo.CommonVo">
SELECT bid_id AS id, name AS `name`
FROM bm_project WHERE is_active = '1'
<where>
<if test="keyWord!=null and keyWord!=''">
AND INSTR(name,#{keyWord}) > 0
</if>
</where>
2025-01-21 10:26:15 +08:00
order by id desc
2025-01-16 19:19:59 +08:00
</select>
<!--退料物资类型列表-->
<select id="getMaTypeByReturnCheck" resultType="com.bonus.aqgqj.business.app.entity.vo.AppMaTypeVo">
SELECT smt.name AS `model`,
smt2.name AS `name`,
smt3.name AS `type`,
smt.id AS modelId,
smt.unit_name AS unit
FROM st_ma_type smt
LEFT JOIN st_ma_type smt2 ON smt.parent_id = smt2.id
LEFT JOIN st_ma_type smt3 ON smt2.parent_id = smt3.id
WHERE smt.level = '3' AND smt.is_active = '0'
<if test="keyWord!=null and keyWord!=''">
AND INSTR(smt.name,#{keyWord}) > 0
</if>
</select>
</mapper>