特殊技能、师傅特殊技能 表与mapper
This commit is contained in:
parent
1237d578d1
commit
cbd10c575f
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.ghy.worker.domain;
|
||||||
|
|
||||||
|
import com.ghy.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 特殊技能
|
||||||
|
*
|
||||||
|
* @author HH 2022/6/7
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SpecialSkill extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long specialSkillId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 特殊技能名称
|
||||||
|
*/
|
||||||
|
private String specialSkillName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联第三级商品类目主键
|
||||||
|
*/
|
||||||
|
private Long goodsCategoryId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否危险
|
||||||
|
*/
|
||||||
|
private Integer dangerous;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.ghy.worker.domain;
|
||||||
|
|
||||||
|
import com.ghy.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class WorkerSpecialSkill extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long workerSpecialSkillId;
|
||||||
|
/**
|
||||||
|
* 师傅ID
|
||||||
|
*/
|
||||||
|
private Long workerId;
|
||||||
|
/**
|
||||||
|
* 特殊技能ID
|
||||||
|
*/
|
||||||
|
private Long specialSkillId;
|
||||||
|
/**
|
||||||
|
* 技能证书
|
||||||
|
*/
|
||||||
|
private String credential;
|
||||||
|
/**
|
||||||
|
* 保险
|
||||||
|
*/
|
||||||
|
private String insurance;
|
||||||
|
/**
|
||||||
|
* 保险生效日期
|
||||||
|
*/
|
||||||
|
private LocalDate insuranceStart;
|
||||||
|
/**
|
||||||
|
* 保险截止日期
|
||||||
|
*/
|
||||||
|
private LocalDate insuranceEnd;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.ghy.worker.mapper;
|
||||||
|
|
||||||
|
import com.ghy.worker.domain.SpecialSkill;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 特殊技能Mapper
|
||||||
|
*
|
||||||
|
* @author HH 2022/6/7
|
||||||
|
*/
|
||||||
|
public interface SpecialSkillMapper {
|
||||||
|
|
||||||
|
int insert(SpecialSkill specialSkill);
|
||||||
|
|
||||||
|
int delete(Long[] ids);
|
||||||
|
|
||||||
|
int update(SpecialSkill specialSkill);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.ghy.worker.mapper;
|
||||||
|
|
||||||
|
import com.ghy.worker.domain.WorkerArea;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 师傅特殊技能Mapper
|
||||||
|
*
|
||||||
|
* @author HH 2022/6/7
|
||||||
|
*/
|
||||||
|
public interface WorkerSpecialSkillMapper {
|
||||||
|
|
||||||
|
int insert(WorkerArea workerArea);
|
||||||
|
|
||||||
|
int delete(Long[] ids);
|
||||||
|
|
||||||
|
int deleteByWorker(Long workerId);
|
||||||
|
|
||||||
|
List<WorkerArea> getByWorker(Long workerId);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
<?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.ghy.worker.mapper.SpecialSkillMapper">
|
||||||
|
|
||||||
|
<resultMap id="SpecialSkillResult" type="com.ghy.worker.domain.SpecialSkill">
|
||||||
|
<result property="specialSkillId" column="special_skill_id"/>
|
||||||
|
<result property="specialSkillName" column="special_skill_name"/>
|
||||||
|
<result property="goodsCategoryId" column="goods_category_id"/>
|
||||||
|
<result property="dangerous" column="dangerous"/>
|
||||||
|
<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"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insert" parameterType="com.ghy.worker.domain.SpecialSkill" useGeneratedKeys="true" keyProperty="specialSkillId">
|
||||||
|
INSERT INTO special_skill(
|
||||||
|
<if test="specialSkillName != null and specialSkillName !=''">special_skill_name,</if>
|
||||||
|
<if test="goodsCategoryId != null and goodsCategoryId > 0">goods_category_id,</if>
|
||||||
|
<if test="dangerous != null">dangerous,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
<if test="remark != null and remark != ''">remark,</if>
|
||||||
|
create_time
|
||||||
|
)VALUES(
|
||||||
|
<if test="specialSkillName != null and specialSkillName !=''">#{specialSkillName},</if>
|
||||||
|
<if test="goodsCategoryId != null and goodsCategoryId > 0">#{provinceId},</if>
|
||||||
|
<if test="dangerous != null">#{dangerous},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
<if test="remark != null and remark != ''">#{remark},</if>
|
||||||
|
sysdate()
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update">
|
||||||
|
UPDATE special_skill
|
||||||
|
<set>
|
||||||
|
<if test="specialSkillName != null and specialSkillName !=''">special_skill_name = #{specialSkillName},</if>
|
||||||
|
<if test="goodsCategoryId != null and goodsCategoryId > 0">goods_category_id = #{provinceId},</if>
|
||||||
|
<if test="dangerous != null">dangerous = #{dangerous},</if>
|
||||||
|
<if test="remark != null and remark != ''">remark = #{remark},</if>
|
||||||
|
create_time = sysdate()
|
||||||
|
</set>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="delete" parameterType="Long">
|
||||||
|
DELETE FROM special_skill WHERE special_skill_id IN
|
||||||
|
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
<?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.ghy.worker.mapper.WorkerSpecialSkillMapper">
|
||||||
|
|
||||||
|
<resultMap id="WorkerSpecialSkillResult" type="com.ghy.worker.domain.WorkerSpecialSkill">
|
||||||
|
<result property="workerSpecialSkillId" column="worker_special_skill_id"/>
|
||||||
|
<result property="workerId" column="worker_id"/>
|
||||||
|
<result property="specialSkillId" column="special_skill_id"/>
|
||||||
|
<result property="credential" column="credential"/>
|
||||||
|
<result property="insurance" column="insurance"/>
|
||||||
|
<result property="insuranceStart" column="insurance_start"/>
|
||||||
|
<result property="insuranceEnd" column="insurance_end"/>
|
||||||
|
<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"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="insert" parameterType="com.ghy.worker.domain.WorkerSpecialSkill" useGeneratedKeys="true"
|
||||||
|
keyProperty="workerSpecialSkillId">
|
||||||
|
INSERT INTO worker_special_skill(
|
||||||
|
<if test="workerId != null and workerId > 0">worker_id,</if>
|
||||||
|
<if test="specialSkillId != null and specialSkillId > 0">special_skill_id,</if>
|
||||||
|
<if test="credential != null and credential != ''">credential,</if>
|
||||||
|
<if test="insurance != null and insurance != ''">insurance,</if>
|
||||||
|
<if test="insuranceStart != null">insurance_start,</if>
|
||||||
|
<if test="insuranceEnd != null">insurance_end,</if>
|
||||||
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
|
<if test="remark != null and remark != ''">remark,</if>
|
||||||
|
create_time
|
||||||
|
)VALUES(
|
||||||
|
<if test="workerId != null and workerId > 0">#{workerId},</if>
|
||||||
|
<if test="specialSkillId != null and specialSkillId > 0">#{specialSkillId},</if>
|
||||||
|
<if test="credential != null and credential != ''">#{credential},</if>
|
||||||
|
<if test="insurance != null and insurance != ''">#{insurance},</if>
|
||||||
|
<if test="insuranceStart != null">#{insuranceStart},</if>
|
||||||
|
<if test="insuranceEnd != null">#{insuranceEnd},</if>
|
||||||
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
|
<if test="remark != null and remark != ''">#{remark},</if>
|
||||||
|
sysdate()
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<select id="getByWorker" parameterType="Long" resultMap="WorkerSpecialSkillResult">
|
||||||
|
SELECT *
|
||||||
|
FROM worker_special_skill
|
||||||
|
WHERE worker_id = #{workerId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="deleteByWorker" parameterType="Long">
|
||||||
|
DELETE
|
||||||
|
FROM worker_special_skill
|
||||||
|
WHERE worker_id = #{workerId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="delete" parameterType="Long">
|
||||||
|
DELETE FROM worker_special_skill WHERE worker_special_skill_id IN
|
||||||
|
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue