仓库信息sql$修改为#
This commit is contained in:
@@ -16,14 +16,16 @@
|
||||
left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1'
|
||||
left JOIN jsh_materialcategory mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2'
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and m.name like '%${name}%'
|
||||
<if test="name != null and name != ''">
|
||||
<bind name="name" value="'%' + _parameter.name + '%'"/>
|
||||
and m.name like #{name}
|
||||
</if>
|
||||
<if test="model != null">
|
||||
and m.model like '%${model}%'
|
||||
<if test="model != null and model != ''">
|
||||
<bind name="model" value="'%' + _parameter.model + '%'"/>
|
||||
and m.model like #{model}
|
||||
</if>
|
||||
<if test="categoryId != 1">
|
||||
and m.CategoryId in (${categoryIds})
|
||||
and m.CategoryId in (#{categoryIds})
|
||||
</if>
|
||||
and ifnull(m.delete_Flag,'0') !='1'
|
||||
order by m.id asc
|
||||
@@ -39,14 +41,16 @@
|
||||
left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1'
|
||||
left JOIN jsh_materialcategory mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2'
|
||||
WHERE 1=1
|
||||
<if test="name != null">
|
||||
and m.name like '%${name}%'
|
||||
<if test="name != null and name != ''">
|
||||
<bind name="name" value="'%' + _parameter.name + '%'"/>
|
||||
and m.name like #{name}
|
||||
</if>
|
||||
<if test="model != null">
|
||||
and m.model like '%${model}%'
|
||||
<if test="model != null and model != ''">
|
||||
<bind name="model" value="'%' + _parameter.model + '%'"/>
|
||||
and m.model like #{model}
|
||||
</if>
|
||||
<if test="categoryId != 1">
|
||||
and m.CategoryId in (${categoryIds})
|
||||
and m.CategoryId in (#{categoryIds})
|
||||
</if>
|
||||
and ifnull(m.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
@@ -54,14 +58,14 @@
|
||||
<select id="findUnitName" resultType="java.lang.String">
|
||||
select u.UName from jsh_unit u
|
||||
left join jsh_material m on m.UnitId=u.id and ifnull(m.delete_Flag,'0') !='1'
|
||||
where m.id = ${mId}
|
||||
where m.id = #{mId}
|
||||
and ifnull(u.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
<select id="findById" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultAndUnitMap">
|
||||
select m.*,u.UName from jsh_material m
|
||||
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
|
||||
where m.id = ${id}
|
||||
where m.id = #{id}
|
||||
and ifnull(m.delete_Flag,'0') !='1'
|
||||
</select>
|
||||
|
||||
@@ -96,14 +100,16 @@
|
||||
left JOIN jsh_unit u on m.UnitId = u.id and ifnull(u.delete_Flag,'0') !='1'
|
||||
left JOIN jsh_materialcategory mc on m.CategoryId = mc.id and ifnull(mc.status,'0') !='2'
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and m.name like '%${name}%'
|
||||
<if test="name != null and name != ''">
|
||||
<bind name="name" value="'%' + _parameter.name + '%'"/>
|
||||
and m.name like #{name}
|
||||
</if>
|
||||
<if test="model != null">
|
||||
and m.model like '%${model}%'
|
||||
<if test="model != null and model != ''">
|
||||
<bind name="model" value="'%' + _parameter.model + '%'"/>
|
||||
and m.model like #{model}
|
||||
</if>
|
||||
<if test="categoryId != 1">
|
||||
and m.CategoryId in (${categoryIds})
|
||||
and m.CategoryId in (#{categoryIds})
|
||||
</if>
|
||||
and ifnull(m.delete_Flag,'0') !='1'
|
||||
order by m.id asc
|
||||
|
||||
Reference in New Issue
Block a user