<?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.qianwen.smartman.modules.smis.mapper.ProcessMapper">
|
|
|
<select id="listPage" resultType="com.qianwen.smartman.modules.smis.dto.ProcessDTO">
|
SELECT
|
p.id,p.code,p.name,p.type,p.description,bd.dict_value as typeName,p.status
|
FROM blade_process p
|
LEFT JOIN blade_dict bd on bd.dict_key = p.type and bd.code = 'work_type'
|
WHERE p.is_deleted = 0 and p.status = #{status}
|
<if test="keyword != null and keyword != ''">
|
AND (p.code LIKE concat(#{keyword},'%') or p.name LIKE concat(#{keyword},'%') or bd.dict_value LIKE
|
concat(#{keyword},'%'))
|
</if>
|
ORDER BY p.create_time DESC , p.id DESC ;
|
<!-- ORDER BY p.create_time DESC-->
|
<!-- <if test="keywords != null and keywords != ''">-->
|
<!-- <!– bind标签的两个属性都是必选项,name为绑定到上下文的变量名,value为OGNL表达式 –>-->
|
<!-- <bind name="temp" value="'%' + keywords + '%'"/>-->
|
<!-- and CONCAT_WS("-",w.code) like #{temp}-->
|
<!-- </if>-->
|
</select>
|
<resultMap id="BaseResultMap" type="com.qianwen.smartman.modules.smis.dto.ProcessDTO">
|
<id property="id" column="id"/>
|
<result column="code" property="code"/>
|
<result column="name" property="name"/>
|
<result column="type" property="type"/>
|
<result column="description" property="description"/>
|
</resultMap>
|
|
<select id="selectByIdWithType" resultType="com.qianwen.smartman.modules.smis.vo.ProcessDetailVO" parameterType="long">
|
SELECT p.id,
|
p.CODE,
|
p.NAME,
|
p.type,
|
p.description,
|
bd.dict_value AS typeName
|
FROM blade_process p
|
LEFT JOIN blade_dict bd ON bd.dict_key = p.type
|
AND bd.CODE = 'work_type'
|
WHERE p.is_deleted = 0
|
AND p.id = #{processId}
|
</select>
|
|
<select id="existCraftProcess" resultType="java.lang.Integer">
|
select count(*)
|
from blade_process bp
|
where bp.is_deleted = 0
|
and exists(select *
|
from blade_production_craft_process bpcp
|
where bpcp.is_deleted = 0
|
and bpcp.process_id = bp.id
|
and bp.id in
|
<foreach collection="processIds" item="processId" index="index" open="(" close=")" separator=",">
|
#{processId}
|
</foreach>
|
)
|
</select>
|
|
<select id="listProcessExcel" resultType="com.qianwen.smartman.modules.smis.excel.ProcessExcel">
|
SELECT p.code,p.name,p.description,bd.dict_value as typeName
|
FROM blade_process p
|
LEFT JOIN blade_dict bd on bd.dict_key = p.type and bd.code = 'work_type'
|
WHERE p.is_deleted = 0 and p.status = #{status}
|
<if test="keyword != null and keyword != ''">
|
AND (p.code LIKE concat(#{keyword},'%') or p.name LIKE concat(#{keyword},'%') or bd.dict_value LIKE
|
concat(#{keyword},'%'))
|
</if>
|
ORDER BY p.create_time DESC , p.id DESC ;
|
</select>
|
</mapper>
|