<?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.jilongda.manage.mapper.TGoodsMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.jilongda.common.model.TGoods">
|
<id column="id" property="id" />
|
<result column="goodsName" property="goodsName" />
|
<result column="goodsPicture" property="goodsPicture" />
|
<result column="goodsNo" property="goodsNo" />
|
<result column="goodsBrand" property="goodsBrand" />
|
<result column="goodsNature" property="goodsNature" />
|
<result column="goodsType" property="goodsType" />
|
<result column="goodsRemark" property="goodsRemark" />
|
<result column="createTime" property="createTime" />
|
<result column="updateTime" property="updateTime" />
|
<result column="createBy" property="createBy" />
|
<result column="updateBy" property="updateBy" />
|
<result column="isDelete" property="isDelete" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id, goodsName, goodsPicture, goodsNo, goodsBrand, goodsNature, goodsType, goodsRemark, createTime, updateTime, createBy, updateBy, isDelete
|
</sql>
|
<select id="pageList" resultType="com.jilongda.manage.vo.TGoodsVO">
|
select
|
<include refid="Base_Column_List"/>
|
from t_goods
|
<where>
|
<if test="query.goodsName != null and query.goodsName != ''">
|
and goodsName like concat('%',#{query.goodsName},'%')
|
</if>
|
<if test="query.goodsBrand != null and query.goodsBrand != ''">
|
and goodsBrand like concat('%',#{query.goodsBrand},'%')
|
</if>
|
<if test="query.goodsType != null and query.goodsType != ''">
|
and goodsType like concat('%',#{query.goodsType},'%')
|
</if>
|
AND isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()}
|
</where>
|
ORDER BY createTime,id DESC
|
</select>
|
<select id="pageListExport" resultType="com.jilongda.manage.excel.TGoodsExportExcels">
|
select
|
tg.id, tg.goodsName, tg.goodsPicture, tg.goodsNo, tg.goodsBrand, tg.goodsNature, tg.goodsType, tg.goodsRemark, tg.createTime, tg.updateTime, tg.createBy, tg.updateBy, tg.isDelete,
|
tgs.goodsContent, tgs.salesDirector, tgs.accountManager, tgs.goodsDosage, tgs.goodsSpecifications, tgs.warehouse, tgs.generalManagerPrice,
|
(SELECT
|
IFNULL( GROUP_CONCAT( phone ), '' ) userPhones
|
FROM
|
sec_user
|
WHERE
|
FIND_IN_SET(
|
id,(tgs.userIds))
|
) AS userPhones,
|
tgs.id as goodsSpecificationsId
|
from t_goods tg
|
left join t_goods_specifications tgs on tg.id = tgs.goodsId
|
<where>
|
<if test="query.goodsName != null and query.goodsName != ''">
|
and tg.goodsName like concat('%',#{query.goodsName},'%')
|
</if>
|
<if test="query.goodsBrand != null and query.goodsBrand != ''">
|
and tg.goodsBrand like concat('%',#{query.goodsBrand},'%')
|
</if>
|
<if test="query.goodsType != null and query.goodsType != ''">
|
and tg.goodsType like concat('%',#{query.goodsType},'%')
|
</if>
|
AND tg.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()}
|
</where>
|
ORDER BY tg.createTime DESC
|
</select>
|
<select id="queryList" resultType="com.jilongda.common.model.TGoods">
|
select <include refid="Base_Column_List"></include>
|
from t_goods
|
</select>
|
|
</mapper>
|