This commit is contained in:
sungsu
2024-01-17 17:03:28 +09:00
parent ccd7d743d8
commit 9c91eb41cb
17 changed files with 1903 additions and 78 deletions

View File

@@ -12,16 +12,39 @@
<result column="acc.name" property="name" />
</association>
</resultMap>
<insert id="insert" parameterType="resetPasswordDto">
insert into reset_password
(
id, account_id, note, date
)
(id, account_id, note, date)
VALUES
(
UUID(), (SELECT id from account where employee_number = #{employeeNumber} ), #{note}, NOW()
)
(UUID(), (SELECT id from account where employee_number = #{employeeNumber} ), #{note}, NOW())
</insert>
<select id="resetpasswordAll" resultMap="resetPasswordResultMap" parameterType="map">
SELECT
id, account_id, note, date, acc.id, acc.name, acc.mail, acc.employee_number
from reset_password rs join account acc on rs.account_id = acc.id
<where>
<choose>
<when test="searchn == 1"> acc.activation = 1 and acc.name like concat('%',#{search},'%')</when>
<when test="searchn == 0"> acc.activation = 1 and acc.employee_number like concat('%',#{search},'%') </when>
</choose>
</where>
order by date desc limit #{start}, #{perPage}
</select>
<select id="count" resultMap="resetPasswordResultMap" parameterType="map">
SELECT
count(id)
<where>
<choose>
<when test="searchn == 1"> acc.activation = 1 and acc.name like concat('%',#{search},'%')</when>
<when test="searchn == 0"> acc.activation = 1 and acc.employee_number like concat('%',#{search},'%') </when>
</choose>
</where>
order by date desc limit #{start}, #{perPage}
</select>
<select id="selectAll" resultMap="resetPasswordResultMap" parameterType="map">
SELECT
id, account_id, note, date, acc.id, acc.name