src/main/resources/mapper/GoodsDao.xml
(完整代码) 2KB<?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.dao.GoodsDao">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
a.id as id
,a.goods_name as goodsName
,a.goods_types as goodsTypes
,a.goods_number as goodsNumber
,a.goods_photo as goodsPhoto
,a.danwei as danwei
,a.goods_content as goodsContent
,a.flag as flag
,a.create_time as createTime
</sql>
<select id="selectListView" parameterType="map" resultType="com.entity.view.GoodsView" >
SELECT
<include refid="Base_Column_List" />
-- 级联表的字段
FROM goods a
<where>
<if test=" params.goodsName != '' and params.goodsName != null and params.goodsName != 'null' ">
and a.goods_name like CONCAT('%',#{params.goodsName},'%')
</if>
<if test="params.goodsTypes != null">
and a.goods_types = #{params.goodsTypes}
</if>
<if test="params.goodsNumberStart != null">
<![CDATA[ and a.goods_number >= #{params.goodsNumberStart} ]]>
</if>
<if test="params.goodsNumberEnd != null">
<![CDATA[ and a.goods_number <= #{params.goodsNumberEnd} ]]>
</if>
<if test=" params.danwei != '' and params.danwei != null and params.danwei != 'null' ">
and a.danwei like CONCAT('%',#{params.danwei},'%')
</if>
<if test=" params.goodsContent != '' and params.goodsContent != null and params.goodsContent != 'null' ">
and a.goods_content like CONCAT('%',#{params.goodsContent},'%')
</if>
<if test="params.flagStart != null">
<![CDATA[ and a.flag >= #{params.flagStart} ]]>
</if>
<if test="params.flagEnd != null">
<![CDATA[ and a.flag <= #{params.flagEnd} ]]>
</if>
</where>
order by a.id desc
</select>
</mapper>
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
