@ -4,49 +4,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace= "com.ruoyi.system.mapper.SysProductModelMapper" >
<resultMap type= "SysProductModel" id= "SysProductModelResult" >
<result property= "Pid" column= "Pid" />
<result property= "Pcode" column= "Pcode" />
<result property= "createBy" column= "create_by" />
<result property= "equipModel" column= "equipModel" />
<result property= "equipName" column= "equipName" />
<result property= "specification" column= "specification" />
<result property= "differences" column= "differences" />
<result property= "remark" column= "remark" />
<result property= "createTime" column= "create_time" />
<result property= "udpateBy" column= "udpate_by" />
<result property= "updateTime" column= "update_time" />
<result property= "photoUrl" column= "photoUrl" />
<result property= "pid" column= "pid" />
<result property= "pcode" column= "pcode" />
<result property= "equipModel" column= "equipModel" />
<result property= "equipName" column= "equipName" />
<result property= "specification" column= "specification" />
<result property= "differences" column= "differences" />
<result property= "engineer" column= "engineer" />
<result property= "createBy" column= "create_by" />
<result property= "createTime" column= "create_time" />
<result property= "updateBy" column= "update_by" />
<result property= "updateTime" column= "update_time" />
<result property= "remark" column= "remark" />
<result property= "useStatus" column= "use_status" />
<result property= "photoUrl" column= "photoUrl" />
</resultMap>
<sql id= "selectSysProductModelVo" >
select Pid, Pcode, create_by, equipModel, equipName, specification, differences, remark, create_time, udpate_by, update_time, photoUrl from sys_product_model
select pid, pcode, equipModel, equipName,engineer,use_status,
specification, differences, create_by, create_time, udpate_by,
update_time,remark, photoUrl from sys_product_model
</sql>
<select id= "selectSysProductModelList" parameterType= "SysProductModel" resultMap= "SysProductModelResult" >
<include refid= "selectSysProductModelVo" />
<where >
<if test= "Pcode != null and Pcode != ''" > and Pcode = #{P code}</if>
<where >
<if test= "pcode != null and pcode != ''" > and Pcode = #{p code}</if>
<if test= "createBy != null and createBy != ''" > and create_by = #{createBy}</if>
<if test= "equipModel != null and equipModel != ''" > and equipModel = #{equipModel}</if>
<if test= "equipName != null and equipName != ''" > and equipName like concat('%', #{equipName}, '%')</if>
<if test= "specification != null and specification != ''" > and specification = #{specification}</if>
<if test= "differences != null and differences != ''" > and differences = #{differences}</if>
<if test= "params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''" > and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
<if test= "udpateBy != null and udpateBy != ''" > and udpate_by = #{udpateBy}</if>
<if test= "photoUrl != null and photoUrl != ''" > and photoUrl = #{photoUrl}</if>
<if test= "params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''" >
and create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
<if test= "updateBy != null and updateBy != ''" > and update_by = #{updateBy}</if>
<if test= "useStatus != null and useStatus != ''" > and use_status = #{useStatus}</if>
<if test= "engineer !=null and engineer != ''" > engineer = #{engineer}</if>
</where>
</select>
<select id= "selectSysProductModelById" parameterType= "Long" resultMap= "SysProductModelResult" >
<include refid= "selectSysProductModelVo" />
where Pid = #{P id}
where pid = #{p id}
</select>
<insert id= "insertSysProductModel" parameterType= "SysProductModel" >
<insert id= "insertSysProductModel" parameterType= "SysProductModel" useGeneratedKeys= "true" keyProperty= "pid" >
insert into sys_product_model
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "Pid != null" > Pid,</if>
<if test= "Pcode != null" > Pcode,</if>
<if test= "pcode != null" > pcode,</if>
<if test= "createBy != null" > create_by,</if>
<if test= "equipModel != null" > equipModel,</if>
<if test= "equipName != null" > equipName,</if>
@ -54,13 +59,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "differences != null" > differences,</if>
<if test= "remark != null" > remark,</if>
<if test= "createTime != null" > create_time,</if>
<if test= "ud pateBy != null" > ud pate_by,</if>
<if test= "upd ateBy != null" > upd ate_by,</if>
<if test= "updateTime != null" > update_time,</if>
<if test= "photoUrl != null" > photoUrl,</if>
use_status
</trim>
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<if test= "Pid != null" > #{Pid},</if>
<if test= "Pcode != null" > #{Pcode},</if>
<if test= "pcode != null" > #{pcode},</if>
<if test= "createBy != null" > #{createBy},</if>
<if test= "equipModel != null" > #{equipModel},</if>
<if test= "equipName != null" > #{equipName},</if>
@ -68,16 +73,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "differences != null" > #{differences},</if>
<if test= "remark != null" > #{remark},</if>
<if test= "createTime != null" > #{createTime},</if>
<if test= "ud pateBy != null" > #{ud pateBy},</if>
<if test= "upd ateBy != null" > #{upd ateBy},</if>
<if test= "updateTime != null" > #{updateTime},</if>
<if test= "photoUrl != null" > #{photoUrl},</if>
'1'
</trim>
</insert>
<update id= "updateSysProductModel" parameterType= "SysProductModel" >
update sys_product_model
<trim prefix= "SET" suffixOverrides= "," >
<if test= "Pcode != null" > Pcode = #{P code},</if>
<if test= "pcode != null" > pcode = #{p code},</if>
<if test= "createBy != null" > create_by = #{createBy},</if>
<if test= "equipModel != null" > equipModel = #{equipModel},</if>
<if test= "equipName != null" > equipName = #{equipName},</if>
@ -85,30 +91,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test= "differences != null" > differences = #{differences},</if>
<if test= "remark != null" > remark = #{remark},</if>
<if test= "createTime != null" > create_time = #{createTime},</if>
<if test= "udpateBy != null" > udpate_by = #{udpateBy},</if>
<if test= "updateTime != null" > update_time = #{updateTime},</if>
<if test= "updateBy != null" > update_by = #{updateBy},</if>
<if test= "photoUrl != null" > photoUrl = #{photoUrl},</if>
<if test= "useStatus != null" > use_status = #{useStatus},</if>
update_time = now()
</trim>
where Pid = #{Pid}
where pid = #{p id}
</update>
<delete id= "deleteSysProductModelById" parameterType= "Long" >
delete from sys_product_model where Pid = #{P id}
delete from sys_product_model where pid = #{p id}
</delete>
<delete id= "deleteSysProductModelByIds" parameterType= "String" >
delete from sys_product_model where Pid in
<foreach item= "P id" collection= "array" open= "(" separator= "," close= ")" >
#{P id}
delete from sys_product_model where pid in
<foreach item= "p id" collection= "array" open= "(" separator= "," close= ")" >
#{p id}
</foreach>
</delete>
<update id= "cancelSysProductModelById" parameterType= "Long" >
update sys_product_model set del_flag = '1' where Pid = #{P id}
update sys_product_model set use_status = '1' where pid = #{p id}
</update>
<update id= "restoreSysProductModelById" parameterType= "Long" >
update sys_product_model set del_flag = '0' where Pid = #{P id}
update sys_product_model set use_status = '0' where pid = #{p id}
</update>
</mapper>