69 lines
2.0 KiB
XML
69 lines
2.0 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="tech.riemann.ims.mapper.material.MaterialMapper">
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<resultMap id="BaseResultMap" type="tech.riemann.ims.entity.material.Material">
|
|
|
|
</resultMap>
|
|
<select id="queryLikeRight" resultType="tech.riemann.ims.entity.material.Material">
|
|
SELECT
|
|
id,
|
|
m_code AS `code`,
|
|
m_name AS `name`,
|
|
m_assign_rule AS `assignRule`,
|
|
m_type AS `type`,
|
|
m_price AS `price`,
|
|
m_spec AS `spec`,
|
|
m_stock AS `stock`,
|
|
m_description AS `description`,
|
|
created_time,
|
|
updated_time,
|
|
created_by,
|
|
updated_by
|
|
FROM
|
|
t_material
|
|
<where>
|
|
<foreach collection="types" item="item" separator="or">
|
|
( m_type like concat(#{item},'%') )
|
|
</foreach>
|
|
</where>
|
|
|
|
</select>
|
|
<select id="getPage" resultType="tech.riemann.ims.entity.material.Material">
|
|
|
|
SELECT
|
|
id,
|
|
m_code AS `code`,
|
|
m_name AS `name`,
|
|
m_assign_rule AS `assignRule`,
|
|
m_type AS `type`,
|
|
m_price AS `price`,
|
|
m_spec AS `spec`,
|
|
m_stock AS `stock`,
|
|
m_description AS `description`,
|
|
created_time,
|
|
updated_time,
|
|
created_by,
|
|
updated_by
|
|
FROM
|
|
t_material
|
|
<where>
|
|
<if test="types != null and types.size() > 0">
|
|
and (
|
|
<foreach collection="types" item="item" separator="or">
|
|
( m_type like concat(#{item},'%') )
|
|
</foreach>
|
|
)
|
|
</if>
|
|
<if test="key != null and key.trim().length() > 0">
|
|
and (
|
|
m_code like concat('%',#{key},'%')
|
|
or m_name like concat('%',#{key},'%')
|
|
)
|
|
</if>
|
|
</where>
|
|
order by updated_time desc
|
|
</select>
|
|
|
|
</mapper> |