@@ -33,6 +33,14 @@
|
||||
<result column="UName" jdbcType="VARCHAR" property="UName" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap extends="BaseResultMap" id="ResultByMaterial" type="com.jsh.erp.datasource.entities.DepotItemVo4WithInfoEx">
|
||||
<result column="MId" jdbcType="VARCHAR" property="MId" />
|
||||
<result column="MName" jdbcType="VARCHAR" property="MName" />
|
||||
<result column="MModel" jdbcType="VARCHAR" property="MModel" />
|
||||
<result column="MaterialUnit" jdbcType="VARCHAR" property="MaterialUnit" />
|
||||
<result column="MColor" jdbcType="VARCHAR" property="MColor" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByConditionDepotItem" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="BaseResultMap">
|
||||
select *
|
||||
FROM jsh_depotitem
|
||||
@@ -125,40 +133,40 @@
|
||||
from jsh_depotitem di left join jsh_material m on di.MaterialId=m.id
|
||||
left join jsh_unit u on m.UnitId = u.id
|
||||
left join jsh_depot dp1 on di.DepotId=dp1.id
|
||||
left join jsh_depot dp2 on di.AnotherDepotId=dp1.id
|
||||
left join jsh_depot dp2 on di.AnotherDepotId=dp2.id
|
||||
where di.HeaderId = ${headerId}
|
||||
order by di.id asc
|
||||
</select>
|
||||
|
||||
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultWithInfoExMap">
|
||||
select di.*, m.Name MName, m.Model MModel, m.Unit MaterialUnit, m.Color MColor
|
||||
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="ResultByMaterial">
|
||||
select m.id MId, m.Name MName, m.Model MModel, m.Unit MaterialUnit, m.Color MColor
|
||||
from jsh_depotitem di
|
||||
inner join jsh_material m on di.MaterialId=m.id
|
||||
where 1=1
|
||||
<if test="headIds != null">
|
||||
and HeaderId in (${headIds})
|
||||
and di.HeaderId in (${headIds})
|
||||
</if>
|
||||
<if test="materialIds != null">
|
||||
and MaterialId in (${materialIds})
|
||||
and di.MaterialId in (${materialIds})
|
||||
</if>
|
||||
group by MaterialId
|
||||
group by m.id,m.Name, m.Model, m.Unit, m.Color
|
||||
<if test="offset != null and rows != null">
|
||||
limit #{offset},#{rows}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="findByAllCount" resultType="java.lang.Integer">
|
||||
select count(1) from (select di.Id
|
||||
select count(1) from (select m.id
|
||||
from jsh_depotitem di
|
||||
inner join jsh_material m on di.MaterialId=m.id
|
||||
where 1=1
|
||||
<if test="headIds != null">
|
||||
and HeaderId in (${headIds})
|
||||
and di.HeaderId in (${headIds})
|
||||
</if>
|
||||
<if test="materialIds != null">
|
||||
and MaterialId in (${materialIds})
|
||||
and di.MaterialId in (${materialIds})
|
||||
</if>
|
||||
group by MaterialId) cc
|
||||
group by m.id) cc
|
||||
</select>
|
||||
|
||||
<select id="findByTypeInIsPrev" resultType="java.lang.Double">
|
||||
|
||||
@@ -77,4 +77,22 @@
|
||||
UnitId = null
|
||||
where Id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.MaterialExample" resultMap="ResultMapList">
|
||||
select m.*,u.uname unitName, mc.name categoryName
|
||||
FROM jsh_material m
|
||||
left JOIN jsh_unit u on m.UnitId = u.id
|
||||
left JOIN jsh_materialcategory mc on m.CategoryId = mc.id
|
||||
where 1=1
|
||||
<if test="name != null">
|
||||
and m.name like '%${name}%'
|
||||
</if>
|
||||
<if test="model != null">
|
||||
and m.model like '%${model}%'
|
||||
</if>
|
||||
<if test="categoryId != 1">
|
||||
and m.CategoryId in (${categoryIds})
|
||||
</if>
|
||||
order by m.id asc
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -45,4 +45,25 @@
|
||||
and description like '%${description}%'
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="findByAll" parameterType="com.jsh.erp.datasource.entities.SupplierExample" resultMap="BaseResultMap">
|
||||
select *
|
||||
FROM jsh_supplier
|
||||
where 1=1
|
||||
<if test="supplier != null">
|
||||
and supplier like '%${supplier}%'
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type='${type}'
|
||||
</if>
|
||||
<if test="phonenum != null">
|
||||
and phonenum like '%${phonenum}%'
|
||||
</if>
|
||||
<if test="telephone != null">
|
||||
and telephone like '%${telephone}%'
|
||||
</if>
|
||||
<if test="description != null">
|
||||
and description like '%${description}%'
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user