|
@@ -34,19 +34,17 @@
|
|
|
<!-- 查询字典内容分页 -->
|
|
|
<select id="getDictionaryPage" resultType="com.tld.model.Dictionary">
|
|
|
select
|
|
|
- a.*,b.name as materialType,c.user_name as modifyUser
|
|
|
- from ${tableName} a
|
|
|
- left join tld_material_type b on a.wllb_class = b.tld_id
|
|
|
- left join tld_user c on a.modify_user = c.id
|
|
|
+ *
|
|
|
+ from ${tableName}
|
|
|
<trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
<if test="name != null and name != ''">
|
|
|
- and a.name = #{name}
|
|
|
+ and name = #{name}
|
|
|
</if>
|
|
|
<if test="code != null and code != ''">
|
|
|
- and a.code = #{code}
|
|
|
+ and code = #{code}
|
|
|
</if>
|
|
|
<if test="tldId != null and tldId != ''">
|
|
|
- and a.tld_id = #{tldId}
|
|
|
+ and tld_id = #{tldId}
|
|
|
</if>
|
|
|
</trim>
|
|
|
</select>
|
|
@@ -67,4 +65,23 @@
|
|
|
<select id="getInventorySumAmount" resultType="int">
|
|
|
select ifnull(sum(amount), 0) from tld_inventory where material_id = #{tldId}
|
|
|
</select>
|
|
|
+ <!-- 查询字典内容分页 -->
|
|
|
+ <select id="getDictionaryMaterialPage" resultType="com.tld.model.Dictionary">
|
|
|
+ select
|
|
|
+ a.*,b.name as materialType,c.user_name as modifyUser
|
|
|
+ from ${tableName} a
|
|
|
+ left join tld_material_type b on a.wllb_class = b.tld_id
|
|
|
+ left join tld_user c on a.modify_user = c.id
|
|
|
+ <trim prefix="WHERE" prefixOverrides="and |or">
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ and a.name = #{name}
|
|
|
+ </if>
|
|
|
+ <if test="code != null and code != ''">
|
|
|
+ and a.code = #{code}
|
|
|
+ </if>
|
|
|
+ <if test="tldId != null and tldId != ''">
|
|
|
+ and a.tld_id = #{tldId}
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </select>
|
|
|
</mapper>
|