You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.8 KiB

<?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.gxwebsoft.tower.mapper.TowerPartMapper">
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
FROM tower_part a
<where>
<if test="param.partId != null">
AND a.part_id = #{param.partId}
</if>
<if test="param.partCode != null">
AND a.part_code LIKE CONCAT('%', #{param.partCode}, '%')
</if>
<if test="param.category != null">
AND a.category LIKE CONCAT('%', #{param.category}, '%')
</if>
<if test="param.specs != null">
AND a.specs LIKE CONCAT('%', #{param.specs}, '%')
</if>
<if test="param.position != null">
AND a.position LIKE CONCAT('%', #{param.position}, '%')
</if>
<if test="param.stock != null">
AND a.stock = #{param.stock}
</if>
<if test="param.stockMoney != null">
AND a.stock_money = #{param.stockMoney}
</if>
<if test="param.price != null">
AND a.price = #{param.price}
</if>
<if test="param.stockMin != null">
AND a.stock_min = #{param.stockMin}
</if>
<if test="param.stockLower != null">
AND a.stock_lower = #{param.stockLower}
</if>
<if test="param.status != null">
AND a.status = #{param.status}
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</if>
<if test="param.sortNumber != null">
AND a.sort_number = #{param.sortNumber}
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
</where>
</sql>
<!-- 分页查询 -->
<select id="selectPageRel" resultType="com.gxwebsoft.tower.entity.TowerPart">
<include refid="selectSql"></include>
</select>
<!-- 查询全部 -->
<select id="selectListRel" resultType="com.gxwebsoft.tower.entity.TowerPart">
<include refid="selectSql"></include>
</select>
</mapper>